# HG changeset patch
# User Alpar Juttner <alpar@cs.elte.hu>
# Date 1199711575 -3600
# Node ID a0cd9917c5a244df0827a13fdc261c7235e21f7c
# Parent  582c594ecd01aada452f306284849278ce908010
Script for updating the copyright headers

diff -r 582c594ecd01 -r a0cd9917c5a2 scripts/update-copyright-header.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/update-copyright-header.sh	Mon Jan 07 14:12:55 2008 +0100
@@ -0,0 +1,52 @@
+#!/bin/bash
+
+YEAR=`date +2003-%Y`
+HGROOT=`hg root`
+
+function update_file() {
+    TMP_FILE=`mktemp`
+    FILE_NAME=$1
+
+    (echo "/* -*- C++ -*-
+ *
+ * This file is a part of LEMON, a generic C++ optimization library
+ *
+ * Copyright (C) "$YEAR"
+ * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
+ * (Egervary Research Group on Combinatorial Optimization, EGRES).
+ *
+ * Permission to use, modify and distribute this software is granted
+ * provided that this copyright notice appears in all copies. For
+ * precise terms see the accompanying LICENSE file.
+ *
+ * This software is provided \"AS IS\" with no warranty of any kind,
+ * express or implied, and with no claim as to its suitability for any
+ * purpose.
+ *
+ */
+"
+	awk 'BEGIN { pm=0; }
+     pm==3 { print }
+     /\/\* / && pm==0 { pm=1;}
+     /[^:blank:]/ && (pm==0 || pm==2) { pm=3; print;}
+     /\*\// && pm==1 { pm=2;}
+    ' $1
+	) >$TMP_FILE
+    rm $FILE_NAME
+    mv $TMP_FILE $FILE_NAME
+}
+
+
+if [ $# == 0 ]; then
+    echo -n Update all source files...
+    for i in `hg manifest|grep -E  '\.(cc|h|dox)$'`
+    do
+	update_file $HGROOT/$i
+    done
+    echo ' done.'
+else
+    for i in $*
+    do
+	update_file $i
+    done
+fi