update_copyrights revision 599a98b25ca10c501bdf3368eab2a2a951130949
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Copyright (C) 1998-2001 Internet Software Consortium.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Permission to use, copy, modify, and/or distribute this software for any
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# purpose with or without fee is hereby granted, provided that the above
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# copyright notice and this permission notice appear in all copies.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
ad135b5d644628e791c3188a6ecbd9c257961ef8Christopher Siden# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
ad135b5d644628e791c3188a6ecbd9c257961ef8Christopher Siden# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
45405cce0657d01714b3d014a0facf3bdce45736Alexander Eremin# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore# PERFORMANCE OF THIS SOFTWARE.
ad135b5d644628e791c3188a6ecbd9c257961ef8Christopher Siden# $Id: update_copyrights,v 1.49 2007/06/18 05:59:26 marka Exp $
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankovrequire 5.002;
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# Map copyright owners to the files containing copyright messages.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# The first line of the copyright message is not in the file;
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# it is constructed by this script.
ad135b5d644628e791c3188a6ecbd9c257961ef8Christopher Siden# perl util/update_copyrights <util/copyrights
ad135b5d644628e791c3188a6ecbd9c257961ef8Christopher Siden# Map each copyright owner name to a reference to an array containing
ad135b5d644628e791c3188a6ecbd9c257961ef8Christopher Siden# the lines of the copyright message.
ad135b5d644628e791c3188a6ecbd9c257961ef8Christopher Sidenmy $keyword_pat = '\$(Id:.*|Revision:.*|Id|Revision)\$';
1767006bb066ef500b90b432fba79d63d0d09b36Bryan Cantrill open(COPYRIGHT, "<$f") || die "can't open $f: $!";
ad135b5d644628e791c3188a6ecbd9c257961ef8Christopher Siden $owner2text{$owner} = [ @copyright_text ];
ad135b5d644628e791c3188a6ecbd9c257961ef8Christopher Siden if (defined($years_list) && $years_list =~ /^PARENT:/) {
ad135b5d644628e791c3188a6ecbd9c257961ef8Christopher Siden $parent =~ s/\.[^.]*$/.docbook/;
ad135b5d644628e791c3188a6ecbd9c257961ef8Christopher Siden $result = "$result <year>$_</year>\n" foreach (@_);
ad135b5d644628e791c3188a6ecbd9c257961ef8Christopher Siden $result = "$result <holder>$holder</holder>\n";
ad135b5d644628e791c3188a6ecbd9c257961ef8Christopher Siden my $a = copyright("Internet Systems Consortium, Inc. (\"ISC\")",
ad135b5d644628e791c3188a6ecbd9c257961ef8Christopher Siden my $b = copyright("Internet Software Consortium.",
ad135b5d644628e791c3188a6ecbd9c257961ef8Christopher Siden # copyright notice is now generated from the source.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe my ($type, $owner) = split(/\./, $typeandowner);
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe print "$file: unknown copyright owner $owner\n";
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe } elsif ($type =~ /^(SH|PERL|TCL|MAKE|CONF-SH|RNC)$/) {
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov print "$file: type '$type' not supported yet; skipping\n";
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov open(SOURCE, "<$file") || die "can't open $file: $!";
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov last if $_ =~ /\*\//;
$_ = <SOURCE>;
$first = $_;
last;
$first = $_;
$_ = <SOURCE>;
$first = $_;
last;
$_ = <SOURCE>;
$_ = <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/;
print TARGET $secondline =~ /^$/ ? $nonspaceprefix : $prefix;
print TARGET $end_comment if $end_comment;
undef $/;
$_ = <SOURCE>;
s:<articleinfo>.*?</articleinfo>:<articleinfo>\n$r </articleinfo>:s;
print TARGET $_;