update_copyrights revision c968a9ca37964ae0bdc5d452ad784ec93bd04c57
18920d790825d96ca3943aa2dcb6eb80dc611c5fTinderbox User# Copyright (C) 1998-2001 Internet Software Consortium.
ab496cc3df1648e9ad992a87c35c2c0870fdc69dTinderbox User# Permission to use, copy, modify, and distribute this software for any
7c1468ed500356839a4a222517364e6ce18cb1a2Tinderbox User# purpose with or without fee is hereby granted, provided that the above
c57668a2fbbe558c1bd21652813616f2f517c469Tinderbox User# copyright notice and this permission notice appear in all copies.
1f4c645185bd8fc70048e0a69eee46193a284e5cTinderbox User# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark Andrews# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
8de3f14f1c300c3e1ed99084cc03485b42c92bf1Tinderbox User# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
950d203b64f512b85fcc093ee1e9e3e531a1aea3Tinderbox User# INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark Andrews# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
e676a596869d8a80a644c99a848afb53d1c5975eMark Andrews# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
e676a596869d8a80a644c99a848afb53d1c5975eMark Andrews# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
a7c412f37cc73d0332887a746e81220cbf09dd00Mark Andrews# $Id: update_copyrights,v 1.25 2001/06/10 14:01:10 tale Exp $
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrewsrequire 5.002;
e676a596869d8a80a644c99a848afb53d1c5975eMark Andrews# Map copyright owners to the files containing copyright messages.
e676a596869d8a80a644c99a848afb53d1c5975eMark Andrews# The first line of the copyright message is not in the file;
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# it is constructed by this script.
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews# Map each copyright owner name to a reference to an array containing
9ecb5d33470ebfb3719a1b8d56bcefdf4b27f7b2Tinderbox User# the lines of the copyright message.
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt open(COPYRIGHT, "<$f") || die "can't open $f: $!";
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt ($file, $typeandowner, $years_list) = split(/\s+/);
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews my ($type, $owner) = split(/\./, $typeandowner);
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews print "$file: unknown copyright owner $owner\n";
2ae159b376dac23870d8005563c585acf85a4b5aEvan Hunt } elsif ($type =~ /^(SH|PERL|TCL|MAKE|CONF-SH)$/) {
7a6494cfb6cc7d3f67af07359561e05e6bb8c0edTinderbox User } elsif ($type eq "HTML" || $type eq "SGML") {
9ecb5d33470ebfb3719a1b8d56bcefdf4b27f7b2Tinderbox User print "$file: type '$type' not supported yet; skipping\n";
9ecb5d33470ebfb3719a1b8d56bcefdf4b27f7b2Tinderbox User open(SOURCE, "<$file") || die "can't open $file: $!";
0e573cdd111e060e5f6c18249b5ccacbe8abe278Tinderbox User last if $_ =~ /\*\//;
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark Andrews } elsif (($m4_comment || $zone_comment || $man_comment) &&
9ecb5d33470ebfb3719a1b8d56bcefdf4b27f7b2Tinderbox User # Not very maintainable, but ok enough for now.
a7c412f37cc73d0332887a746e81220cbf09dd00Mark Andrews open(TARGET, ">$file.new") || die "can't open $file.new: $!";
dc238a06bffa79de141ee7655765e2df91498a8aTinderbox User print TARGET $before_copyright if $before_copyright;
37d8e0a4455876fe1e4cca511076cc2c5ab9eedeTinderbox User print TARGET $start_comment if $start_comment;
015055b6e23f5c08f6a5b34726f90b62597e9e45Tinderbox User if ($last_year != 0 && $year == $last_year + 1) {
dedefc0bdbb4e6e39eeb98aa2fc6883efec2ddb0Mark Andrews $years .= $last_year == 0 ? "$year" : ", $year";
d7d105151a78d35afb4233d2a6dbd47b7ec0d9a5Tinderbox User ($firstline, $secondline, @otherlines) = @$textp;
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater print TARGET $secondline =~ /^$/ ? $nonspaceprefix : $prefix;
5ecad47f69b3fd945472ab2900a9ff826a7ce2f6Automatic Updater print TARGET (/^$/ ? $nonspaceprefix : $prefix);
757ff043760e4743dda1a10e7d58349275934902Tinderbox User if ($first !~ /$keyword_pat/ && $_ !~ /$keyword_pat/) {
cf7e98f59148b559946a7f1ca728471374f1eef3Automatic Updater print TARGET $first if $first !~ /^\s*$/;