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

dports at macports.org dports at macports.org
Mon Feb 20 17:33:44 PST 2012


Revision: 90074
          http://trac.macports.org/changeset/90074
Author:   dports at macports.org
Date:     2012-02-20 17:33:44 -0800 (Mon, 20 Feb 2012)
Log Message:
-----------
`xcode-select -print-path` gives an error if no Xcode directory has
been selected; handle that case correctly.

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

Modified: trunk/base/src/macports1.0/macports.tcl
===================================================================
--- trunk/base/src/macports1.0/macports.tcl	2012-02-20 23:01:36 UTC (rev 90073)
+++ trunk/base/src/macports1.0/macports.tcl	2012-02-21 01:33:44 UTC (rev 90074)
@@ -429,11 +429,10 @@
     # Look for xcodeselect, and make sure it has a valid value
     if {![catch {findBinary xcode-select $macports::autoconf::xcode_select_path} xcodeselect]} {
 
-        # We have xcode-select: ask it where xcode is
-        set devdir [exec $xcodeselect -print-path 2> /dev/null]
-
-        # If the directory is valid, use it
-        if {[_is_valid_developer_dir $devdir]} {
+        # We have xcode-select: ask it where xcode is and check if it's valid.
+        # If no xcode is selected, xcode-select will fail, so catch that
+        if {![catch {exec $xcodeselect -print-path 2> /dev/null} devdir] &&
+            [_is_valid_developer_dir $devdir]} {
             set macports::developer_dir $devdir
             return
         }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120220/15d9b40c/attachment.html>


More information about the macports-changes mailing list