update_copyrights revision 499b34cea04a46823d003d4c0520c8b03e8513cb
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User# Copyright (C) 1998-2001 Internet Software Consortium.
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User# Permission to use, copy, modify, and distribute this software for any
1c57c3f79db0bf0358bbe6d7b5ad650c0c852f4bTinderbox User# purpose with or without fee is hereby granted, provided that the above
1c57c3f79db0bf0358bbe6d7b5ad650c0c852f4bTinderbox User# copyright notice and this permission notice appear in all copies.
1c57c3f79db0bf0358bbe6d7b5ad650c0c852f4bTinderbox User# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
1c57c3f79db0bf0358bbe6d7b5ad650c0c852f4bTinderbox User# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
1c57c3f79db0bf0358bbe6d7b5ad650c0c852f4bTinderbox User# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
1c57c3f79db0bf0358bbe6d7b5ad650c0c852f4bTinderbox User# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
f9ce6280cec79deb16ff6d9807aa493ff23e10d9Tinderbox User# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
1700442a7751c2bbdafe2d039cebbd8316496957Tinderbox User# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# $Id: update_copyrights,v 1.22 2001/01/09 22:01:04 bwelling Exp $
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userrequire 5.002;
46472a450e043434d78fa18edc73bca8c47f3981Tinderbox User# Map copyright owners to the files containing copyright messages.
e285c11870c6263cd79b418e104c7eb3e2d96952Tinderbox User# The first line of the copyright message is not in the file;
46472a450e043434d78fa18edc73bca8c47f3981Tinderbox User# it is constructed by this script.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Map each copyright owner name to a reference to an array containing
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# the lines of the copyright message.
a1ff871f78b7d907d6fc3a382beea2a640fe8423Tinderbox User open(COPYRIGHT, "<$f") || die "can't open $f: $!";
a1ff871f78b7d907d6fc3a382beea2a640fe8423Tinderbox User ($file, $typeandowner, $years_list) = split(/\s+/);
8a48b6b9b6fa8486f24b22d1972b2b6ebb36a4a4Tinderbox User my ($type, $owner) = split(/\./, $typeandowner);
a1ff871f78b7d907d6fc3a382beea2a640fe8423Tinderbox User print "$file: unknown copyright owner $owner\n";
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User } elsif ($type =~ /^(SH|PERL|TCL|MAKE|CONF-SH)$/) {
260e8e04b0dc24cb884c789b5d9eb046457f264eTinderbox User print "$file: type '$type' not supported yet; skipping\n";
260e8e04b0dc24cb884c789b5d9eb046457f264eTinderbox User open(SOURCE, "<$file") || die "can't open $file: $!";
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt last if $_ =~ /\*\//;
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User } elsif (($m4_comment || $zone_comment || $man_comment) &&
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt last if s/.*-->//;
1700442a7751c2bbdafe2d039cebbd8316496957Tinderbox User # Not very maintainable, but ok enough for now.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt open(TARGET, ">$file.new") || die "can't open $file.new: $!";
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt print TARGET $before_copyright if $before_copyright;
a1ff871f78b7d907d6fc3a382beea2a640fe8423Tinderbox User if ($last_year != 0 && $year == $last_year + 1) {
3241ddcf9354c5ab50f4df5a656e72a5c68e172bTinderbox User $years .= $last_year == 0 ? "$year" : ", $year";
3241ddcf9354c5ab50f4df5a656e72a5c68e172bTinderbox User print TARGET (/^$/ ? $nonspaceprefix : $prefix);
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt print TARGET $first if $first !~ /^\s*$/;