Ticket #12794: macports-versions.patch

File macports-versions.patch, 1.1 KB (added by afb@…, 16 years ago)
  • src/port/port.tcl

     
    16631663}
    16641664
    16651665
     1666proc macosx_version {} {
     1667    return [exec /bin/sh -c "/usr/bin/sw_vers | sed -n 's/^ProductVersion:\[\[:space:\]\]//p' | cut -f 1-3 -d."]
     1668}
     1669
     1670proc xcode_version {} {
     1671    return [exec /bin/sh -c "tr -d '\\r\\n' < /Developer/Applications/Xcode.app/Contents/version.plist | sed -e 's/.*<key>CFBundleShortVersionString<\\/key>.<string>\\(\[0-9.\]*\\)<\\/string>.*/\\1/'"]
     1672}
     1673
    16661674proc action_platform { action portlist opts } {
    16671675#   global os.platform os.major os.arch
    16681676    global tcl_platform
     
    16741682    set os_major [lindex [split $tcl_platform(osVersion) .] 0]
    16751683#   puts "Platform: ${os.platform} ${os.major} ${os.arch}"
    16761684    puts "Platform: ${os_platform} ${os_major} ${os_arch}"
     1685
     1686    # check for macosx with the same hack that the implicit variant does
     1687    if {[file isdirectory /System/Library/Frameworks/Carbon.framework]} {
     1688        puts "Mac OS X: [macosx_version]"
     1689        puts "Xcode: [xcode_version]"
     1690    }
    16771691    return 0
    16781692}
    16791693