OSSP CVS Repository

ossp - Check-in [3649]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 3649
Date: 2003-Oct-26 11:12:18 (local)
2003-Oct-26 10:12:18 (UTC)
User:rse
Branch:
Comment: - Recognize AMD64 architecture under Linux - correctly recognize SuSE version through "VERSION = xxx" in /etc/SuSE-config - add Apple MacOS X Darwin detection support - provide more robust detection for unknown platforms
Tickets:
Inspections:
Files:
ossp-pkg/platform/platform.sh      1.12 -> 1.13     28 inserted, 3 deleted

ossp-pkg/platform/platform.sh 1.12 -> 1.13

--- platform.sh  2003/09/29 12:53:15     1.12
+++ platform.sh  2003/10/26 10:12:18     1.13
@@ -383,6 +383,9 @@
     *:Linux:* )
         #   determine architecture
         AT="${UNAME_MACHINE}"
+        case "${AT}" in
+           x86_64 ) AT='AMD64' ;;
+        esac
         AP="${AT}"
         case "${AP}" in
            i[3-6]86 ) AP='iX86' ;;
@@ -409,7 +412,7 @@
                 [ ".${tagfile}" = .x ] && continue
                 [ ! -f "/etc/${tagfile}" ] && continue
                 n=`echo ${tagfile} | sed -e 's/[_-]release$//' -e 's/[_-]version$//'`
-                v=`cat /etc/${tagfile} | grep '[0-9]' | head -1 |\
+                v=`(grep VERSION /etc/${tagfile}; cat /etc/${tagfile}) | grep '[0-9]' | head -1 |\
                    sed -e 's/^/#/' \
                        -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \
                        -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \
@@ -581,6 +584,22 @@
         esac
         ;;
 
+    #   Apple MacOS X Darwin
+    *:Darwin:* )
+        AT=`uname -p`
+        case "${AT}" in
+            powerpc ) AT="PPC" ;;
+        esac
+        AP="${AT}"
+        AC="${AP}"
+        case "${AC}" in
+            i?86 ) AC="iX86" ;;
+        esac
+        ST="[Apple ]${UNAME_SYSTEM} ${UNAME_RELEASE}"
+        SP="${ST}"
+        SC="4.4BSD${opt_C}Mach3"
+        ;;
+
     #   TODO ...ADD YOUR NEW PLATFORM CHECK HERE... TODO
     # *:XXX:* )
     #   ...
@@ -588,10 +607,16 @@
 
     #   ...A STILL UNKNOWN PLATFORM...
     * )
-        AT="${UNAME_MACHINE}"
+        AT=`echo "${UNAME_MACHINE}" | sed -e "s; ;${opt_C};g"`
         AP="${AT}"
         AC="${AP}"
-        ST="${UNAME_SYSTEM} ${UNAME_RELEASE}"
+        v=`echo "${UNAME_RELEASE}" |\
+           sed -e 's/^/#/' \
+               -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \
+               -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \
+               -e 's/^#[^0-9]*\([0-9][0-9]*\).*$/\1/' \
+               -e 's/^#.*$/?/'`
+        ST="${UNAME_SYSTEM} ${v}"
         SP="${ST}"
         SC="${SP}"
         ;;

CVSTrac 2.0.1