1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-05-13 22:06:58 +02:00

Add vcmibuilder version check for innoextract (#408)

* add vcmibuilder check for the old innoextract is unable to unpack the current GOG package
* fix for vcmibuilder to fail if innoextract version is less than required
This commit is contained in:
Paul 2018-01-28 08:00:03 +03:00 committed by ArseniyShestakov
parent 69dbf339fc
commit d1bef9da13

View File

@ -62,13 +62,19 @@ then
exit 0
fi
# test if a program version ($1) is less than the required one ($2)
verlt() {
[ "$1" = "$2" ] && return 1 || \
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]
}
# test presence of program $1, $2 will be passed as parameters to test presence
test_utility ()
{
$1 $2 > /dev/null 2>&1 || { echo "$1 was not found. Please install it" 1>&2 ; exit 1; }
}
#print error message and exit
# print error message and exit
fail ()
{
$2
@ -106,6 +112,16 @@ then
fi
fi
if [[ -n "$gog_file" ]]
then
currentver="$(innoextract --version | head -n1 | cut -d ' ' -f2)"
requiredver="1.6"
if verlt $currentver $requiredver;
then
fail "innoextract version is $currentver, update it to version $requiredver or higher"
fi
fi
if [[ -n "$useffmpeg" ]]
then
ffmpeg -version > /dev/null 2>&1 && AUDIO_CONV=ffmpeg