svn commit: r17748 - trunk/tools/bin/add-epl-header.sh

Linus Tolke <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: linus
Date: 2010-01-10 13:21:56-0800
New Revision: 17748

Added:
   trunk/tools/bin/add-epl-header.sh   (contents, props changed)

Log:
Script to add EPL license to the old BSD files.

Added: trunk/tools/bin/add-epl-header.sh
Url: http://argouml.tigris.org/source/browse/argouml/trunk/tools/bin/add-epl-header.sh?view=markup&pathrev=17748
==============================================================================
--- (empty file)
+++ trunk/tools/bin/add-epl-header.sh	2010-01-10 13:21:56-0800
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+# Descend into directories.
+for dir in `find . -type d -print | grep -v /.svn`
+do
+  (
+    cd $dir
+    for file in *.java
+    do
+      if head -1 $file | grep '^//'
+      then
+        author=`svn info $file | egrep '^Last Changed Author:' | sed 's/^.*: //'`
+	ed $file <<EOF
+1d
+1i
+/* \$Id\$
+ *******************************************************************************
+ * Copyright (c) 2009 Contributors - see below
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    $author
+ *******************************************************************************
+ *
+ * Some portions of this file was previously release using the BSD License:
+ */
+
+.
+w
+q
+EOF
+	svn diff -x -w $file
+	echo -n "Replace? N/Y/Q "
+	read ans
+	case "$ans" in
+	Y)
+	  ;;
+	Q)
+	  svn revert $file
+	  exit 0;
+	  ;;
+	*)
+	  svn revert $file
+	  ;;
+	esac
+      fi
+    done
+    svn ci -N -m'Added EPL License header.'
+  )
+done

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2436130

To unsubscribe from this discussion, e-mail: [[email protected]].
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.