update_copyrights revision cb3e854e181373807f7f011e5050c1a8013b4841
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# Copyright (C) 1998-2001 Internet Software Consortium.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# Permission to use, copy, modify, and distribute this software for any
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# purpose with or without fee is hereby granted, provided that the above
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# copyright notice and this permission notice appear in all copies.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# $Id: update_copyrights,v 1.24 2001/03/27 20:07:53 bwelling Exp $
6398f22526303343193a18e514602f1af6fb29cbNikolai Kondrashov# Map copyright owners to the files containing copyright messages.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# The first line of the copyright message is not in the file;
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# it is constructed by this script.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# Map each copyright owner name to a reference to an array containing
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# the lines of the copyright message.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov open(COPYRIGHT, "<$f") || die "can't open $f: $!";
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov $owner2text{$owner} = [ @copyright_text ];
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov ($file, $typeandowner, $years_list) = split(/\s+/);
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov my ($type, $owner) = split(/\./, $typeandowner);
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov print "$file: unknown copyright owner $owner\n";
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov } elsif ($type =~ /^(SH|PERL|TCL|MAKE|CONF-SH)$/) {
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov } elsif ($type eq "HTML" || $type eq "SGML") {
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov print "$file: type '$type' not supported yet; skipping\n";
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov open(SOURCE, "<$file") || die "can't open $file: $!";
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov print "$file: unexpected yacc file start ",
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov last if $_ =~ /\*\//;
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov } elsif (($m4_comment || $zone_comment || $man_comment) &&
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov # Not very maintainable, but ok enough for now.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov /Permission to use, copy, modify, and / ||
6398f22526303343193a18e514602f1af6fb29cbNikolai Kondrashov open(TARGET, ">$file.new") || die "can't open $file.new: $!";
6398f22526303343193a18e514602f1af6fb29cbNikolai Kondrashov print TARGET $before_copyright if $before_copyright;
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov print TARGET $start_comment if $start_comment;
9d453f1e8b28983b363b44c49b7cd701a994fd97Nikolai Kondrashov if ($last_year != 0 && $year == $last_year + 1) {
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov $years .= $last_year == 0 ? "$year" : ", $year";
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov ($firstline, $secondline, @otherlines) = @$textp;
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov print TARGET $secondline =~ /^$/ ? $nonspaceprefix : $prefix;
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov print TARGET (/^$/ ? $nonspaceprefix : $prefix);
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov print TARGET $end_comment if $end_comment;
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov ($end = $end_comment) =~ s/^\s*(.*)\n/ $1\n/;
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov print TARGET $first if $first !~ /^\s*$/;
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov if (system("cmp -s $file.new $file") == 0) {