* config.guess.long: updated script so it will properly find the
authorErez Zadok <ezk@cs.sunysb.edu>
Thu, 21 Nov 2002 15:49:43 +0000 (15:49 +0000)
committerErez Zadok <ezk@cs.sunysb.edu>
Thu, 21 Nov 2002 15:49:43 +0000 (15:49 +0000)
version number of the new Itanium 2 machines running "Red Hat
Linux Advanced Workstation release 2.1AW (Derry)".  The script now
will report ia64-unknown-linux-rh2.1AW.

ChangeLog
config.guess.long

index 0463e1309fde2c6c300c8fdbc585f592a2fda5de..712f6d008eded9b183541c41e0a4dea8aeb67555 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2002-11-21  Erez Zadok  <ezk@cs.sunysb.edu>
+
+       * config.guess.long: updated script so it will properly find the
+       version number of the new Itanium 2 machines running "Red Hat
+       Linux Advanced Workstation release 2.1AW (Derry)".  The script now
+       will report ia64-unknown-linux-rh2.1AW.
+
 2002-11-20  Ion Badulescu  <ionut@moisil.badula.org>
 
        * amfs_auto_bgmount(): almost complete rewrite
index a835620e014861a2e06ff67247690d9d23dc5c1b..24ace2eeb02f0634993829228b38bf3aa6c69d99 100755 (executable)
@@ -3,6 +3,22 @@
 # part of am-utils-6.x
 # Erez Zadok <ezk@cs.columbia.edu>
 #
+#set -x
+
+# find a single word that prints the version number of the release
+getver () {
+    l=`head $1`
+    set $l
+    for i in $*
+    do
+       case "$i" in
+           # look for one digit followed by a sequence of non-spaces
+           # so it'll catch 7.3 as well as 2.1AW
+           *[0-9]* ) echo $i; return ;;
+        esac
+    done
+}
+
 if test "x$GCONFIG" = "x" ; then
     # find dirname of this script
     base=`echo $0 | sed 's/\/[^\/]*$//' 2>/dev/null`
@@ -14,11 +30,11 @@ case "${GCONFIG}" in
     *linux* )
        GCONFIG=`echo ${GCONFIG} | sed -e 's/i.86/i386/' -e 's/linux-gnu/linux/'`
        if test -f /etc/redhat-release ; then
-           long=`cut -d '(' -f1 /etc/redhat-release | tr -dc '[0-9.]'`
+           long=`getver /etc/redhat-release`
            echo ${GCONFIG}-rh${long}
            exit 0
        elif test -f /etc/SuSE-release ; then
-           long=`grep VERSION /etc/SuSE-release | tr -dc '[0-9.]'`
+           long=`getver /etc/SuSE-release`
            echo ${GCONFIG}-suse${long}
            exit 0
        else