update_copyrights revision d9156bba3e3836d281e4f73d4eb8e8fbac9db657
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# Copyright (C) 2004-2010, 2012-2015 Internet Systems Consortium, Inc. ("ISC")
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence# Copyright (C) 1998-2001 Internet Software Consortium.
9b2267b5ba9d0640512a41e139a4a36caa43730dBob Halley# Permission to use, copy, modify, and/or distribute this software for any
9b2267b5ba9d0640512a41e139a4a36caa43730dBob Halley# purpose with or without fee is hereby granted, provided that the above
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence# copyright notice and this permission notice appear in all copies.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
9b2267b5ba9d0640512a41e139a4a36caa43730dBob Halley# PERFORMANCE OF THIS SOFTWARE.
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein# Map copyright owners to the files containing copyright messages.
9c3531d72aeaad6c5f01efe6a1c82023e1379e4dDavid Lawrence# The first line of the copyright message is not in the file;
9b2267b5ba9d0640512a41e139a4a36caa43730dBob Halley# it is constructed by this script.
764808211e952f1617aaa609281da66d80120c0dMark Andrews# Map each copyright owner name to a reference to an array containing
764808211e952f1617aaa609281da66d80120c0dMark Andrews# the lines of the copyright message.
cf300e03de3df3ff422db922520bf07c686c86daMark Andrewsmy $keyword_pat = '\$(Id:.*|Revision:.*|Id|Revision)\$';
a3a11c4f3fc9ba972802b811c4d95a9884d6ff4aMichael Sawyer open(COPYRIGHT, "<$f") || die "can't open $f: $!";
c52ae25dd70636c673d4a299859137a1c8ba611aMark Andrews($dummy,$dummy,$dummy,$dummy,$this_month,$this_year,$dummy,$dummy,$dummy) = localtime(time());
51e0ad287f1b345f0c3316f0633aab14d0e8bb65Brian Wellington if (defined($years_list) && $years_list =~ /^PARENT:/) {
5d98cf67b32d785aca1a72ea1dc4d559fab39208Mark Andrews $parent =~ s/\.[^.]*$/.docbook/;
5d98cf67b32d785aca1a72ea1dc4d559fab39208Mark Andrews $result = "$result <year>$_</year>\n" foreach (@_);
5d98cf67b32d785aca1a72ea1dc4d559fab39208Mark Andrews $result = "$result <holder>$holder</holder>\n";
5d98cf67b32d785aca1a72ea1dc4d559fab39208Mark Andrews my $a = copyright("Internet Systems Consortium, Inc. (\"ISC\")",
51e0ad287f1b345f0c3316f0633aab14d0e8bb65Brian Wellington my $b = copyright("Internet Software Consortium.",
dc2a0aa7aaa8b85398ae183c7274c0eeec5009afMark Andrews # copyright notice is now generated from the source.
d1e4b08844175357a925ddd6dcfa750cccd2b116Brian Wellington if ($file eq "./CHANGES" || $file eq "./EXCLUDED" ||
d1e4b08844175357a925ddd6dcfa750cccd2b116Brian Wellington open(SOURCE, "<$file") || die "can't open $file: $!";
da76a8046e01e1c1c2e6f75772afb2c4f202cc25Brian Wellington # Remove 1-7 spaces followed by a tab into a single
da76a8046e01e1c1c2e6f75772afb2c4f202cc25Brian Wellington # tab if at start of line or proceeded by tabs.
d1e4b08844175357a925ddd6dcfa750cccd2b116Brian Wellington s/^(\s{0,3}\d*\.)\s(\[\w{1,5}\])\s+(\S+)/$1\t$2\t\t$3/;
f8727bd90366af835f551da1b5e1fdfcd2d3d01fBrian Wellington s/^(\s{0,3}\d*\.)\s(\[\w{6,}\])\s+(\S+)/$1\t$2\t$3/;
0415ca35ada2cac6a86127eaca64f3a997aea121Evan Hunt s/[ \t]*$//;
9b2267b5ba9d0640512a41e139a4a36caa43730dBob Halley open(TARGET, ">$file.new") || die "can't open $file.new: $!";
2dfd6bca9aa6d9279b4278d6fa18ea5f63ba0ec9Bob Halley } elsif ($type =~ /^(SH|PERL|TCL|MAKE|CONF-SH|RNC)$/) {
88674be66567d3c7db91e717cd5972655e2e2488Mark Andrews $start_comment = "############################################################################\n";
88674be66567d3c7db91e717cd5972655e2e2488Mark Andrews $end_comment = "############################################################################\n"
0415ca35ada2cac6a86127eaca64f3a997aea121Evan Hunt print "$file: type '$type' not supported yet; skipping\n";
0415ca35ada2cac6a86127eaca64f3a997aea121Evan Hunt open(SOURCE, "<$file") || die "can't open $file: $!";
134ba0e08a0ae9a564a8d8628fc633377d3fc239Bob Halley last if $_ =~ /\*\//;
108490a7f8529aff50a0ac7897580b59a73d9845David Lawrence $_ = <SOURCE> if $_ eq "############################################################################\n";
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein } elsif (($m4_comment || $zone_comment || $man_comment) &&
2dfd6bca9aa6d9279b4278d6fa18ea5f63ba0ec9Bob Halley while (/^<!DOCTYPE/ || /^<!ENTITY/ || /^<\?xml-stylesheet/ || /^<\?xml /) {
9ee5efde7df57cbe70fb9b32c9d898e8ef7eca1eBob Halley last if s/.*-->//;
2c329da87c5c886e7f4468c69a9e6323121068cbMark Andrews last if s/.*--->//;
15197aefa1659e98ea1c48e2cbae631136a072b7Michael Graff open(TARGET, ">$file.new") || die "can't open $file.new: $!";
15197aefa1659e98ea1c48e2cbae631136a072b7Michael Graff print TARGET $before_copyright if $before_copyright;
15197aefa1659e98ea1c48e2cbae631136a072b7Michael Graff print TARGET $start_comment if $start_comment;
c52ae25dd70636c673d4a299859137a1c8ba611aMark Andrews if ($last_year != 0 && $year == $last_year + 1) {
2c329da87c5c886e7f4468c69a9e6323121068cbMark Andrews $years .= $last_year == 0 ? "$year" : ", $year";
c52ae25dd70636c673d4a299859137a1c8ba611aMark Andrews if ($last_year != 0 && $year == $last_year + 1) {
4b87939256ede703385e9cab92d3c58d03c31098Mark Andrews $noid = 1 if ($year > 2012 || ($year == 2012 && $this_month >= 5) );
f754fa97bc698cc251d227173a95e4d39a88ac01Mark Andrews if ($last_year != 0 && $year == $last_year + 1) {
2dfd6bca9aa6d9279b4278d6fa18ea5f63ba0ec9Bob Halley ($firstline, $secondline, @otherlines) = @$textp;
71954c957132c35ddf5f9e4dcc98c057b265b6d8Brian Wellington print TARGET $secondline =~ /^$/ ? $nonspaceprefix : $prefix;
202991557a4b7e8d3df7725d84f0fcae90dbaee6David Lawrence s:modify, and distribute:modify, and/or distribute: if ($andor);
4b87939256ede703385e9cab92d3c58d03c31098Mark Andrews print TARGET (/^$/ ? $nonspaceprefix : $prefix);
4b87939256ede703385e9cab92d3c58d03c31098Mark Andrews # Remove 1-7 spaces followed by a tab into a single
4e5388b45908ce8b8b35825ca6f16c1d236643baBrian Wellington # tab if at start of line or proceeded by tabs.
4b87939256ede703385e9cab92d3c58d03c31098Mark Andrews # Convert 8 spaces into tabs if at start of line
d53520b78d4a8726396efdbaa71f86f687a6f308Mark Andrews s/[ \t]*$//;
f61a7c87bf36b189d8f04ea4c8ab3ec55778355cMark Andrews if ($type eq 'SGML' && m:<articleinfo>.*?</articleinfo>:s) {
d53520b78d4a8726396efdbaa71f86f687a6f308Mark Andrews s:<articleinfo>.*?</articleinfo>:<articleinfo>\n$r </articleinfo>:s;
9ee5efde7df57cbe70fb9b32c9d898e8ef7eca1eBob Halley if ($type eq 'SGML' && m:<docinfo>.*?</docinfo>:s) {
6d54a6fc180acaf8772c9447cb925b31f39c7158Mark Andrews s:<docinfo>.*?</docinfo>:<docinfo>\n$r </docinfo>:s;
6d54a6fc180acaf8772c9447cb925b31f39c7158Mark Andrews if ($type eq 'SGML' && m:<bookinfo>.*?</bookinfo>:s) {
6d54a6fc180acaf8772c9447cb925b31f39c7158Mark Andrews $r .= " <xi:include href=\"releaseinfo.xml\"/>\n";
6d54a6fc180acaf8772c9447cb925b31f39c7158Mark Andrews s:<bookinfo>.*?</bookinfo>:<bookinfo>\n$r </bookinfo>:s;
51e0ad287f1b345f0c3316f0633aab14d0e8bb65Brian Wellington $end = "\n$nonspaceprefix" if ($type eq "MAN");
a3a11c4f3fc9ba972802b811c4d95a9884d6ff4aMichael Sawyer print TARGET $first if $first !~ /^\s*$/;