[89984] trunk/base/src/port1.0/portconfigure.tcl

jmr at macports.org jmr at macports.org
Sat Feb 18 04:38:53 PST 2012


Revision: 89984
          http://trac.macports.org/changeset/89984
Author:   jmr at macports.org
Date:     2012-02-18 04:38:51 -0800 (Sat, 18 Feb 2012)
Log Message:
-----------
prefer /usr/bin in find_developer_tool

Modified Paths:
--------------
    trunk/base/src/port1.0/portconfigure.tcl

Modified: trunk/base/src/port1.0/portconfigure.tcl
===================================================================
--- trunk/base/src/port1.0/portconfigure.tcl	2012-02-18 12:30:45 UTC (rev 89983)
+++ trunk/base/src/port1.0/portconfigure.tcl	2012-02-18 12:38:51 UTC (rev 89984)
@@ -428,25 +428,24 @@
 # Find a developer tool
 proc portconfigure::find_developer_tool {name} {
 	global developer_dir
-	
+
+    # first try /usr/bin since this doesn't move around
+    set toolpath "/usr/bin/${name}"
+    if {[file executable $toolpath]} {
+        return $toolpath
+    }
+
 	# Use xcode's xcrun to find the named tool.
-	if {[catch {set toolpath [exec [findBinary xcrun $portutil::autoconf::xcrun_path] -find ${name}]} result] == 0} {
+	if {![catch {exec [findBinary xcrun $portutil::autoconf::xcrun_path] -find ${name}} toolpath]} {
 		return ${toolpath}
 	}
-	
+
 	# If xcrun failed to find the tool, return a path from
-	# the developer_dir, falling back to /usr/bin.
+	# the developer_dir.
 	# The tool may not be there, but we'll leave it up to
 	# the invoking code to figure out that it doesn't have
 	# a valid compiler
-	set toolpath ""
-	foreach path "${developer_dir}/usr/bin /usr/bin" {
-		set toolpath "${path}/${name}"
-		if {[file executable $toolpath]} {
-			break
-		}
-	}
-	return $toolpath
+	return "${developer_dir}/usr/bin/${name}"
 }
 
 # internal function to find correct compilers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120218/3e3cc31d/attachment.html>


More information about the macports-changes mailing list