update_copyrights revision 828a5beda384130d5e2913dadd862924c53405bf
7d32c065c7bb56f281651ae3dd2888f32ce4f1d9Bob Halley# Copyright (C) 1998, 1999, 2000 Internet Software Consortium.
5fbced719b71e659322b4ce3e4a39c9b039674c7Bob Halley# Permission to use, copy, modify, and distribute this software for any
5fbced719b71e659322b4ce3e4a39c9b039674c7Bob Halley# purpose with or without fee is hereby granted, provided that the above
5fbced719b71e659322b4ce3e4a39c9b039674c7Bob Halley# copyright notice and this permission notice appear in all copies.
5fbced719b71e659322b4ce3e4a39c9b039674c7Bob Halley# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
5fbced719b71e659322b4ce3e4a39c9b039674c7Bob Halley# ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
5fbced719b71e659322b4ce3e4a39c9b039674c7Bob Halley# OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
5fbced719b71e659322b4ce3e4a39c9b039674c7Bob Halley# CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
5fbced719b71e659322b4ce3e4a39c9b039674c7Bob Halley# DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
5fbced719b71e659322b4ce3e4a39c9b039674c7Bob Halley# PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
5fbced719b71e659322b4ce3e4a39c9b039674c7Bob Halley# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson# Map copyright owners to the files containing copyright messages.
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson# The first line of the copyright message is not in the file;
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson# it is constructed by this script.
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson# Map each copyright owner name to a reference to an array containing
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson# the lines of the copyright message.
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson open(COPYRIGHT, "<$f") || die "can't open $f: $!";
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson $owner2text{$owner} = [ @copyright_text ];
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson ($file, $typeandowner, $years_list) = split(/\s+/);
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson my ($type, $owner) = split(/\./, $typeandowner);
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson print "$file: unknown copyright owner $owner\n";
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson # XXXTALE lib/isc/commandline.c should probably also have special handling.
178f6ad061e54bc5babfca3577f72058fa0797c1Bob Halley } elsif ($type eq "SH" || $type eq "PERL" || $type eq "MAKE") {
efd6c944a4ebd3fb65dc39f9172d322198b2b1d3Bob Halley print "$file: type '$type' not supported yet; skipping\n";
b897c52f865b2fc4e220e2110b874e59c716456bBob Halley open(SOURCE, "<$file") || die "can't open $file: $!";
b897c52f865b2fc4e220e2110b874e59c716456bBob Halley open(TARGET, ">$file.new") || die "can't open $file.new: $!";
b897c52f865b2fc4e220e2110b874e59c716456bBob Halley rename("$file", "$file.bak") || die "rename($file, $file.bak): $!";
b897c52f865b2fc4e220e2110b874e59c716456bBob Halley rename("$file.new", "$file") || die "rename($file.new, $file): $!";