Improve Gambit REPL (toolbar is semi transparent and the alpha can be set with set...
[gambit-c.git] / misc / changev1
blob1865bd870c0ecb1984d5cbe930c6ffa422a81b1d
1 #! /bin/sh
3 # Time-stamp: <2007-12-15 09:37:18 feeley>
5 # Utility to change the version of Gambit attached to a source file.
7 # Usage: changev 40062 40063 file1 file2
9 OLDVERSION=$1
10 NEWVERSION=$2
11 TEMPFILE=/tmp/changev.$$
13 OLDMAJORVERSION=`eval expr $OLDVERSION / 100000`
14 OLDMINORVERSION=`eval expr $OLDVERSION % 100000 / 1000`
15 OLDREVISIONVERSION=`eval expr $OLDVERSION % 1000`
16 OLDVERSIONSTRING="v$OLDMAJORVERSION"."$OLDMINORVERSION"."$OLDREVISIONVERSION"
17 OLDDISTSTRING="v$OLDMAJORVERSION"_"$OLDMINORVERSION"_"$OLDREVISIONVERSION"
19 NEWMAJORVERSION=`eval expr $NEWVERSION / 100000`
20 NEWMINORVERSION=`eval expr $NEWVERSION % 100000 / 1000`
21 NEWREVISIONVERSION=`eval expr $NEWVERSION % 1000`
22 NEWVERSIONSTRING="v$NEWMAJORVERSION"."$NEWMINORVERSION"."$NEWREVISIONVERSION"
23 NEWDISTSTRING="v$NEWMAJORVERSION"_"$NEWMINORVERSION"_"$NEWREVISIONVERSION"
25 while [ -n "$3" ]
28 FILE=$3
30 sed -e "s/#define ___VERSION $OLDVERSION/#define ___VERSION $NEWVERSION/g" -e "s/Gambit-C $OLDVERSIONSTRING/Gambit-C $NEWVERSIONSTRING/g" -e "s/Gambit Version $OLDVERSIONSTRING/Gambit Version $NEWVERSIONSTRING/g" -e "s/Gambit-C,$OLDVERSION/Gambit-C,$NEWVERSION/g" -e "s/(define (system-version) $OLDVERSION)/(define (system-version) $NEWVERSION)/g" -e "s/PACKAGE_VERSION=\'$OLDVERSION\'/PACKAGE_VERSION=\'$NEWVERSION\'/g" -e "s/PACKAGE_STRING=\'Gambit-C $OLDVERSION\'/PACKAGE_STRING=\'Gambit-C $NEWVERSION\'/g" -e "s/Gambit-C $OLDVERSION/Gambit-C $NEWVERSION/g" -e "s/Gambit-C configure $OLDVERSION/Gambit-C configure $NEWVERSION/g" -e "s/Gambit-C \$as_me $OLDVERSION/Gambit-C \$as_me $NEWVERSION/g" -e "s/Gambit-C config.status $OLDVERSION/Gambit-C config.status $NEWVERSION/g" -e "s/___VERSION != $OLDVERSION/___VERSION != $NEWVERSION/g" -e "s/gambit-not$OLDVERSION.h/gambit-not$NEWVERSION.h/g" -e "s/AC_INIT(Gambit-C,$OLDVERSIONSTRING,gambit@iro.umontreal.ca,gambc-$OLDDISTSTRING)/AC_INIT(Gambit-C,$NEWVERSIONSTRING,gambit@iro.umontreal.ca,gambc-$NEWDISTSTRING)/g" $FILE > $TEMPFILE
32 diff -q $FILE $TEMPFILE > /dev/null
34 if [ $? -eq 1 ]
35 then
36 echo =================================================== $FILE
37 diff $FILE $TEMPFILE
38 if [ -x $FILE ]
39 then
40 chmod +x $TEMPFILE
42 mv $TEMPFILE $FILE
43 #rm -f $TEMPFILE
44 else
45 rm -f $TEMPFILE
48 shift
50 done