Changeset 89971


Ignore:
Timestamp:
Feb 17, 2012, 6:27:49 PM (9 years ago)
Author:
jberry@…
Message:

Whitespace only: tabs to spaces

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/port1.0/portmain.tcl

    r89970 r89971  
    149149
    150150proc is_valid_developer_dir { dir } {
    151         # Check whether specified directory looks valid for an Xcode installation
    152        
    153         # Verify that the directory exists
    154         if {![file isdirectory $dir]} {
    155                 return 0
    156         }
    157        
    158         # Verify that the directory has some key subdirectories
    159         foreach subdir {Headers Library usr} {
    160                 if {![file isdirectory "${dir}/${subdir}"]} {
    161                         return 0
    162                 }
    163         }
    164        
    165         # The specified directory seems valid for Xcode
    166         return 1
     151    # Check whether specified directory looks valid for an Xcode installation
     152   
     153    # Verify that the directory exists
     154    if {![file isdirectory $dir]} {
     155        return 0
     156    }
     157   
     158    # Verify that the directory has some key subdirectories
     159    foreach subdir {Headers Library usr} {
     160        if {![file isdirectory "${dir}/${subdir}"]} {
     161            return 0
     162        }
     163    }
     164   
     165    # The specified directory seems valid for Xcode
     166    return 1
    167167}
    168168
    169169
    170170proc get_xcode_suggestions {} {
    171         # Ask mdfind where Xcode is
    172         set result ""
     171    # Ask mdfind where Xcode is
     172    set result ""
    173173    if {![catch {set mdfind [binaryInPath mdfind]}]} {
    174         set result [exec $mdfind "kMDItemCFBundleIdentifier == 'com.apple.dt.Xcode'"]
    175         }
    176         return $result
     174        set result [exec $mdfind "kMDItemCFBundleIdentifier == 'com.apple.dt.Xcode'"]
     175    }
     176    return $result
    177177}
    178178
    179179
    180180proc portmain::get_developer_dir {} {
    181         set devdir ""
    182 
    183         # Look for xcodeselect, and make sure it has a valid value
     181    set devdir ""
     182
     183    # Look for xcodeselect, and make sure it has a valid value
    184184    if {![catch {set xcodeselect [binaryInPath xcode-select]}]} {
    185                
    186                 # We have xcodeselect: ask it where xcode is
    187         set devdir [exec $xcodeselect -print-path 2> /dev/null]
    188 
    189                 # If the the directory is valid, use it
    190         if {[is_valid_developer_dir $devdir]} {
    191                 return $devdir
    192         }
    193        
    194         # The directory from xcodeselect isn't correct.
    195         # Make some suggestions for the user
    196         set installed_xcodes [get_xcode_suggestions]
    197         if {[llength $installed_xcodes] == 0} {
    198                 # No installed Xcodes found
    199                 ui_error "No Xcode installation was found; please install Xcode"
    200         } else {
    201                 # One, or more than one, Xcode installations found
    202                 ui_error "No valid Xcode installation is properly selected"
    203                
    204                 ui_error
    205                 ui_error "Please use xcode-select to select an Xcode version:"
    206                 foreach xcode $installed_xcodes {
    207                         ui_error "    sudo xcode-select -switch ${xcode}"
    208                 }
    209                 ui_error
    210         }
     185       
     186        # We have xcodeselect: ask it where xcode is
     187        set devdir [exec $xcodeselect -print-path 2> /dev/null]
     188
     189        # If the the directory is valid, use it
     190        if {[is_valid_developer_dir $devdir]} {
     191            return $devdir
     192        }
     193       
     194        # The directory from xcodeselect isn't correct.
     195        # Make some suggestions for the user
     196        set installed_xcodes [get_xcode_suggestions]
     197        if {[llength $installed_xcodes] == 0} {
     198            # No installed Xcodes found
     199            ui_error "No Xcode installation was found; please install Xcode"
     200        } else {
     201            # One, or more than one, Xcode installations found
     202            ui_error "No valid Xcode installation is properly selected"
     203           
     204            ui_error
     205            ui_error "Please use xcode-select to select an Xcode version:"
     206            foreach xcode $installed_xcodes {
     207                ui_error "    sudo xcode-select -switch ${xcode}"
     208            }
     209            ui_error
     210        }
    211211    }
    212212   
     
    214214    set devdir "/Developer"
    215215    if {[is_valid_developer_dir $devdir]} {
    216         return $devdir
     216        return $devdir
    217217    }
    218218   
    219219    ui_error
    220         ui_error "No valid Xcode installation was found: please install Xcode"
     220    ui_error "No valid Xcode installation was found: please install Xcode"
    221221    ui_error
    222222   
Note: See TracChangeset for help on using the changeset viewer.