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

jberry at macports.org jberry at macports.org
Sun Feb 19 09:25:33 PST 2012


Revision: 90003
          http://trac.macports.org/changeset/90003
Author:   jberry at macports.org
Date:     2012-02-19 09:25:33 -0800 (Sun, 19 Feb 2012)
Log Message:
-----------
Prefer findBinary over binaryInPath for mdfind, xcodebuild, and xcode-select,
as we know where these are supposed to be. We can thus avoid a potential
security issue, as well as a bit of searching.

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-19 17:25:25 UTC (rev 90002)
+++ trunk/base/src/macports1.0/macports.tcl	2012-02-19 17:25:33 UTC (rev 90003)
@@ -366,7 +366,7 @@
     trace remove variable macports::xcodeversion read macports::setxcodeinfo
     trace remove variable macports::xcodebuildcmd read macports::setxcodeinfo
 
-    if {[catch {set xcodebuild [binaryInPath "xcodebuild"]}] == 0} {
+    if {[!catch {findBinary xcodebuild /usr/bin/xcodebuild]} xcodebuild} {
         if {![info exists xcodeversion]} {
             # Determine xcode version
             set macports::xcodeversion "2.0orlower"
@@ -426,7 +426,7 @@
 
     set devdir ""
     # Look for xcodeselect, and make sure it has a valid value
-    if {![catch {binaryInPath xcode-select} xcodeselect]} {
+    if {![catch {findBinary xcode-select /usr/bin/xcode-select} xcodeselect]} {
 
         # We have xcode-select: ask it where xcode is
         set devdir [exec $xcodeselect -print-path 2> /dev/null]
@@ -439,7 +439,7 @@
         # The directory from xcode-select isn't correct.
         # Ask mdfind where Xcode is and make some suggestions for the user
         set installed_xcodes {}
-        if {![catch {binaryInPath mdfind} mdfind]} {
+        if {![catch {findBinary mdfind /usr/bin/mdfind} mdfind]} {
             set installed_xcodes [exec $mdfind "kMDItemCFBundleIdentifier == 'com.apple.dt.Xcode'"]
         }
         if {[llength $installed_xcodes] > 0} {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120219/d8606c17/attachment.html>


More information about the macports-changes mailing list