update_copyrights revision 5a48c9f76003a649e16de34fe6206e3b67b97afb
499b34cea04a46823d003d4c0520c8b03e8513cbBrian Wellington# Copyright (C) 1998-2001 Internet Software Consortium.
5fbced719b71e659322b4ce3e4a39c9b039674c7Bob Halley# Permission to use, copy, modify, and distribute this software for any
5fbced719b71e659322b4ce3e4a39c9b039674c7Bob Halley# purpose with or without fee is hereby granted, provided that the above
5fbced719b71e659322b4ce3e4a39c9b039674c7Bob Halley# copyright notice and this permission notice appear in all copies.
15a44745412679c30a6d022733925af70a38b715David Lawrence# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
15a44745412679c30a6d022733925af70a38b715David Lawrence# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
15a44745412679c30a6d022733925af70a38b715David Lawrence# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
15a44745412679c30a6d022733925af70a38b715David Lawrence# INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
15a44745412679c30a6d022733925af70a38b715David Lawrence# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
15a44745412679c30a6d022733925af70a38b715David Lawrence# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
15a44745412679c30a6d022733925af70a38b715David Lawrence# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
15a44745412679c30a6d022733925af70a38b715David Lawrence# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
5a48c9f76003a649e16de34fe6206e3b67b97afbBob Halley# $Id: update_copyrights,v 1.23 2001/03/27 17:57:28 halley Exp $
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.
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence open(COPYRIGHT, "<$f") || die "can't open $f: $!";
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence ($file, $typeandowner, $years_list) = split(/\s+/);
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence my ($type, $owner) = split(/\./, $typeandowner);
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence print "$file: unknown copyright owner $owner\n";
abfb7fe67fd97adfa4628afa79af5d98c2d9cad0Andreas Gustafsson } elsif ($type =~ /^(SH|PERL|TCL|MAKE|CONF-SH)$/) {
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 $_ =~ /\*\//;
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence } elsif (($m4_comment || $zone_comment || $man_comment) &&
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;
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence if ($last_year != 0 && $year == $last_year + 1) {
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence $years .= $last_year == 0 ? "$year" : ", $year";
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence print TARGET (/^$/ ? $nonspaceprefix : $prefix);
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence ($end = $end_comment) =~ s/^\s*(.*)\n/ $1\n/;
f4a7d04843eb62c92f2d4ff338da49ae86e3279bDavid Lawrence print TARGET $first if $first !~ /^\s*$/;