Commit 5994f35b authored by Sean McGovern's avatar Sean McGovern Committed by Rafaël Carré

tools: compare micro version

Some tools differ significantly between micro revisions.
Signed-off-by: default avatarRafaël Carré <funman@videolan.org>
parent 1f0542a7
...@@ -51,13 +51,18 @@ then ...@@ -51,13 +51,18 @@ then
else else
# found, need to check version ? # found, need to check version ?
[ -z "$2" ] && return # no [ -z "$2" ] && return # no
# we only check GNU tools, their version have the form MAJOR.MINOR
gotver=`$1 --version | head -1 | sed s/'.* '//` gotver=`$1 --version | head -1 | sed s/'.* '//`
gotmajor=`echo $gotver|cut -d. -f1` gotmajor=`echo $gotver|cut -d. -f1`
gotminor=`echo $gotver|cut -d. -f2` gotminor=`echo $gotver|cut -d. -f2`
gotmicro=`echo $gotver|cut -d. -f3`
[ -z "$gotmicro" ] && gotmicro=0
needmajor=`echo $2|cut -d. -f1` needmajor=`echo $2|cut -d. -f1`
needminor=`echo $2|cut -d. -f2` needminor=`echo $2|cut -d. -f2`
if [ "$needmajor" -gt "$gotmajor" -o "$needmajor" -eq "$gotmajor" -a "$needminor" -gt "$gotminor" ] needmicro=`echo $2|cut -d. -f3`
[ -z "$needmicro" ] && needmicro=0
if [ "$needmajor" -gt "$gotmajor" \
-o "$needmajor" -eq "$gotmajor" -a "$needminor" -gt "$gotminor" \
-o "$needmajor" -eq "$gotmajor" -a "$needminor" -eq "$gotminor" -a "$needmicro" -gt "$gotmicro" ]
then then
echo "$1 too old" echo "$1 too old"
NEEDED="$NEEDED .$1" NEEDED="$NEEDED .$1"
......
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