The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

update-copyright.pl - Tool to update copyright years

SYNOPSIS

update-copyright.pl [options] path...

OPTIONS

 -q [--quiet]           : Do not show per file progress messages
 -v [--verbose]         : Show diffs to changed files
 -i [--ignore-years]    : Ignore the years already present use history only

DESCRIPTION

update-copyright.pl is a script that uses svk to figure out when each file in your project has changed and updates the copyright headers in those files accordingly.

Run update-copyright.pl help to access the built-in tool documentation.

CODE

$current_year

The year in which we live today. This is added to the copyright of any file that is modified, since we're modifying it today. If we didn't do this a subsequent run of this script would add it anyway.

flushline ()

Helper function to clear a console line.

expandRange ($years)

Take the string $years containing comma separated years or dash separated year ranges and returns a list of years.

For example the string '1998, 2000-2002, 2004' results in the list qw(1998 2000 2001 2002 2004).

createRange (@years)

Takes a sorted list of years @years and returns a string of comma separated years or dash separated year ranges.

For example the list qw(1998 2000 2001 2002 2004) results in the string '1998-2002, 2004'.

transform_line($line, @years)

If $line contains a copyright message add the years in @years to it and return the resulting line. If there is no Copyright on a line return undef. If @years is not specified Copyright lines are returned as is.

get_file_changed_years($filename)

Return a sorted list of years in which $filename was modified.

update_file_copyright($filename)

Update the copyright of one file.

AUTHORS

Michael L.H. Brouwer <michael@tlaloc.net<gt>

COPYRIGHT

Copyright 2006 by Michael L.H. Brouwer <michael@tlaloc.net>.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://www.perl.com/perl/misc/Artistic.html