Merging in v11.21
[AROS.git] / workbench / classes / zune / betterstring / tools / bumprev.sh
blob72cbb97096172efe99da10dc1ce66a3c5bfa2256
1 #!/bin/bash
3 # a simple shell script which allows to bump the LIB_REVISION and LIB_DATE information
4 # found in a specified source code file
7 if [ "$1" = "all" ]; then
8 find . -maxdepth 3 -name "version.h" -exec $0 {} \;
9 else
10 if [ -e $1 ]; then
11 foundrev=`grep "#define LIB_REVISION " $1`
12 if [ $? -eq 0 ]; then
13 founddate=`grep "#define LIB_DATE " $1`
14 if [ $? -eq 0 ]; then
15 newrev=`echo $foundrev | awk '{ print $1" "$2" "$3+1 }'`
16 curdate=`date +%d.%m.%Y`
17 newdate=`echo "#define LIB_DATE \"${curdate}\""`
18 sed -i "s/${foundrev}/${newrev}/g" $1
19 sed -i "s/${founddate}/${newdate}/g" $1
20 echo "bumped $1"