[aravis] tools: add script for copyright notice update.



commit cf33c3d1328ba4cc63f26d66fc4c3708fb660c47
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Thu Jan 9 10:28:51 2014 +0100

    tools: add script for copyright notice update.

 tools/fsf-patch.sh |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)
---
diff --git a/tools/fsf-patch.sh b/tools/fsf-patch.sh
new file mode 100644
index 0000000..8c02509
--- /dev/null
+++ b/tools/fsf-patch.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+# dumb script to replace multiline "... write to the Free Software Foundation, 
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA." 
+# with "see http://www.gnu.org/licenses/>"
+# 
+# becareful, regex pattern might match too many lines
+# 
+# written by Andika Triwidada <andika gmail com>
+# public domain
+#
+# $Id: fsf-patch.sh,v 1.2 2014/01/08 19:11:38 andika Exp andika $
+#
+TMPDIR=fsf-tmp
+for f in `grep -rH "59 Temple" *|awk -F ':' '{print $1}'|grep -v COPYING|grep -v \.patch$`
+do 
+    echo $f
+    mkdir -p $TMPDIR/`dirname $f`
+    sed -n '1h;1!H;${;g;s/write to the.*USA\./see <http:\/\/www.gnu.org\/licenses\/>\./g;p;}' \
+       $f > $TMPDIR/$f
+done
+
+# done modify files, now relocate them from TMPDIR to proper places
+# should be unnecessary if we know how to use sed in-place instead
+pushd .
+cd $TMPDIR
+tar cf - * | (cd ..; tar xf -)
+popd
+
+# cleanup
+rm -rf $TMPDIR
+
+# post processing:
+# check result with 'git diff'
+# throw all changes with 'git stash; git stash clear'


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]