Commit e874984f authored by Øyvind Kolås's avatar Øyvind Kolås

added improved check_version() function that handles multiple digits in major/minor/micro

parent c1ffbf93
2005-03-02 Øyvind Kolås <pippin@gimp.org>
* autogen.sh: added improved check_version() function that handles
multiple digits in major/minor/micro.
2006-03-02 Sven Neumann <sven@gimp.org>
* autogen.sh: removed version check for glib-gettextize. It didn't
......
......@@ -31,13 +31,41 @@ test -z "$srcdir" && srcdir=.
ORIGDIR=`pwd`
cd $srcdir
check_version ()
{
if expr "$1" \>= "$2" > /dev/null; then
echo "yes (version $1)"
VERSION_A=$1
VERSION_B=$2
save_ifs="$IFS"
IFS=.
set dummy $VERSION_A 0 0 0
MAJOR_A=$2
MINOR_A=$3
MICRO_A=$4
set dummy $VERSION_B 0 0 0
MAJOR_B=$2
MINOR_B=$3
MICRO_B=$4
IFS="$save_ifs"
if expr "$MAJOR_A" = "$MAJOR_B" > /dev/null; then
if expr "$MINOR_A" \> "$MINOR_B" > /dev/null; then
echo "yes (version $VERSION_A)"
elif expr "$MINOR_A" = "$MINOR_B" > /dev/null; then
if expr "$MICRO_A" \>= "$MICRO_B" > /dev/null; then
echo "yes (version $VERSION_A)"
else
echo "Too old (version $VERSION_A)"
DIE=1
fi
else
echo "Too old (version $VERSION_A)"
DIE=1
fi
elif expr "$MAJOR_A" \> "$MAJOR_B" > /dev/null; then
echo "Major version might be too new ($VERSION_A)"
else
echo "Too old (found version [$1] expected [$2])"
echo "Too old (version $VERSION_A)"
DIE=1
fi
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment