| 1 | 1 |
#!/bin/bash |
| 2 | 2 |
|
| 3 |
YEAR=`date + |
|
| 3 |
YEAR=`date +%Y` |
|
| 4 | 4 |
HGROOT=`hg root` |
| 5 | 5 |
|
| 6 |
function hg_year() {
|
|
| 7 |
if [ -n "$(hg st $1)" ]; then |
|
| 8 |
echo $YEAR |
|
| 9 |
else |
|
| 10 |
hg log -l 1 --template='{date|isodate}\n' $1 |
|
|
| 11 |
cut -d '-' -f 1 |
|
| 12 |
fi |
|
| 13 |
} |
|
| 14 |
|
|
| 6 | 15 |
function update_header() {
|
| 7 | 16 |
TMP_FILE=`mktemp` |
| 8 | 17 |
FILE_NAME=$1 |
| 9 | 18 |
|
| 10 | 19 |
(echo "/* -*- mode: C++; indent-tabs-mode: nil; -*- |
| 11 | 20 |
* |
| 12 | 21 |
* This file is a part of LEMON, a generic C++ optimization library. |
| 13 | 22 |
* |
| 14 |
* Copyright (C) "$ |
|
| 23 |
* Copyright (C) 2003-"$(hg_year $1)" |
|
| 15 | 24 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 16 | 25 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 17 | 26 |
* |
| 18 | 27 |
* Permission to use, modify and distribute this software is granted |
| 19 | 28 |
* provided that this copyright notice appears in all copies. For |
| 20 | 29 |
* precise terms see the accompanying LICENSE file. |
| 21 | 30 |
* |
| 22 | 31 |
* This software is provided \"AS IS\" with no warranty of any kind, |
| 23 | 32 |
* express or implied, and with no claim as to its suitability for any |
| 24 | 33 |
* purpose. |
| 25 | 34 |
* |
| 26 | 35 |
*/ |
| 27 | 36 |
" |
| 28 | 37 |
awk 'BEGIN { pm=0; }
|
| 29 | 38 |
pm==3 { print }
|
| 30 | 39 |
/\/\* / && pm==0 { pm=1;}
|
| 31 | 40 |
/[^:blank:]/ && (pm==0 || pm==2) { pm=3; print;}
|
| 32 | 41 |
/\*\// && pm==1 { pm=2;}
|
| 33 | 42 |
' $1 |
| 34 | 43 |
) >$TMP_FILE |
| 35 | 44 |
|
| 36 | 45 |
HEADER_CH=`diff -q $TMP_FILE $FILE_NAME >/dev/null&&echo NO||echo YES` |
| 37 | 46 |
|
| 38 | 47 |
rm $FILE_NAME |
0 comments (0 inline)