aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2011-03-03 15:19:55 +0100
committerLukas Fleischer <calcurse@cryptocrack.de>2011-03-03 15:19:55 +0100
commit012e446194ddee1bc2762907aa40962d19630748 (patch)
tree6012b308db9b6bfaf96d25e0874e699151800bb6
parentea44597a5a1bdf2c7b855ed84f1ac5e48edb8d5b (diff)
downloadcalcurse-012e446194ddee1bc2762907aa40962d19630748.tar.gz
calcurse-012e446194ddee1bc2762907aa40962d19630748.zip
Quick fix for "autogen.sh" version comparison breakage.
The autogen script failed to compare program versions properly printing error messages like "./autogen.sh: line 107: [: too many arguments" to stderr. This commit adds a hacky fix. To fix this properly, check_program_version() should be rewritten from scratch. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
-rwxr-xr-xautogen.sh7
1 files changed, 3 insertions, 4 deletions
diff --git a/autogen.sh b/autogen.sh
index 3ab46a4..2e86945 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -97,14 +97,13 @@ check_program_version()
{
PROGRAM=$1; MAJOR=$2; MINOR=$3
printf "Checking that $PROGRAM version is at least $MAJOR.$MINOR ... "
- VERSION=`$PROGRAM --version |head -n 1|sed 's/([^)]*)//g;s/^[a-zA-Z\.\ \
- \-]*//;s/ .*$//'`
+ VERSION=`$PROGRAM --version | head -n 1 | rev | cut -d' ' -f1 | rev`
MAJOR_FOUND=`echo $VERSION | cut -d. -f1`
- MINOR_FOUND=`echo $VERSION | sed s/[-,a-z,A-Z].*// | cut -d. -f2`
+ MINOR_FOUND=`echo $VERSION | sed 's/[a-zA-Z-].*//' | cut -d. -f2`
[ -z "$MINOR_FOUND" ] && MINOR_FOUND=0
WRONG=
- if [ -z "$MAJOR_FOUND" -lt "$MAJOR" ]; then
+ if [ "$MAJOR_FOUND" -lt "$MAJOR" ]; then
WRONG=1
elif [ "$MAJOR_FOUND" -eq "$MAJOR" ]; then
if [ "$MINOR_FOUND" -lt "$MINOR" ]; then