Writing the Right Copyright dates? Right

Ed says:

There is no way in cvs (or in svn either) to get just the year substituted in so it looks like some perl....

We need to change the copyright line which is at the top of each of our source code files, currently it reads:

 *  Copyright (c) XXXX: Genome Research Ltd.
where XXXX is a number of different dates.

It should all be changed to read:

 *  Copyright (c) 2006 - 2010 Genome Research Ltd.

Be good to report any .c or .h files that don't have a copyright line.

How to do this?

We can use find to pull out all the .c an .h files so that we can process then one by one.

A script can process each file by:

Perhaps it would be simplest to write a shell script to operate the CVS, but surely perl can run commands?

Where and How?

The script will live in the ZMap/scripts directory, as this is for build related functions, and be called 'CopyRight'.

In the interests of a quite life it is recommended that all files should be returned to CVS and ZMap should acheive a clean build before starting.

Use The script is called 'CopyRight' and lives in ZMap/scripts. It take two optional arguments and one file name:
      ZMap/scripts/CopyRight [-many] [-no-CVS] filename

If -many is not specified then only the first Copyright line is changed.

Only the first 50 lines of any file are subject to change.

if -no_CVS is specified the the file is processed directly and CVS is not used.

To process an entire source tree do something like the following:

      cd ZMap/src
      cvs update
      (find . -wholename "./zmap*/*\.[ch]" -exec ../scripts/CopyRight \{\} \; ) | tee hee
      cd include/ZMap
      (find . -name "*.h" -exec ../scripts/CopyRight \{\} \; ) | tee hee
Note that we don't want to change copyright dates in third party files! However, all third party software is in other directories at the same level as Zmap/src. so a find with -name is safe enough if you are brave.

Warning:

The above commands don't redirect STDERR, so maybe you want to run this inside bash and add in a 2>&1 somewhere.

Files needing a manual fix
./include/ZMap/sysdep.h: No copyright date found
./include/ZMap/zmapUrl.h: No copyright date found
./include/ZMap/zmapUrlUtils.h: No copyright date found
./zmapControl/remote/zmapXRemoteAPI.h: No copyright date found
./zmapUtils/safe-ctype.c: No copyright date found
./zmapUtils/safe-ctype.h: No copyright date found
./zmapUtils/zmapUrl.c: No copyright date found
./zmapUtils/zmapUrlOptions.h: No copyright date found
./zmapUtils/zmapUrlUtils.c: No copyright date found
./zmapUtils/zmapUrlUtils.h: No copyright date found
./zmapWindow/items/zmapWindowTextItemCMarshal.h: No copyright date found
./zmapWindow/items/zmapWindowTextItemCMarshal.c: No copyright date found
./zmapWindow/items/zmapWindowSequenceFeatureCMarshal.h: No copyright date found
./zmapWindow/items/zmapWindowSequenceFeatureCMarshal.c: No copyright date found