update_copyrights revision 15a44745412679c30a6d022733925af70a38b715
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence# Copyright (C) 1998-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.
15a44745412679c30a6d022733925af70a38b715David Lawrence# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
15a44745412679c30a6d022733925af70a38b715David Lawrence# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
15a44745412679c30a6d022733925af70a38b715David Lawrence# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
15a44745412679c30a6d022733925af70a38b715David Lawrence# INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
15a44745412679c30a6d022733925af70a38b715David Lawrence# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
15a44745412679c30a6d022733925af70a38b715David Lawrence# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
15a44745412679c30a6d022733925af70a38b715David Lawrence# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
15a44745412679c30a6d022733925af70a38b715David Lawrence# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15a44745412679c30a6d022733925af70a38b715David Lawrence# $Id: update_copyrights,v 1.17 2000/07/27 09:55:03 tale Exp $
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";
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence } elsif ($type =~ /^(SH|PERL|MAKE|CONF-SH)/) {
efd6c944a4ebd3fb65dc39f9172d322198b2b1d3Bob Halley print "$file: type '$type' not supported yet; skipping\n";
b897c52f865b2fc4e220e2110b874e59c716456bBob Halley open(SOURCE, "<$file") || die "can't open $file: $!";
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence print "$file: unexpected yacc file start (expected \"%{\\n\")\n";
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence } elsif (($m4_comment || $zone_comment || $man_comment) &&
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence last if s/.*-->//;
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence print "$file: unterminated comment\n" unless defined($_);
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence # Not very maintainable, but suitable enough for now.
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence /Permission to use, copy, modify, and distribute / ||
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence /THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET /;
b897c52f865b2fc4e220e2110b874e59c716456bBob Halley open(TARGET, ">$file.new") || die "can't open $file.new: $!";
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence if ($last_year != 0 && $year == $last_year + 1) {
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence $years .= $last_year == 0 ? "$year" : ", $year";
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence print "$file: noncontiguous year: $year != $last_year + 1\n";
541ed6feaf687e97990ad19748faeec744158559David Lawrence ($end = $end_comment) =~ s/^\s*(.*)\n/ $1\n/;
541ed6feaf687e97990ad19748faeec744158559David Lawrence print TARGET $first if $first !~ /^\s*$/;
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence rename("$file", "$file.bak") || die "rename($file, $file.bak): $!";
4b598d8ae578861d5f3fc1333c9f84c9c9c8be7cDavid Lawrence rename("$file.new", "$file") || die "rename($file.new, $file): $!";