update_copyrights revision 1fa26403d7679235a30fbf6289f68fed5872df30
#
# Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 1998-2001 Internet Software Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
# $Id: update_copyrights,v 1.32 2004/03/16 05:22:33 marka Exp $
require 5.002;
# Map copyright owners to the files containing copyright messages.
# The first line of the copyright message is not in the file;
# it is constructed by this script.
my %owner2filename = (
);
# Map each copyright owner name to a reference to an array containing
# the lines of the copyright message.
my %owner2text = ();
my $keyword_pat = '\$(Id:.*|Revision:.*|Id|Revision)\$';
my $f = $owner2filename{$owner};
@copyright_text = <COPYRIGHT>;
$owner2text{$owner} = [ @copyright_text ];
}
while (<>) {
next;
}
$textp = $owner2text{$owner};
next;
}
$c_comment = 0;
$shell_comment = 0;
$m4_comment = 0;
$sgml_comment = 0;
$zone_comment = 0;
$man_comment = 0;
$c_comment = 1;
$shell_comment = 1;
$zone_comment = 1;
$man_comment = 1;
$m4_comment = 1;
$sgml_comment = 1;
} else {
next;
}
$_ = <SOURCE>;
"(expected \"%{\\n\")\n";
next;
}
$_ = <SOURCE>;
}
$_ = <SOURCE>;
next;
}
if ($_ !~ /\*\//) {
last if $_ =~ /\*\//;
}
}
if (/^\#\!/) {
$_ = <SOURCE>;
}
if (/^\#/) {
next;
}
if ($_ !~ /^\#/) {
$first = $_;
last;
}
}
} else {
$first = $_;
}
$_ = <SOURCE>;
}
next;
}
if ($_ !~ /^\Q$nonspaceprefix\E/ ||
$first = $_;
last;
}
}
$before_copyright = $_;
$_ = <SOURCE>;
}
if (/^<!/) {
next;
}
last if s/.*-->//;
$_ = <SOURCE>;
}
print "$file: unterminated comment\n"
$first = $_;
} else {
}
} else {
$first = $_;
}
$/ = ""; # paragraph at a time
# Not very maintainable, but ok enough for now.
/Permission to use, copy, modify, and / ||
}
$/ = "\n";
}
$first = $_;
} else {
$first = $_;
}
print TARGET $before_copyright if $before_copyright;
print TARGET $start_comment if $start_comment;
#
# Internet Software Consortium: up to 2003
#
$last_year = 0;
$anchor_year = 0;
} else {
}
} else {
}
}
$last_year = $year;
}
#
# Nominum: up to 2001.
#
$last_year = 0;
$anchor_year = 0;
} else {
}
} else {
}
}
$last_year = $year;
}
#
# Internet Systems Consortium: 2004 onwards.
#
$last_year = 2004;
$anchor_year = 2004;
} else {
}
} else {
}
}
$last_year = $year;
}
$firstline =~ s/\@SYSYEARS\@/$sysyears/;
$secondline =~ s/\@SFTYEARS\@/$sftyears/;
$thirdline =~ s/\@NOMYEARS\@/$nomyears/;
print TARGET $secondline =~ /^$/ ? $nonspaceprefix : $prefix;
}
print TARGET $thirdline =~ /^$/ ? $nonspaceprefix : $prefix;
}
print TARGET $end_comment if $end_comment;
}
} else {
}
undef $/;
$_ = <SOURCE>;
$/ = "\n";
} else {
}
}
print TARGET $_;
}
} else {
}
}