OSSP CVS Repository

ossp - Difference in ossp-pkg/shtool/sh.platform versions 1.18 and 1.19
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/shtool/sh.platform 1.18 -> 1.19

--- sh.platform  2007/05/19 19:09:39     1.18
+++ sh.platform  2007/06/04 07:58:50     1.19
@@ -398,6 +398,7 @@
 
     #   IBM AIX
     *:AIX:* )
+        #   determine architecture
         cpu_arch=rs6000
         if [ -x /usr/sbin/lsdev -a -x /usr/sbin/lsattr ]; then
             cpu_id=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
@@ -419,6 +420,7 @@
         AT="${cpu_arch}"
         AP="${AT}"
         AC="${AP}"
+        #   determine system
         ST="[IBM ]<AIX >${os_level}"
         SP="${ST}"
         case "${os_level}" in
@@ -427,9 +429,10 @@
         esac
         ;;
 
-    #   Apple MacOS X Darwin
+    #   Apple Mac OS X (Darwin)
     *:Darwin:* )
-        AT=`uname -p`
+        #   determine architecture
+        AT="`uname -p`"
         case "${AT}" in
             powerpc ) AT="PPC" ;;
         esac
@@ -438,9 +441,31 @@
         case "${AC}" in
             i?86 ) AC="iX86" ;;
         esac
-        ST="[Apple ]${UNAME_SYSTEM} ${UNAME_RELEASE}"
-        SP="${ST}"
-        SC="4.4BSD/Mach3"
+        #   determine system
+        eval `echo "${UNAME_RELEASE}" |\
+              sed -e 's/^/#/' \
+                  -e 's/^#\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/v1="\1"; v2="\2"; v3="\3"/' \
+                  -e 's/^#\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/v1="\1"; v2="\2"/' \
+                  -e 's/^#\([0-9][0-9]*\).*$/v1="\1"/' \
+                  -e 's/^#.*$/v1="0"/'`
+        ST="[Apple ]${UNAME_SYSTEM} <${v1}>${v2+.$v2}${v3+[.$v3]}"
+        SP="$ST"
+        v="`(sw_vers) 2>/dev/null | grep 'ProductVersion:' | sed -e 's/^ProductVersion: *//'`"
+        if [ ".$v" != . ]; then
+            #   use given Mac OS X product information
+            SP="[Apple ]Mac OS X ${v}"
+        else
+            #   fetch Mac OS X product information manually
+            for name in System Server; do
+                if [ -f /System/Library/CoreServices/${name}Version.plist ]; then
+                    v=`(defaults read "/System/Library/CoreServices/${name}Version" "ProductVersion") 2>/dev/null`
+                    if [ ".$v" != . ]; then
+                        SP="[Apple ]Mac OS X ${v}"
+                    fi
+                fi
+            done
+        fi
+        SC="4.4BSD/Mach3.0"
         ;;
 
     #   TODO ...ADD YOUR NEW PLATFORM CHECK HERE... TODO

CVSTrac 2.0.1