This script creates/updates the copyright header of a source file
authoralpar
Thu, 10 Aug 2006 10:11:07 +0000
changeset 2171f40343b498ef
parent 2170 42fffa713424
child 2172 4b25e7003868
This script creates/updates the copyright header of a source file
scripts/update-copyright-header
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/scripts/update-copyright-header	Thu Aug 10 10:11:07 2006 +0000
     1.3 @@ -0,0 +1,33 @@
     1.4 +#!/bin/bash
     1.5 +
     1.6 +FILE_NAME=$1
     1.7 +TMP_FILE=`mktemp`
     1.8 +YEAR='2003-2006'
     1.9 +
    1.10 +(echo "/* -*- C++ -*-
    1.11 + *
    1.12 + * This file is a part of LEMON, a generic C++ optimization library
    1.13 + *
    1.14 + * Copyright (C) "$YEAR"
    1.15 + * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    1.16 + * (Egervary Research Group on Combinatorial Optimization, EGRES).
    1.17 + *
    1.18 + * Permission to use, modify and distribute this software is granted
    1.19 + * provided that this copyright notice appears in all copies. For
    1.20 + * precise terms see the accompanying LICENSE file.
    1.21 + *
    1.22 + * This software is provided \"AS IS\" with no warranty of any kind,
    1.23 + * express or implied, and with no claim as to its suitability for any
    1.24 + * purpose.
    1.25 + *
    1.26 + */
    1.27 +"
    1.28 +awk 'BEGIN { pm=0; }
    1.29 +     pm==3 { print }
    1.30 +     /\/\* / && pm==0 { pm=1;}
    1.31 +     /[^:blank:]/ && (pm==0 || pm==2) { pm=3; print;}
    1.32 +     /\*\// && pm==1 { pm=2;}
    1.33 +    ' $1
    1.34 +) >$TMP_FILE
    1.35 +rm $FILE_NAME
    1.36 +mv $TMP_FILE $FILE_NAME