COIN-OR::LEMON - Graph Library

source: lemon-1.1/scripts/update-copyright-header.sh @ 85:3453d20a82cd

Last change on this file since 85:3453d20a82cd was 38:a0cd9917c5a2, checked in by Alpar Juttner <alpar@…>, 17 years ago

Script for updating the copyright headers

  • Property exe set to *
File size: 1.2 KB
Line 
1#!/bin/bash
2
3YEAR=`date +2003-%Y`
4HGROOT=`hg root`
5
6function update_file() {
7    TMP_FILE=`mktemp`
8    FILE_NAME=$1
9
10    (echo "/* -*- C++ -*-
11 *
12 * This file is a part of LEMON, a generic C++ optimization library
13 *
14 * Copyright (C) "$YEAR"
15 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
16 * (Egervary Research Group on Combinatorial Optimization, EGRES).
17 *
18 * Permission to use, modify and distribute this software is granted
19 * provided that this copyright notice appears in all copies. For
20 * precise terms see the accompanying LICENSE file.
21 *
22 * This software is provided \"AS IS\" with no warranty of any kind,
23 * express or implied, and with no claim as to its suitability for any
24 * purpose.
25 *
26 */
27"
28        awk 'BEGIN { pm=0; }
29     pm==3 { print }
30     /\/\* / && pm==0 { pm=1;}
31     /[^:blank:]/ && (pm==0 || pm==2) { pm=3; print;}
32     /\*\// && pm==1 { pm=2;}
33    ' $1
34        ) >$TMP_FILE
35    rm $FILE_NAME
36    mv $TMP_FILE $FILE_NAME
37}
38
39
40if [ $# == 0 ]; then
41    echo -n Update all source files...
42    for i in `hg manifest|grep -E  '\.(cc|h|dox)$'`
43    do
44        update_file $HGROOT/$i
45    done
46    echo ' done.'
47else
48    for i in $*
49    do
50        update_file $i
51    done
52fi
Note: See TracBrowser for help on using the repository browser.