2011-12-04 20:48:07 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# Changes the version number
|
|
|
|
# !!!THIS SCRIPT IS FOR INTERNAL DEVELOPER USE ONLY!!!
|
|
|
|
|
|
|
|
type -P sed &>/dev/null || { echo "sed command not found. Aborting." >&2; exit 1; }
|
|
|
|
|
|
|
|
if [ ! -n "$1" ]; then
|
2015-02-08 22:36:57 +00:00
|
|
|
echo "you must provide a version number (eg. 2.1)"
|
2011-12-04 20:48:07 +00:00
|
|
|
exit 1
|
|
|
|
else
|
2015-02-08 22:36:57 +00:00
|
|
|
MAJOR=`echo $1 | sed "s/\(.*\)[.].*/\1/"`
|
|
|
|
MINOR=`echo $1 | sed "s/.*[.]\(.*\)/\1/"`
|
2011-12-04 20:48:07 +00:00
|
|
|
fi
|
|
|
|
case $MAJOR in *[!0-9]*)
|
|
|
|
echo "$MAJOR is not a number"
|
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
case $MINOR in *[!0-9]*)
|
|
|
|
echo "$MINOR is not a number"
|
|
|
|
exit 1
|
|
|
|
esac
|
2015-02-08 22:36:57 +00:00
|
|
|
echo "changing version to $MAJOR.$MINOR"
|
|
|
|
sed -i -e "s/^AC_INIT(\[\([^ ]*\)\], \[[^ ]*\]\(.*\)/AC_INIT([\1], [$MAJOR.$MINOR]\2/" configure.ac
|
2011-12-04 20:48:07 +00:00
|
|
|
cat > cmd.sed <<\_EOF
|
2017-04-20 11:58:04 +00:00
|
|
|
s/^\([ \t]*\)\(FILE\|PRODUCT\)VERSION\([ \t]*\)[0-9]*,[0-9]*\(.*\)/\1\2VERSION\3@@MAJOR@@,@@MINOR@@\4/
|
|
|
|
s/^\([ \t]*\)VALUE\([ \t]*\)"\(File\|Product\)Version",\([ \t]*\)"[0-9]*\.[0-9]*\.\(.*\)/\1VALUE\2"\3Version",\4"@@MAJOR@@.@@MINOR@@.\5/
|
2018-07-11 17:02:03 +00:00
|
|
|
s/^\([ \t]*\)VALUE\([ \t]*\)"OriginalFilename",\([ \t]*\)"rufus-[0-9]*\.[0-9]*\.exe\(.*\)/\1VALUE\2"OriginalFilename",\3"rufus-@@MAJOR@@.@@MINOR@@.exe\4/
|
2017-04-20 11:58:04 +00:00
|
|
|
s/^\(.*\)"Rufus [0-9]*\.[0-9]*\.\(.*\)"\(.*\)/\1"Rufus @@MAJOR@@.@@MINOR@@.\2"\3/
|
|
|
|
s/^\([ \t]*\)Version="[0-9]*\.[0-9]*\.\(.*\)"\(.*\)/\1Version="@@MAJOR@@.@@MINOR@@.\2"\3/
|
|
|
|
s/^set VERSION=[0-9]*\.[0-9]*/set VERSION=@@MAJOR@@.@@MINOR@@/
|
2011-12-04 20:48:07 +00:00
|
|
|
_EOF
|
|
|
|
|
|
|
|
# First run sed to substitute our variable in the sed command file
|
2015-02-08 22:36:57 +00:00
|
|
|
sed -i -e "s/@@MAJOR@@/$MAJOR/g" -e "s/@@MINOR@@/$MINOR/g" cmd.sed
|
2017-04-20 11:58:04 +00:00
|
|
|
sed -b -i -f cmd.sed src/rufus.rc
|
2011-12-04 20:48:07 +00:00
|
|
|
rm cmd.sed
|
2015-01-01 23:47:15 +00:00
|
|
|
source ./bootstrap.sh
|