fix numeric comparisons (sort of, it now views 1.4.2 the same as 1.4.2a) require...
authorAndy Wingo <wingo@pobox.com>
Sat, 9 Feb 2002 19:25:47 +0000 (19:25 +0000)
committerAndy Wingo <wingo@pobox.com>
Sat, 9 Feb 2002 19:25:47 +0000 (19:25 +0000)
Original commit message from CVS:
* fix numeric comparisons (sort of, it now views 1.4.2 the same as 1.4.2a)
* require a fresh gstreamer (ie, glib2-only) for the player

gst-autogen.sh

index 1f4e171..8b99463 100644 (file)
@@ -47,9 +47,11 @@ version_check ()
   # the following line is carefully crafted sed magic
   pkg_version=`$PACKAGE --version|head -n 1|sed 's/^[a-zA-z\.\ ()]*//;s/ .*$//'`
   debug "pkg_version $pkg_version"
-  pkg_major=`echo $pkg_version | cut -d. -f1`
-  pkg_minor=`echo $pkg_version | cut -d. -f2`
-  pkg_micro=`echo $pkg_version | cut -d. -f3`
+  # remove any non-digit characters from the version numbers to permit numeric
+  # comparison
+  pkg_major=`echo $pkg_version | cut -d. -f1 | tr -d -c [:digit:]`
+  pkg_minor=`echo $pkg_version | cut -d. -f2 | tr -d -c [:digit:]`
+  pkg_micro=`echo $pkg_version | cut -d. -f3 | tr -d -c [:digit:]`
   test -z "$pkg_minor" && pkg_minor=0
   test -z "$pkg_micro" && pkg_micro=0