update_copyrights revision e85ffb301b294d70ddc1d90234788403666bb944
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User# Copyright (C) 1998-2000 Internet Software Consortium.
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User# Permission to use, copy, modify, and distribute this software for any
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User# purpose with or without fee is hereby granted, provided that the above
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User# copyright notice and this permission notice appear in all copies.
d6fa26d0adaec6c910115be34fe7a5a5f402c14fMark Andrews# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# $Id: update_copyrights,v 1.14 2000/06/22 22:24:05 tale Exp $
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox Userrequire 5.002;
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# Map copyright owners to the files containing copyright messages.
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# The first line of the copyright message is not in the file;
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# it is constructed by this script.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Map each copyright owner name to a reference to an array containing
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# the lines of the copyright message.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein open(COPYRIGHT, "<$f") || die "can't open $f: $!";
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User ($file, $typeandowner, $years_list) = split(/\s+/);
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User my ($type, $owner) = split(/\./, $typeandowner);
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User print "$file: unknown copyright owner $owner\n";
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User } elsif ($type =~ /^(SH|PERL|MAKE|CONF-SH)/) {
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein print "$file: type '$type' not supported yet; skipping\n";
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein open(SOURCE, "<$file") || die "can't open $file: $!";
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein print "$file: unexpected yacc file start (expected \"%{\\n\")\n";
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein } elsif (($m4_comment || $zone_comment || $man_comment) &&
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein last if s/.*-->//;
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein print "$file: unterminated comment\n" unless defined($_);
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # Not very maintainable, but suitable enough for now.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein /Permission to use, copy, modify, and distribute / ||
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User /THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET /;
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein open(TARGET, ">$file.new") || die "can't open $file.new: $!";
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein if ($last_year != 0 && $year == $last_year + 1) {
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User $years .= $last_year == 0 ? "$year" : ", $year";
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein print "$file: noncontiguous year: $year != $last_year + 1\n";
undef $/;
$_ = <SOURCE>;
print TARGET $_;