update_copyrights revision db88737897a943c6005724f21064ab4cc34a245b
7bd455641455950eff7d21be652c8142b134d32fTinderbox User# Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC")
7bd455641455950eff7d21be652c8142b134d32fTinderbox User# Copyright (C) 1998-2001 Internet Software Consortium.
7bd455641455950eff7d21be652c8142b134d32fTinderbox User# Permission to use, copy, modify, and distribute this software for any
7bd455641455950eff7d21be652c8142b134d32fTinderbox User# purpose with or without fee is hereby granted, provided that the above
7bd455641455950eff7d21be652c8142b134d32fTinderbox User# copyright notice and this permission notice appear in all copies.
7bd455641455950eff7d21be652c8142b134d32fTinderbox User# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
7bd455641455950eff7d21be652c8142b134d32fTinderbox User# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
7bd455641455950eff7d21be652c8142b134d32fTinderbox User# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
7bd455641455950eff7d21be652c8142b134d32fTinderbox User# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
7bd455641455950eff7d21be652c8142b134d32fTinderbox User# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
8cbf3b6fc35091abde426930f2eadb8f53476c98Evan Hunt# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# PERFORMANCE OF THIS SOFTWARE.
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# $Id: update_copyrights,v 1.43 2006/10/26 01:42:27 marka Exp $
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrewsrequire 5.002;
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# Map copyright owners to the files containing copyright messages.
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# The first line of the copyright message is not in the file;
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# it is constructed by this script.
92b796c963e7ba0217debfa27a0709f94934f5d5Mark Andrews# Map each copyright owner name to a reference to an array containing
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews# the lines of the copyright message.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halleymy $keyword_pat = '\$(Id:.*|Revision:.*|Id|Revision)\$';
f4ea363e3acc321b24ffe95a64a583e8041d6fd5Mark Andrews open(COPYRIGHT, "<$f") || die "can't open $f: $!";
6b66ee9147e940572a0e873ecbd67456ccb85c39Mark Andrews if (defined($years_list) && $years_list =~ /^PARENT:/) {
11dbf2fc38eea8c5d3fe7123718bf197a8bb2e6bMark Andrews $parent =~ s/\.[^.]*$/.docbook/;
1c1290afabb3c8f4dd498170ac9592e5be450161Mark Andrews $result = "$result <year>$_</year>\n" foreach (@_);
b123b265e3a3d9b72a14230b6517e0f6fdb5c5b5Mark Andrews $result = "$result <holder>$holder</holder>\n";
32ebb157b1d9409a186c86002827f8a1f4931f5aMark Andrews my $a = copyright("Internet Systems Consortium, Inc. (\"ISC\")",
32ebb157b1d9409a186c86002827f8a1f4931f5aMark Andrews my $b = copyright("Internet Software Consortium.",
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt # copyright notice is now generated from the source.
6fa84a3e255ef9e6233f0a8d134fc6d273f04599Evan Hunt } elsif ($type =~ /^(SH|PERL|TCL|MAKE|CONF-SH)$/) {
91306d962f9d147d94b82fb14edb28f8d907cae7Andreas Gustafsson print "$file: type '$type' not supported yet; skipping\n";
e893dce91279d7313a579f72caae3941f6dc5a27David Lawrence open(SOURCE, "<$file") || die "can't open $file: $!";
3b77946b751f39bd4db5a7d1fe48a81e6b1e7a28Bob Halley last if $_ =~ /\*\//;
523f3d630243211ddfda852f5224f7eff681d3a5Evan Hunt } elsif (($m4_comment || $zone_comment || $man_comment) &&
523f3d630243211ddfda852f5224f7eff681d3a5Evan Hunt last if s/.*-->//;
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews # Not very maintainable, but ok enough for now.
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence open(TARGET, ">$file.new") || die "can't open $file.new: $!";
b587e1d83f007ce68a9ae93097c461d8eb7aa373Mark Andrews print TARGET $before_copyright if $before_copyright;
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence print TARGET $start_comment if $start_comment;
df3c4c7988b9bae7d121a8ac9ed17a23366a948dDavid Lawrence if ($last_year != 0 && $year == $last_year + 1) {
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews $years .= $last_year == 0 ? "$year" : ", $year";
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews if ($last_year != 0 && $year == $last_year + 1) {
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews $years .= $last_year == 0 ? "$year" : ", $year";
289ae548d52bc8f982d9823af64cafda7bd92232Mark Andrews if ($last_year != 0 && $year == $last_year + 1) {
4bcaefbcd3ced942139fdc830e007c6ea2b8d2feDavid Lawrence $years .= $last_year == 0 ? "$year" : ", $year";
4bcaefbcd3ced942139fdc830e007c6ea2b8d2feDavid Lawrence ($firstline, $secondline, $thirdline, @otherlines) = @$textp;
657ce0b9d84fbd66514df53d61a087e8f1161187Michael Graff print TARGET $secondline =~ /^$/ ? $nonspaceprefix : $prefix;
657ce0b9d84fbd66514df53d61a087e8f1161187Michael Graff print TARGET $thirdline =~ /^$/ ? $nonspaceprefix : $prefix;
641da3ca1184d9951d5cf91538524a345bf5f271Mark Andrews print TARGET (/^$/ ? $nonspaceprefix : $prefix);
774c3a62d9adca187b44fe90919bb409a43a2f2aMark Andrews if ($type eq 'SGML' && m:<articleinfo>.*?</articleinfo>:s) {
774c3a62d9adca187b44fe90919bb409a43a2f2aMark Andrews s:<articleinfo>.*?</articleinfo>:<articleinfo>\n$r </articleinfo>:s;
774c3a62d9adca187b44fe90919bb409a43a2f2aMark Andrews if ($type eq 'SGML' && m:<docinfo>.*?</docinfo>:s) {
774c3a62d9adca187b44fe90919bb409a43a2f2aMark Andrews s:<docinfo>.*?</docinfo>:<docinfo>\n$r </docinfo>:s;
774c3a62d9adca187b44fe90919bb409a43a2f2aMark Andrews if ($type eq 'SGML' && m:<bookinfo>.*?</bookinfo>:s) {
d7896edb4e93c4785a9281ea86afba86b758e813Mark Andrews s:<bookinfo>.*?</bookinfo>:<bookinfo>\n$r </bookinfo>:s;
9fe28a624c659e380d47dbf45527637dab03b998Mark Andrews if ($first !~ /$keyword_pat/ && $_ !~ /$keyword_pat/) {
9fe28a624c659e380d47dbf45527637dab03b998Mark Andrews $end = "\n$nonspaceprefix" if ($type eq "MAN");
5b7abbef511cea0b568be0bc8d5b3120a0b9034dEvan Hunt print TARGET $first if $first !~ /^\s*$/;