[117079] trunk/base/src/macports1.0/macports.tcl

jmr at macports.org jmr at macports.org
Fri Feb 14 18:55:28 PST 2014


Revision: 117079
          https://trac.macports.org/changeset/117079
Author:   jmr at macports.org
Date:     2014-02-14 18:55:28 -0800 (Fri, 14 Feb 2014)
Log Message:
-----------
check for existence of sw_vers before trying to run it, and catch errors

Modified Paths:
--------------
    trunk/base/src/macports1.0/macports.tcl

Modified: trunk/base/src/macports1.0/macports.tcl
===================================================================
--- trunk/base/src/macports1.0/macports.tcl	2014-02-15 00:49:41 UTC (rev 117078)
+++ trunk/base/src/macports1.0/macports.tcl	2014-02-15 02:55:28 UTC (rev 117079)
@@ -597,8 +597,12 @@
     # Remove trailing "Endian"
     set os_endian [string range $tcl_platform(byteOrder) 0 end-6]
     set macosx_version {}
-    if {$os_platform eq {darwin}} {
-        set macosx_version [exec sw_vers -productVersion | cut -f1,2 -d.]
+    if {$os_platform eq "darwin" && [file executable /usr/bin/sw_vers]} {
+        if {![catch {exec /usr/bin/sw_vers -productVersion | cut -f1,2 -d.} result]} {
+            set macosx_version $result
+        } else {
+            ui_debug "sw_vers exists but running it failed: $result"
+        }
     }
 
     # Check that the current platform is the one we were configured for, otherwise need to do migration
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140214/08d43e2b/attachment.html>


More information about the macports-changes mailing list