update_copyrights revision 30eec077db2bdcb6f2a0dc388a3cdde2ede75ec1
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen# Copyright (C) 2004-2010, 2012-2015 Internet Systems Consortium, Inc. ("ISC")
13c6532dc104d23061e6901783ceb1ff8872c206Timo Sirainen# Copyright (C) 1998-2001 Internet Software Consortium.
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen# Permission to use, copy, modify, and/or distribute this software for any
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen# purpose with or without fee is hereby granted, provided that the above
920b9f0fdfa5a5d7763e05736601a31bcb291a53Timo Sirainen# copyright notice and this permission notice appear in all copies.
a40d26f83af808a0ea1e212c001d682a96d870b0Timo Sirainen# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9a583c7a827f7a4d89ee43774f2d51ea6a214543Timo Sirainen# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9a583c7a827f7a4d89ee43774f2d51ea6a214543Timo Sirainen# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
9a583c7a827f7a4d89ee43774f2d51ea6a214543Timo Sirainen# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
f0ff961282e618945dfe997dc45ff95d656e5790Timo Sirainen# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen# PERFORMANCE OF THIS SOFTWARE.
f0ff961282e618945dfe997dc45ff95d656e5790Timo Sirainenrequire 5.002;
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen# Map copyright owners to the files containing copyright messages.
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen# The first line of the copyright message is not in the file;
1a21e7049796c98d6d998fcf7a438d7a97193dc4Timo Sirainen# it is constructed by this script.
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen# Map each copyright owner name to a reference to an array containing
a40d26f83af808a0ea1e212c001d682a96d870b0Timo Sirainen# the lines of the copyright message.
920b9f0fdfa5a5d7763e05736601a31bcb291a53Timo Sirainenmy $keyword_pat = '\$(Id:.*|Revision:.*|Id|Revision)\$';
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen open(COPYRIGHT, "<$f") || die "can't open $f: $!";
e015e2f7e7f48874495f9df8b0dd192b7ffcb5ccTimo Sirainen($dummy,$dummy,$dummy,$dummy,$this_month,$this_year,$dummy,$dummy,$dummy) = localtime(time());
e015e2f7e7f48874495f9df8b0dd192b7ffcb5ccTimo Sirainen if (defined($years_list) && $years_list =~ /^PARENT:/) {
4bbee99b3aef449a9a2a11a5b5cf1ca486915c49Timo Sirainen $parent =~ s/\.[^.]*$/.docbook/;
4bbee99b3aef449a9a2a11a5b5cf1ca486915c49Timo Sirainen $result = "$result <year>$_</year>\n" foreach (@_);
e015e2f7e7f48874495f9df8b0dd192b7ffcb5ccTimo Sirainen $result = "$result <holder>$holder</holder>\n";
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen my $a = copyright("Internet Systems Consortium, Inc. (\"ISC\")",
4bbee99b3aef449a9a2a11a5b5cf1ca486915c49Timo Sirainen my $b = copyright("Internet Software Consortium.",
18d92dbbb752c79dc461514e52f7ef11847e636bTimo Sirainen # copyright notice is now generated from the source.
f501ad38c51cf1d8f4f84313922c785e6ae6e81fTimo Sirainen my ($type, $owner) = split(/\./, $typeandowner);
f501ad38c51cf1d8f4f84313922c785e6ae6e81fTimo Sirainen print "$file: unknown copyright owner $owner\n";
4bbee99b3aef449a9a2a11a5b5cf1ca486915c49Timo Sirainen if ($file eq "./CHANGES" || $file eq "./EXCLUDED" ||
a75d470c9223a75801418fcdda258885c36317e0Timo Sirainen open(SOURCE, "<$file") || die "can't open $file: $!";
58be9d6bcc3800f5b3d76a064ee767fbe31a5a8aTimo Sirainen # Remove 1-7 spaces followed by a tab into a single
58be9d6bcc3800f5b3d76a064ee767fbe31a5a8aTimo Sirainen # tab if at start of line or proceeded by tabs.
58be9d6bcc3800f5b3d76a064ee767fbe31a5a8aTimo Sirainen s/^(\t*) {1,7}\t/$1\t/ while (/^\t* {1,7}\t/);
e015e2f7e7f48874495f9df8b0dd192b7ffcb5ccTimo Sirainen s/^(\s{0,3}\d*\.)\s(\[\w{1,5}\])\s+(\S+)/$1\t$2\t\t$3/;
e015e2f7e7f48874495f9df8b0dd192b7ffcb5ccTimo Sirainen s/^(\s{0,3}\d*\.)\s(\[\w{6,}\])\s+(\S+)/$1\t$2\t$3/;
8aacc9e7c84f8376822823ec98c2f551d4919b2eTimo Sirainen # Convert 8 spaces into tabs if at start of line
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen open(TARGET, ">$file.new") || die "can't open $file.new: $!";
8ac66221e8fdc2c5523cff1893e0d1c5de25fa49Timo Sirainen } elsif ($type =~ /^(SH|PERL|TCL|MAKE|CONF-SH|RNC)$/) {
6b85bc4b03e552cfaeeae872d63c2d8ac5fcb7c4Timo Sirainen $start_comment = "############################################################################\n";
6b85bc4b03e552cfaeeae872d63c2d8ac5fcb7c4Timo Sirainen $end_comment = "############################################################################\n"
0dffa25d211be541ee3c953b23566a1a990789dfTimo Sirainen } elsif ($type eq "HTML" || $type eq "SGML") {
131b073bdc3650083b00616dc778dd3017c2bbb5Timo Sirainen print "$file: type '$type' not supported yet; skipping\n";
e015e2f7e7f48874495f9df8b0dd192b7ffcb5ccTimo Sirainen open(SOURCE, "<$file") || die "can't open $file: $!";
d33fc6c584718efd46159e1d8f46488b9dfc66f5Timo Sirainen last if $_ =~ /\*\//;
$_ = <SOURCE>;
$_ = <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;
$last_year = $year;
$last_year = 0;
$anchor_year = 0;
my $andor = 0;
my $noid = 0;
$last_year = $year;
$firstline =~ s/\@SYSYEARS\@/$sysyears/;
$secondline =~ s/\@SFTYEARS\@/$sftyears/;
print TARGET $secondline =~ /^$/ ? $nonspaceprefix : $prefix;
print TARGET $end_comment if $end_comment;
$_ = $body;
$_ = $body;
undef $/;
$_ = <SOURCE>;
s:<articleinfo>.*?</articleinfo>:<articleinfo>\n$r </articleinfo>:s;