unify-sources.sh refresh the dates according to the last modification
authorAlpar Juttner <alpar@cs.elte.hu>
Mon, 27 Apr 2009 11:24:44 +0100
changeset 509a76f55d7d397
parent 508 47b376a5a2a7
child 628 586b65073025
unify-sources.sh refresh the dates according to the last modification
scripts/unify-sources.sh
     1.1 --- a/scripts/unify-sources.sh	Tue Mar 31 16:05:54 2009 +0100
     1.2 +++ b/scripts/unify-sources.sh	Mon Apr 27 11:24:44 2009 +0100
     1.3 @@ -1,8 +1,17 @@
     1.4  #!/bin/bash
     1.5  
     1.6 -YEAR=`date +2003-%Y`
     1.7 +YEAR=`date +%Y`
     1.8  HGROOT=`hg root`
     1.9  
    1.10 +function hg_year() {
    1.11 +    if [ -n "$(hg st $1)" ]; then
    1.12 +        echo $YEAR
    1.13 +    else
    1.14 +        hg log -l 1 --template='{date|isodate}\n' $1 |
    1.15 +        cut -d '-' -f 1
    1.16 +    fi
    1.17 +}
    1.18 +
    1.19  function update_header() {
    1.20      TMP_FILE=`mktemp`
    1.21      FILE_NAME=$1
    1.22 @@ -11,7 +20,7 @@
    1.23   *
    1.24   * This file is a part of LEMON, a generic C++ optimization library.
    1.25   *
    1.26 - * Copyright (C) "$YEAR"
    1.27 + * Copyright (C) 2003-"$(hg_year $1)"
    1.28   * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    1.29   * (Egervary Research Group on Combinatorial Optimization, EGRES).
    1.30   *