update_copyrights revision 599a98b25ca10c501bdf3368eab2a2a951130949
6fe42ff85ced80bd2ccc49b429d36831b5f2a5b9Tinderbox User# Copyright (C) 2004-2007 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.
1d32b1df372d6be6bac6450739b9e5ea23819995Evan Hunt# $Id: update_copyrights,v 1.49 2007/06/18 05:59:26 marka Exp $
c3c6770e537ea916265c78d0294ad108233e17c1Michael Sawyerrequire 5.002;
c3c6770e537ea916265c78d0294ad108233e17c1Michael Sawyer# Map copyright owners to the files containing copyright messages.
c3c6770e537ea916265c78d0294ad108233e17c1Michael Sawyer# The first line of the copyright message is not in the file;
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews# it is constructed by this script.
30a60d2aff0ec1810262a8b8efc532e28b32bd57Evan Hunt# Map each copyright owner name to a reference to an array containing
30a60d2aff0ec1810262a8b8efc532e28b32bd57Evan Hunt# the lines of the copyright message.
222d38735f97f771054e223b03f84c5858252332Evan Huntmy $keyword_pat = '\$(Id:.*|Revision:.*|Id|Revision)\$';
222d38735f97f771054e223b03f84c5858252332Evan Hunt open(COPYRIGHT, "<$f") || die "can't open $f: $!";
28002bd7cb4baa0eab9f47e1e51069c5ea7ea5d4Andreas Gustafsson if (defined($years_list) && $years_list =~ /^PARENT:/) {
c634c94d673f1bab17e7f65d332f989b683e712cDavid Lawrence $parent =~ s/\.[^.]*$/.docbook/;
222d38735f97f771054e223b03f84c5858252332Evan Hunt $result = "$result <year>$_</year>\n" foreach (@_);
c3c6770e537ea916265c78d0294ad108233e17c1Michael Sawyer $result = "$result <holder>$holder</holder>\n";
c3c6770e537ea916265c78d0294ad108233e17c1Michael Sawyer my $a = copyright("Internet Systems Consortium, Inc. (\"ISC\")",
9069215eac23e32f4ef1c8e44ad7ff2865cfcdacEvan Hunt my $b = copyright("Internet Software Consortium.",
9069215eac23e32f4ef1c8e44ad7ff2865cfcdacEvan Hunt # copyright notice is now generated from the source.
b5b934a0bb46aded1552a17473652b5a7f4a3274Evan Hunt } elsif ($type =~ /^(SH|PERL|TCL|MAKE|CONF-SH|RNC)$/) {
6de9744cf9c64be2145f663e4051196a4eaa9d45Evan Hunt print "$file: type '$type' not supported yet; skipping\n";
6de9744cf9c64be2145f663e4051196a4eaa9d45Evan Hunt open(SOURCE, "<$file") || die "can't open $file: $!";
6de9744cf9c64be2145f663e4051196a4eaa9d45Evan Hunt last if $_ =~ /\*\//;
ffff5d67926821d3db8df63bdd84a9cb1ce56739Evan Hunt } elsif (($m4_comment || $zone_comment || $man_comment) &&
a69070d8fab55dbc63ba9f96c9d3e34f0ea9119aMark Andrews while (/^<!DOCTYPE/ || /^<\?xml-stylesheet/ || /^<\?xml /) {
222d38735f97f771054e223b03f84c5858252332Evan Hunt last if s/.*-->//;
dc9c461b27df798ba7c3d9ba1446840c5f85553bMichael Sawyer # Not very maintainable, but ok enough for now.
222d38735f97f771054e223b03f84c5858252332Evan Hunt open(TARGET, ">$file.new") || die "can't open $file.new: $!";
5337a9e53c7df1ef40d70528f2360c5e4cb9a7d1Andreas Gustafsson print TARGET $before_copyright if $before_copyright;
5337a9e53c7df1ef40d70528f2360c5e4cb9a7d1Andreas Gustafsson print TARGET $start_comment if $start_comment;
5337a9e53c7df1ef40d70528f2360c5e4cb9a7d1Andreas Gustafsson # Internet Software Consortium: up to 2003
5337a9e53c7df1ef40d70528f2360c5e4cb9a7d1Andreas Gustafsson $years .= $last_year == 0 ? "$year" : ", $year";
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews if ($last_year != 0 && $year == $last_year + 1) {
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews $years .= $last_year == 0 ? "$year" : ", $year";
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews if ($last_year != 0 && $year == $last_year + 1) {
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews $years .= $last_year == 0 ? "$year" : ", $year";
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews ($firstline, $secondline, @otherlines) = @$textp;
222d38735f97f771054e223b03f84c5858252332Evan Hunt print TARGET $secondline =~ /^$/ ? $nonspaceprefix : $prefix;
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews print TARGET (/^$/ ? $nonspaceprefix : $prefix);
8aee18709f238406719768b8a6b843a15c5075f8Mark Andrews if ($type eq 'SGML' && m:<articleinfo>.*?</articleinfo>:s) {
e2f470bebb3a0c107bc4ac86c6920c21e50e83e0Brian Wellington s:<articleinfo>.*?</articleinfo>:<articleinfo>\n$r </articleinfo>:s;
e2f470bebb3a0c107bc4ac86c6920c21e50e83e0Brian Wellington if ($type eq 'SGML' && m:<docinfo>.*?</docinfo>:s) {
f0a1134d331b2aa871306c73d2787960918eaab1Andreas Gustafsson s:<docinfo>.*?</docinfo>:<docinfo>\n$r </docinfo>:s;
f0a1134d331b2aa871306c73d2787960918eaab1Andreas Gustafsson if ($type eq 'SGML' && m:<bookinfo>.*?</bookinfo>:s) {
e2f470bebb3a0c107bc4ac86c6920c21e50e83e0Brian Wellington s:<bookinfo>.*?</bookinfo>:<bookinfo>\n$r </bookinfo>:s;
16cc4a1f56d0f9a300419da7e75e3b72169e608aMark Andrews if ($first !~ /$keyword_pat/ && $_ !~ /$keyword_pat/) {
16cc4a1f56d0f9a300419da7e75e3b72169e608aMark Andrews $end = "\n$nonspaceprefix" if ($type eq "MAN");
16cc4a1f56d0f9a300419da7e75e3b72169e608aMark Andrews print TARGET $first if $first !~ /^\s*$/;