update_copyrights revision 4e71e9b6c86d4d437c1beb4070861a77464f98e6
#
# 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 INTERNET SOFTWARE CONSORTIUM
# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
# INTERNET SOFTWARE CONSORTIUM 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.26 2001/07/30 23:45:03 gson 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):.*\$';
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;
$last_year = 0;
$anchor_year = 0;
} else {
}
} else {
}
}
$last_year = $year;
}
$firstline =~ s/\@YEARS\@/$years/;
$secondline =~ s/\@YEARS\@/$years/;
print TARGET $secondline =~ /^$/ ? $nonspaceprefix : $prefix;
}
print TARGET $end_comment if $end_comment;
}
} else {
}
undef $/;
$_ = <SOURCE>;
$/ = "\n";
} else {
}
}
print TARGET $_;
}
} else {
}
}