New util to fix headers (Copyright range).
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 11 May 2009 10:43:43 +0000 (12:43 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 11 May 2009 10:43:43 +0000 (12:43 +0200)
fixup-headers/fixup.sh [new file with mode: 0755]

diff --git a/fixup-headers/fixup.sh b/fixup-headers/fixup.sh
new file mode 100755 (executable)
index 0000000..3d9b92e
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/sh
+R="$1"
+if test -z "$R"; then
+       echo "Supply range. Eg 2006-2009"
+       exit 1
+fi
+for f in `find . \( -name '*.[ch]' -or -name Makefile.am -or -name '*.cpp' -or -name '*.hpp' \) -print`; do
+       echo $f
+       sed "s/Copyri.*20.*Data/Copyright (C) $R Index Data/g" < $f >${f}_new
+       if diff $f ${f}_new >/dev/null; then
+               :
+       else
+               cp ${f}_new ${f}
+       fi
+       rm ${f}_new
+done
+