From 5845b632c99d8f0ab863bd955a9568d7937108f8 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Fri, 26 Jun 2009 13:16:05 +0100 Subject: [PATCH] gst-autogen.sh: Substitute punctuation in variable names. Use printf Replace the punctuation (-,.) in variable names with underscores, so that checks for binaries with names like 'automake-1.10' can succeed. Use printf instead of 'echo -n' as it's apparently more portable. --- gst-autogen.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gst-autogen.sh b/gst-autogen.sh index a155c1b..f05e021 100644 --- a/gst-autogen.sh +++ b/gst-autogen.sh @@ -28,7 +28,7 @@ version_get () # arg 2: (uppercased) variable name prefix { COMMAND=$1 - VARPREFIX=$2 + VARPREFIX=`echo $2 | tr .,- _` # strip everything that's not a digit, then use cut to get the first field pkg_version=`$COMMAND --version|head -n 1|sed 's/^.*)[^0-9]*//'|cut -d' ' -f1` @@ -56,7 +56,7 @@ version_compare () # arg3: MINOR # arg4: MICRO { - VARPREFIX=$1 + VARPREFIX=`echo $1 | tr .,- _` MAJOR=$2 MINOR=$3 MICRO=$4 @@ -126,7 +126,7 @@ version_check () # don't check if asked not to test -z "$NOCHECK" && { - echo -n " checking for $COMMAND >= $VERSION ... " + printf " checking for $COMMAND >= $VERSION ... " } || { # we set a var with the same name as the package, but stripped of # unwanted chars -- 2.7.4