update_copyrights revision 0ba25dfc4cecede3228acf372b3373880a5355b0
#
*
*
# $Id$
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.
#
# Usage:
#
# perl util/update_copyrights <util/copyrights
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 ];
}
my %file_types = ();
my %file_years = ();
my $years_list;
my $parent;
$this_year += 1900;
while (<>) {
$file_types{$file} = $type;
$file_years{$file} = $years;
}
sub getyears {
$parent = $_[0];
}
}
sub docbook {
$parent = $_[0];
}
sub copyright {
my $holder = shift;
return $result;
}
sub copyrights {
return "$a$b";
}
next;
}
# print "Doing: $file";
next;
}
}
# copyright notice is now generated from the source.
next;
}
}
$textp = $owner2text{$owner};
next;
}
$c_comment = 0;
$shell_comment = 0;
$m4_comment = 0;
$sgml_comment = 0;
$zone_comment = 0;
$man_comment = 0;
$python_comment = 0;
$c_comment = 1;
$shell_comment = 1;
$python_comment = 1;
$end_comment = "############################################################################\n"
$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 = $_;
}
if (/^\#\!/) {
$_ = <SOURCE>;
$_ = <SOURCE> if $_ eq "############################################################################\n";
}
if (/^\#/) {
next;
}
if ($_ !~ /^\#/) {
$first = $_;
last;
}
}
} else {
$first = $_;
}
$_ = <SOURCE>;
}
next;
}
if ($_ !~ /^\Q$nonspaceprefix\E/ ||
$first = $_;
last;
}
}
# print "SGML: $_";
if (/>$/ ) {
$_ = <SOURCE>;
next;
}
$_ = <SOURCE>;
$_ = <SOURCE>;
}
next;
}
}
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 {
#if ($anchor_year != 0) {
# print "$file: noncontiguous year: ",
# "$year != $last_year + 1\n";
#}
}
$last_year = $year;
}
#
# Nominum: up to 2001.
#
$last_year = 0;
$anchor_year = 0;
} else {
}
} else {
#if ($anchor_year != 0) {
# print "$file: noncontiguous year: ",
# "$year != $last_year + 1\n";
#}
}
$last_year = $year;
}
#
# Internet Systems Consortium: 2004 onwards.
#
$last_year = 0;
$anchor_year = 0;
my $andor = 0;
my $noid = 0;
} else {
}
} else {
#if ($anchor_year != 0) {
# print "$file: noncontiguous year: ",
# "$year != $last_year + 1\n";
#}
}
$last_year = $year;
}
$firstline =~ s/\@SYSYEARS\@/$sysyears/;
$secondline =~ s/\@SFTYEARS\@/$sftyears/;
print TARGET $secondline =~ /^$/ ? $nonspaceprefix : $prefix;
}
}
print TARGET $end_comment if $end_comment;
}
} else {
}
# Process leading white space.
# Remove 1-7 spaces followed by a tab into a single
# tab if at start of line or proceeded by tabs.
s/^(\t*) {1,7}\t/$1\t/ while (/^\t* {1,7}\t/);
# Convert 8 spaces into tabs if at start of line
# or preceeded by tabs.
s/^(\t*) /$1\t/ while (/^\t* /);
# Remove trailing white space.
s/[ \t]*$//;
}
$_ = $body;
} else {
undef $/;
$_ = <SOURCE>;
$/ = "\n";
}
# print "docinfo: $file\n";
s:<articleinfo>.*?</articleinfo>:<articleinfo>\n$r </articleinfo>:s;
}
# print "docinfo: $file\n";
}
# print "bookinfo: $file\n";
}
} else {
}
if (!$noid && $first !~ /$keyword_pat/ &&
}
}
} else {
}
}