update_copyrights revision a299dbc5667ccce4e9c7e40b5ed1e106e27e787f
e81f7dffab7e793394b84f4a451f51b3db3a7e25Tinderbox User# Copyright (C) 2004-2010, 2012, 2013 Internet Systems Consortium, Inc. ("ISC")
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# Copyright (C) 1998-2001 Internet Software Consortium.
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# Permission to use, copy, modify, and/or distribute this software for any
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# purpose with or without fee is hereby granted, provided that the above
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# copyright notice and this permission notice appear in all copies.
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# PERFORMANCE OF THIS SOFTWARE.
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson# Map copyright owners to the files containing copyright messages.
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson# The first line of the copyright message is not in the file;
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence# it is constructed by this script.
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson# Map each copyright owner name to a reference to an array containing
5a6e6c2c9b2f6cf426aa2a682aa800765e26d540Andreas Gustafsson# the lines of the copyright message.
6ca4964362ec37d6afbf614dbb9aaa2f525002f1Mark Andrewsmy $keyword_pat = '\$(Id:.*|Revision:.*|Id|Revision)\$';
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence open(COPYRIGHT, "<$f") || die "can't open $f: $!";
9640c35421ba0bb4af6b6bfbff695d2a0ac560b3Mark Andrews($dummy,$dummy,$dummy,$dummy,$this_month,$this_year,$dummy,$dummy,$dummy) = localtime(time());
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews if (defined($years_list) && $years_list =~ /^PARENT:/) {
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews $parent =~ s/\.[^.]*$/.docbook/;
e107074f370ee86275bd64ab8bcaa429fec1c7e2Mark Andrews $result = "$result <year>$_</year>\n" foreach (@_);
e107074f370ee86275bd64ab8bcaa429fec1c7e2Mark Andrews $result = "$result <holder>$holder</holder>\n";
e107074f370ee86275bd64ab8bcaa429fec1c7e2Mark Andrews my $a = copyright("Internet Systems Consortium, Inc. (\"ISC\")",
e107074f370ee86275bd64ab8bcaa429fec1c7e2Mark Andrews my $b = copyright("Internet Software Consortium.",
f6161d8b90541b52946ae845bc8e2bec2647d6cbMark Andrews # copyright notice is now generated from the source.
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence my ($type, $owner) = split(/\./, $typeandowner);
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence print "$file: unknown copyright owner $owner\n";
17f0452d8584cbcd6772b6d79eeadfa462162a51Mark Andrews if ($file eq "./CHANGES" || $file eq "./EXCLUDED" ||
17f0452d8584cbcd6772b6d79eeadfa462162a51Mark Andrews open(SOURCE, "<$file") || die "can't open $file: $!";
17f0452d8584cbcd6772b6d79eeadfa462162a51Mark Andrews # Remove 1-7 spaces followed by a tab into a single
17f0452d8584cbcd6772b6d79eeadfa462162a51Mark Andrews # tab if at start of line or proceeded by tabs.
3b84724c44654f5c851b04acd71ba3fb6af133feMark Andrews s/^(\s{0,3}\d*\.)\s(\[\w{1,5}\])\s+(\S+)/$1\t$2\t\t$3/;
3b84724c44654f5c851b04acd71ba3fb6af133feMark Andrews s/^(\s{0,3}\d*\.)\s(\[\w{6,}\])\s+(\S+)/$1\t$2\t$3/;
17f0452d8584cbcd6772b6d79eeadfa462162a51Mark Andrews # Convert 8 spaces into tabs if at start of line
17f0452d8584cbcd6772b6d79eeadfa462162a51Mark Andrews s/[ \t]*$//;
17f0452d8584cbcd6772b6d79eeadfa462162a51Mark Andrews open(TARGET, ">$file.new") || die "can't open $file.new: $!";
2da2220fe7af2c45724b50b0187523b1fab0cf08Rob Austein } elsif ($type =~ /^(SH|PERL|TCL|MAKE|CONF-SH|RNC)$/) {
9640c35421ba0bb4af6b6bfbff695d2a0ac560b3Mark Andrews $start_comment = "############################################################################\n";
9640c35421ba0bb4af6b6bfbff695d2a0ac560b3Mark Andrews $end_comment = "############################################################################\n"
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence print "$file: type '$type' not supported yet; skipping\n";
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence open(SOURCE, "<$file") || die "can't open $file: $!";
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence last if $_ =~ /\*\//;
9640c35421ba0bb4af6b6bfbff695d2a0ac560b3Mark Andrews $_ = <SOURCE> if $_ eq "############################################################################\n";
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence } elsif (($m4_comment || $zone_comment || $man_comment) &&
3d17258ff6c22bee15e3197d0e61a7ecaba7ed86Mark Andrews while (/^<!DOCTYPE/ || /^<\?xml-stylesheet/ || /^<\?xml /) {
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence last if s/.*-->//;
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence # Not very maintainable, but ok enough for now.
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence open(TARGET, ">$file.new") || die "can't open $file.new: $!";
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence print TARGET $before_copyright if $before_copyright;
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence print TARGET $start_comment if $start_comment;
0295f63b67bb09cd4d00dd1d9c2238c37beefed8Mark Andrews if ($last_year != 0 && $year == $last_year + 1) {
0295f63b67bb09cd4d00dd1d9c2238c37beefed8Mark Andrews $years .= $last_year == 0 ? "$year" : ", $year";
0295f63b67bb09cd4d00dd1d9c2238c37beefed8Mark Andrews if ($last_year != 0 && $year == $last_year + 1) {
0295f63b67bb09cd4d00dd1d9c2238c37beefed8Mark Andrews $years .= $last_year == 0 ? "$year" : ", $year";
9640c35421ba0bb4af6b6bfbff695d2a0ac560b3Mark Andrews $noid = 1 if ($year > 2012 || ($year == 2012 && $this_month >= 5) );
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence if ($last_year != 0 && $year == $last_year + 1) {
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence $years .= $last_year == 0 ? "$year" : ", $year";
599a98b25ca10c501bdf3368eab2a2a951130949Mark Andrews ($firstline, $secondline, @otherlines) = @$textp;
0295f63b67bb09cd4d00dd1d9c2238c37beefed8Mark Andrews print TARGET $secondline =~ /^$/ ? $nonspaceprefix : $prefix;
144a3203a6e1827d78fb046e92b15ece82e6e378Mark Andrews s:modify, and distribute:modify, and/or distribute: if ($andor);
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence print TARGET (/^$/ ? $nonspaceprefix : $prefix);
14731fe09a82ff330f999236ad40571de033d523Mark Andrews # Remove 1-7 spaces followed by a tab into a single
14731fe09a82ff330f999236ad40571de033d523Mark Andrews # tab if at start of line or proceeded by tabs.
14731fe09a82ff330f999236ad40571de033d523Mark Andrews # Convert 8 spaces into tabs if at start of line
14731fe09a82ff330f999236ad40571de033d523Mark Andrews s/[ \t]*$//;
10e873cb368b0ed17a328e5421a0411eb90da0cbMark Andrews if ($type eq 'SGML' && m:<articleinfo>.*?</articleinfo>:s) {
10e873cb368b0ed17a328e5421a0411eb90da0cbMark Andrews s:<articleinfo>.*?</articleinfo>:<articleinfo>\n$r </articleinfo>:s;
e107074f370ee86275bd64ab8bcaa429fec1c7e2Mark Andrews if ($type eq 'SGML' && m:<docinfo>.*?</docinfo>:s) {
c61c6db1cea02006815184845fcf1b633b28163dMark Andrews s:<docinfo>.*?</docinfo>:<docinfo>\n$r </docinfo>:s;
e107074f370ee86275bd64ab8bcaa429fec1c7e2Mark Andrews if ($type eq 'SGML' && m:<bookinfo>.*?</bookinfo>:s) {
e107074f370ee86275bd64ab8bcaa429fec1c7e2Mark Andrews s:<bookinfo>.*?</bookinfo>:<bookinfo>\n$r </bookinfo>:s;
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence ($end = $end_comment) =~ s/^\s*(.*)\n/ $1\n/;
6ca4964362ec37d6afbf614dbb9aaa2f525002f1Mark Andrews $end = "\n$nonspaceprefix" if ($type eq "MAN");
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence print TARGET $first if $first !~ /^\s*$/;