update_copyrights revision 5bae12051f80947fb9a5a6a3a54762e8bd08d95b
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson# Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson# Copyright (C) 1998-2001 Internet Software Consortium.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson# Permission to use, copy, modify, and distribute this software for any
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson# purpose with or without fee is hereby granted, provided that the above
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson# copyright notice and this permission notice appear in all copies.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson# PERFORMANCE OF THIS SOFTWARE.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson# $Id: update_copyrights,v 1.39 2005/05/13 01:06:30 marka Exp $
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson# Map copyright owners to the files containing copyright messages.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson# The first line of the copyright message is not in the file;
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson# it is constructed by this script.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson# Map each copyright owner name to a reference to an array containing
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson# the lines of the copyright message.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonmy $keyword_pat = '\$(Id:.*|Revision:.*|Id|Revision)\$';
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson open(COPYRIGHT, "<$f") || die "can't open $f: $!";
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson $owner2text{$owner} = [ @copyright_text ];
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson if (defined($years_list) && $years_list =~ /^PARENT:/) {
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson $parent =~ s/\.[^.]*$/.docbook/;
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson $result = "$result <year>$_</year>\n" foreach (@_);
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson $result = "$result <holder>$holder</holder>\n";
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson my $a = copyright("Internet Systems Consortium, Inc. (\"ISC\")",
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson my $b = copyright("Internet Software Consortium.",
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson # copyright notice is now generated from the source.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson my ($type, $owner) = split(/\./, $typeandowner);
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson print "$file: unknown copyright owner $owner\n";
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson } elsif ($type =~ /^(SH|PERL|TCL|MAKE|CONF-SH)$/) {
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson } elsif ($type eq "ZONE" || $type eq "MC") {
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson } elsif ($type eq "HTML" || $type eq "SGML") {
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson print "$file: type '$type' not supported yet; skipping\n";
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson open(SOURCE, "<$file") || die "can't open $file: $!";
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson print "$file: unexpected yacc file start ",
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson last if $_ =~ /\*\//;
$_ = <SOURCE>;
$first = $_;
last;
$first = $_;
$_ = <SOURCE>;
$first = $_;
last;
$before_copyright = $_;
$_ = <SOURCE>;
$_ = <SOURCE>;
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;
$last_year = $year;
$firstline =~ s/\@SYSYEARS\@/$sysyears/;
$secondline =~ s/\@SFTYEARS\@/$sftyears/;
$thirdline =~ s/\@NOMYEARS\@/$nomyears/;
print TARGET $secondline =~ /^$/ ? $nonspaceprefix : $prefix;
print TARGET $thirdline =~ /^$/ ? $nonspaceprefix : $prefix;
print TARGET $end_comment if $end_comment;
undef $/;
$_ = <SOURCE>;
print TARGET $_;