[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: AW: Re: Copyright notices - update everything to 2006?

From: Branko Čibej <brane_at_xbc.nu>
Date: 2006-01-19 20:41:31 CET

Julian Foad wrote:
> Peter N. Lundblad wrote:
>>
>> I guess the best thing is to do a sweep right before a major release,
>> comparing last committed date with the copyright year and updating if
>> necessary. Would that be a sufficient solution?
>
> If... no, When someone writes a little script that checks the
> copyright year in this way, we should have "make check" run this check
> on every file that is locally modified or added. That way we'll not
> have to remember to run the check, and the update to each individual
> file will be made at exactly the right time, i.e. exactly when someone
> modifies it for the first time in a given year.
>
> By the way, I don't think there is any point in sweeping our files to
> update those that were changed in 2005 to say "2005"; we wouldn't gain
> anything significant (it was last done in 2004) and the "last changed
> date" according to Subversion would then confusingly be "2006".
>
> Note that we have a tool that is relevant, but not exactly what I
> want: tools/dev/check-license.py.
>
> Here is my contribution: a shell script to list any locally-modified
> files whose copyright notices need updating if they are to be checked in.
>
> [[[
> #!/bin/sh
> # Find changed files whose copyright notices need updating.
>
> THIS_YEAR=`date +%Y`
>
> # List the locally modified/added files.
> svn status -q | grep "^[AMR]" | cut -c 8- |
>
> while read F; do
> # Find the last 4-digit number in the first "...Copyright...NNNN..."
> line.
> # This will be empty if there is no such line.
> C_YEAR=`sed -n 's/.*Copyright.*\([0-9][0-9][0-9][0-9]\).*/\1/;T;p;q'
> < "$F"`
>
> # If there is a copyright notice and the year is wrong, report it.
> if test "$C_YEAR" && test "$C_YEAR" != "$THIS_YEAR"; then
> echo "$C_YEAR $F"
> fi
> done
> ]]]
A python version would be nice, so that we can run it from win-tests.py,
too.

-- Brane

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jan 20 00:17:39 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.