Files
annotate/scripts/lib/check_version.sh
alain viari 8dab2d56b2 CDS detector added
Former-commit-id: 93fac7a70052d06c2a12bf8af59820c653edd31b
Former-commit-id: 0869fdad0f550941a0f78f1e4c57f4fcdb3f6076
2015-11-08 14:28:05 +01:00

52 lines
930 B
Bash
Executable File
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/csh -f
#
# check (gnu) software version
#
# usage: check_version.sh cmd version
#
#
set HERE = `dirname $0`
set ORG_HOME = $HERE/../..
set ORG_PORTNAME = `$ORG_HOME/config/guess_port`
set path = ($path $ORG_HOME/ports/$ORG_PORTNAME/bin)
if ($#argv != 2) then
egrep "^# *usage:" $0 | sed -e 's/^# *//1'
exit 1
endif
set name = `echo "$1" | awk '{print $1}'`
echo -n "+ checking $name"
set ok = `which $name`
if ($status != 0) then
echo ""
echo "* $name : command not found"
echo "* please consider installing $name from src/_unix_tools_"
exit 1
endif
set num = `eval "$1" | tr -d -C '[0-9].'`
echo -n " version $num"
awk -v NUM=$num -v REF=$2 -f $HERE/version.awk
if ($status != 0) then
echo ""
echo "* $name version $num (should be >= $2)"
echo "* please consider installing $name from src/_unix_tools_"
exit 2
endif
echo " (>= $2) OK"
exit 0