Ignore:
Timestamp:
Apr 20, 2011, 8:31:20 AM (9 years ago)
Author:
jmr@…
Message:

xcodeversion portgroup: use existing xcodeversion variable instead of extracting it from Xcode.app manually (#29214)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/_resources/port1.0/group/xcodeversion-1.0.tcl

    r74403 r78033  
    4646platform macosx {
    4747    pre-extract {
    48         set xcode_app ${developer_dir}/Applications/Xcode.app
    49         if {![file exists ${xcode_app}]} {
    50             ui_error "Couldn't find Xcode; expected it to be at ${xcode_app}."
     48        if {![info exists xcodeversion] || $xcodeversion == "none"} {
     49            ui_error "Couldn't determine your Xcode version (from '/usr/bin/xcodebuild -version')."
    5150            ui_error ""
    5251            ui_error "If you have not installed Xcode, install it now; see:"
    5352            ui_error "http://guide.macports.org/chunked/installing.xcode.html"
    5453            ui_error ""
    55             ui_error "If you have installed Xcode in a nonstandard location, inform MacPorts"
    56             ui_error "of that location by changing the 'developer_dir' variable in"
    57             ui_error "${prefix}/etc/macports/macports.conf"
    58             ui_error ""
    5954            return -code error "unable to find Xcode"
    6055        }
    61         set current_xcodeversion [exec defaults read ${xcode_app}/Contents/Info CFBundleShortVersionString]
    6256        foreach {darwin_major minimum_xcodeversion} [join ${minimum_xcodeversions}] {
    6357            if {${darwin_major} == ${os.major}} {
    64                 if {[rpm-vercomp ${current_xcodeversion} ${minimum_xcodeversion}] < 0} {
    65                     ui_error "On Mac OS X ${macosx_version}, ${name} ${version} requires Xcode ${minimum_xcodeversion} or later but you have Xcode ${current_xcodeversion}."
     58                if {[rpm-vercomp ${xcodeversion} ${minimum_xcodeversion}] < 0} {
     59                    ui_error "On Mac OS X ${macosx_version}, ${name} ${version} requires Xcode ${minimum_xcodeversion} or later but you have Xcode ${xcodeversion}."
    6660                    return -code error "incompatible Xcode version"
    6761                }
Note: See TracChangeset for help on using the changeset viewer.