update_copyrights revision 59663800d2ec04777dae2791dd92aa563faf94c8
#
# Copyright (C) 1998-2001, 2004-2010, 2012-2016 Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
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";
}
next;
}
# print "Doing: $file";
next;
}
}
# copyright notice is now generated from the source.
next;
}
}
$textp = $owner2text{$owner};
next;
}
{
# 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/);
s/^(\s{0,3}\d*\.)\s(\[\w{1,5}\])\s+(\S+)/$1\t$2\t\t$3/;
s/^(\s{0,3}\d*\.)\s(\[\w{6,}\])\s+(\S+)/$1\t$2\t$3/;
# 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;
print TARGET $_;
} else {
}
}
$c_comment = 0;
$shell_comment = 0;
$m4_comment = 0;
$sgml_comment = 0;
$mkd_comment = 0;
$zone_comment = 0;
$man_comment = 0;
$python_comment = 0;
$python_bin_comment = 0;
$c_comment = 1;
$shell_comment = 1;
$python_bin_comment = 1;
$end_comment = "############################################################################\n"
$python_comment = 1;
$end_comment = "############################################################################\n"
$zone_comment = 1;
$man_comment = 1;
$m4_comment = 1;
$sgml_comment = 1;
$mkd_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>;
$_ = <SOURCE> if $_ eq "############################################################################\n";
$_ = <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>;
if (/]>$/) {
$_ = <SOURCE>;
last;
}
}
next;
}
if (/>$/ ) {
$_ = <SOURCE>;
next;
}
$_ = <SOURCE>;
$_ = <SOURCE>;
}
next;
}
}
if (/^<!--/) {
next;
}
last if s/.*-->//;
$_ = <SOURCE>;
}
print "$file: unterminated comment\n"
$first = $_;
} else {
}
} else {
$first = $_;
}
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;
#
# 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;
}
# make a copy
}
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*) {8}/$1\t/ while (/^\t* {8}/);
# Remove trailing white space.
s/[ \t]*$//;
}
$_ = $body;
# 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";
}
s:<!-- insert copyright start -->.*?<!-- insert copyright end -->:<!-- insert copyright start -->\n$r <!-- insert copyright end -->:s;
}
} else {
}
if (!$noid && $first !~ /$keyword_pat/ &&
}
}
} else {
}
}