views:

94

answers:

2

Is there is an utility to change or modify the source code copyright notes in all source code files? I'm thinking about writing one in Python for myself, but perhaps there is already a solution available. Some template text with fields to fill in would be nice, too. It should also be somewhat intelligent about the language, i.e. i want it for java and python.

+1  A: 

You could use this perl one-liner:

find /path/ -type f | xargs perl -pi -e 's/oldnotice/newnotice/g'

Do make a backup before you use it :)

Andomar
I hope that everybody reading this, correctly escapes the notes...
tuergeist
+1  A: 

For code where we issue source, we actually have a build step which takes the unadorned source (without copyrights) and creates new source files with copyrights placed at the top.

We use the regular source files for development but it's the new source files which are the ones passed to manufacturing for distribution. We then have a post-manufacturing step which verifies that all source code modules start with the correct copyright notice.

That guarantees that all source files have the correct copyright statements.

paxdiablo