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
2009-05-07 10:41:45
I hope that everybody reading this, correctly escapes the notes...
tuergeist
2009-05-07 10:46:21
+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
2009-05-07 11:12:04