1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
|
#!/bin/sh
#
# update the version numbers in the win32 projects
echo this script is broken, needs updating
exit
tmp=tmp.$$
# bzflag top-level dir
for root in . .. ../.. ; do
if [ -r $root/configure.in ] ; then
break
fi
done
# get version number from config file
BZVERSION=`grep ^AM_INIT_AUTOMAKE configure.in | sed -e 's/.* //g' -e 's/)//g'`
eval `grep "^VERSIONNUM *= *" $root/configure.in | sed -e 's/ *//g'`
# config.h files
for file in \
$root/win32/config.h \
$root/src/platform/MacBZFlag-prefix.h \
$root/src/platform/MacOSX/MacBZFlag-prefix.h \
; do
if [ ! -w $file ]; then
echo "$file not found or not writable."
else
sed -e "s/#define VERSION \".*/#define VERSION \"$BZVERSION\"/g" \
-e "s/#define BZVERSION [0-9]*/#define BZVERSION $VERSIONNUM/g"< $file > $tmp
cat $tmp > $file
fi
done
# dsp and vcproj
# vcproj's are gone?
for file in \
$root/win32/*.dsp \
$root/src/platform/MacBZFlag-prefix.h \
$root/src/platform/MacOSX/MacBZFlag-prefix.h \
; do
if [ ! -w $file ]; then
echo "$file not found or not writable."
else
sed -e "s/VERSION=[0-9]*/VERSION=$VERSIONNUM/g" \
-e "s/VERSIONNUM=[0-9]*/VERSIONNUM=$BZVERSION/g"< $file > $tmp
cat $tmp > $file
fi
done
# update installer filename
file=$root/win32/installer.dsp
if [ ! -w $file ]; then
echo "$file not found or not writable."
else
sed -e "s/BZFlag[0-9][^\"]*\"/BZFlag$BZVERSION.exe\"/g" < $file > $tmp
cat $tmp > $file
fi
# update rpm spec file
file=$root/package/rpm/spec
if [ ! -w $file ]; then
echo "$file not found or not writable."
else
sed -e "s/^%define version .*$/%define version $BZVERSION/g" < $file > $tmp
cat $tmp > $file
fi
# update README
file=$root/README
if [ ! -w $file ]; then
echo "$file not found or not writable."
else
sed -e "s/BZFlag [0-9]*\.[0-9]*[a-z]*[0-9]*$/BZFlag $BZVERSION/g" < $file > $tmp
cat $tmp > $file
fi
# update lsm
# FIXME something should add filesizes
file=$root/bzflag.lsm
if [ ! -w $file ]; then
echo "$file not found or not writable."
else
sed -e "s/^Version:.*$/Version: $BZVERSION/g" < $file > $tmp
cat $tmp > $file
fi
rm $tmp
# Local Variables: ***
# mode:sh ***
# tab-width: 8 ***
# sh-indentation: 2 ***
# sh-basic-offset: 2 ***
# indent-tabs-mode: t ***
# End: ***
# ex: shiftwidth=2 tabstop=8
|