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
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"
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
36 echo =================================================== $FILE