← Back to team overview

launchpad-dev team mailing list archive

New utility script: update-copyright

 

Hi LP coders!

Devel revision 11645 has a new script "utilities/update-copyright". It will
update the years in the "Copyright 2009-2010 Canonical Ltd." statement that is
found on top of each source file (*) in the LP tree. This is such a minor
thing that it is often forgotten and many files still refer to just "2009"
although they have already been changed this year. (The notice was only added
last year before LP was open-sourced.)

It takes a list of files to update but will only actually change those files
where it can find the copyright notice on the first three lines and where that
notice is out of date. If no file names are given it will find the changed
files, using the same logic that "make lint" uses. See below for more. The
script is verbose about each file it processes with no switch to make it shut
up. ;)

As already pointed out by Robert on the merge proposal[1], there is a Bazaar
plugin for this purpose[2] and I agree that that is were this kind of stuff
should probably go. Unfortunately the plugin is not (yet) suited for our needs
but whenever that changes, this script can be removed from the tree.

As a by-product I created "utilities/find-changed-files.py" by extracting that
code from lint.sh.in. It determines the changed file list which is either:
 - files that have uncommitted changes, if there are any, or
 - files changed compared to the lower thread, if this is a loom, or
 - files changed compared to the previous pipe, if this is a pipeline, or
 - files changed compared to the parent branch.

Enjoy!

Henning

(*) Not all our files, most notably doc tests, have copyright notices. Is that
intentional or were they forgotten?

[1]
https://code.launchpad.net/~henninge/launchpad/devel-update-copyright/+merge/36701
[2] https://launchpad.net/bzr-update-copyright




Follow ups