Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 51 lines (38 sloc) 2.271 kb
#! /bin/sh
# Time-stamp: <2007-12-15 09:37:18 feeley>
# Utility to change the version of Gambit attached to a source file.
#
# Usage: changev 40062 40063 file1 file2
OLDVERSION=$1
NEWVERSION=$2
TEMPFILE=/tmp/changev.$$
OLDMAJORVERSION=`eval expr $OLDVERSION / 100000`
OLDMINORVERSION=`eval expr $OLDVERSION % 100000 / 1000`
OLDREVISIONVERSION=`eval expr $OLDVERSION % 1000`
OLDVERSIONSTRING="v$OLDMAJORVERSION"."$OLDMINORVERSION"."$OLDREVISIONVERSION"
OLDDISTSTRING="v$OLDMAJORVERSION"_"$OLDMINORVERSION"_"$OLDREVISIONVERSION"
NEWMAJORVERSION=`eval expr $NEWVERSION / 100000`
NEWMINORVERSION=`eval expr $NEWVERSION % 100000 / 1000`
NEWREVISIONVERSION=`eval expr $NEWVERSION % 1000`
NEWVERSIONSTRING="v$NEWMAJORVERSION"."$NEWMINORVERSION"."$NEWREVISIONVERSION"
NEWDISTSTRING="v$NEWMAJORVERSION"_"$NEWMINORVERSION"_"$NEWREVISIONVERSION"
while [ -n "$3" ]
do
FILE=$3
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
diff -q $FILE $TEMPFILE > /dev/null
if [ $? -eq 1 ]
then
echo =================================================== $FILE
diff $FILE $TEMPFILE
if [ -x $FILE ]
then
chmod +x $TEMPFILE
fi
mv $TEMPFILE $FILE
#rm -f $TEMPFILE
else
rm -f $TEMPFILE
fi
shift
done
Jump to Line
Something went wrong with that request. Please try again.