update_copyrights revision a809c57ab263613c79999653ad28fbe47fa4bfa3
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Copyright (C) 1998-2001, 2004-2010, 2012-2016 Internet Systems Consortium, Inc. ("ISC")
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# This Source Code Form is subject to the terms of the Mozilla Public
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# License, v. 2.0. If a copy of the MPL was not distributed with this
28a8f5b0de57d269cf2845c69cb6abe18cbd3b3aMark Andrews# file, You can obtain one at http://mozilla.org/MPL/2.0/.
ef421f66f47224a42073deaf087378c5d0c9952eEvan Huntrequire 5.002;
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# Map copyright owners to the files containing copyright messages.
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# The first line of the copyright message is not in the file;
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# it is constructed by this script.
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# Map each copyright owner name to a reference to an array containing
ef421f66f47224a42073deaf087378c5d0c9952eEvan Hunt# the lines of the copyright message.
a2ca594252024a7b26d2f6b1984cb6da6f5bd09cMark Andrewsmy $keyword_pat = '\$(Id:.*|Revision:.*|Id|Revision)\$';
a2ca594252024a7b26d2f6b1984cb6da6f5bd09cMark Andrews open(COPYRIGHT, "<$f") || die "can't open $f: $!";
a2ca594252024a7b26d2f6b1984cb6da6f5bd09cMark Andrews($dummy,$dummy,$dummy,$dummy,$this_month,$this_year,$dummy,$dummy,$dummy) = localtime(time());
a2ca594252024a7b26d2f6b1984cb6da6f5bd09cMark Andrews if (defined($years_list) && $years_list =~ /^PARENT:/) {
a266ab205bfd1c510022e2cd2a8cb62988242593Mark Andrews $parent =~ s/\.[^.]*$/.docbook/;
a2ca594252024a7b26d2f6b1984cb6da6f5bd09cMark Andrews $result = "$result <year>$_</year>\n" foreach (@_);
a2ca594252024a7b26d2f6b1984cb6da6f5bd09cMark Andrews $result = "$result <holder>$holder</holder>\n";
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt my $a = copyright("Internet Systems Consortium, Inc. (\"ISC\")", @_);
a69070d8fab55dbc63ba9f96c9d3e34f0ea9119aMark Andrews # copyright notice is now generated from the source.
a69070d8fab55dbc63ba9f96c9d3e34f0ea9119aMark Andrews my ($type, $owner) = split(/\./, $typeandowner);
5a75f61dd413720c16d229b24ebba6bd6ecdb738Evan Hunt if ($file eq "./CHANGES" || $file eq "./EXCLUDED" ||
5a75f61dd413720c16d229b24ebba6bd6ecdb738Evan Hunt open(SOURCE, "<$file") || die "can't open $file: $!";
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt # Remove 1-7 spaces followed by a tab into a single
de52784e45e3a7a92c0d8ad843eb4db313bbfd97Mark Andrews # tab if at start of line or proceeded by tabs.
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews s/^(\s{0,3}\d*\.)\s(\[\w{1,5}\])\s+(\S+)/$1\t$2\t\t$3/;
af850c4120c5bee9462de4def85d0b4c1b583963Mark Andrews s/^(\s{0,3}\d*\.)\s(\[\w{6,}\])\s+(\S+)/$1\t$2\t$3/;
8a2ab2b9203120c3e2a883a5ee8c0b5d60c1808cEvan Hunt s/[ \t]*$//;
a266ab205bfd1c510022e2cd2a8cb62988242593Mark Andrews open(TARGET, ">$file.new") || die "can't open $file.new: $!";
ce376a81fa674d240197628ceb6113a4fa5a1ab3Mukund Sivaraman $start_comment = "############################################################################\n";
7829fad4093f2c1985b1efb7cea00287ff015d2bckb $end_comment = "############################################################################\n"
f6e45a5c54b7af4b1c303e8d3ff3b7d78622df9eMark Andrews $start_comment = "############################################################################\n";
1bbd36c4db2c86762b582db4b0504e6e68a183f6Mark Andrews $end_comment = "############################################################################\n"
5a75f61dd413720c16d229b24ebba6bd6ecdb738Evan Hunt print "$file: type '$type' not supported yet; skipping\n";
$_ = <SOURCE>;
$_ = <SOURCE>;
$_ = <SOURCE>;
last if $_ =~ /\*\//;
$_ = <SOURCE>;
$first = $_;
last;
$first = $_;
$_ = <SOURCE>;
$_ = <SOURCE> if $_ eq "############################################################################\n";
$_ = <SOURCE> if $_ eq "############################################################################\n";
$first = $_;
last;
$first = $_;
$_ = <SOURCE>;
$first = $_;
last;
$_ = <SOURCE>;
$_ = <SOURCE>;
$_ = <SOURCE>;
last;
$_ = <SOURCE>;
$_ = <SOURCE>;
$_ = <SOURCE>;
last if s/.*-->//;
$_ = <SOURCE>;
$first = $_;
$first = $_;
last if s/.*--->//;
$_ = <SOURCE>;
$first = $_;
$first = $_;
/Permission to use, copy, modify, and / ||
$first = $_;
$first = $_;
print TARGET $before_copyright if $before_copyright;
print TARGET $start_comment if $start_comment;
$last_year = 0;
$anchor_year = 0;
$last_year = $year;
$last_year = 0;
$anchor_year = 0;
my $andor = 0;
my $noid = 0;
$last_year = $year;
print TARGET $end_comment if $end_comment;
$_ = $body;
$_ = $body;
undef $/;
$_ = <SOURCE>;
s:<articleinfo>.*?</articleinfo>:<articleinfo>\n$r </articleinfo>:s;