Changeset 139170


Ignore:
Timestamp:
Aug 5, 2015, 2:23:42 PM (5 years ago)
Author:
raimue@…
Message:

macports1.0: do not treat broken select symlinks as "none"

After uninstalling a port the symlinks created by 'port select' will still
exist in the file system. We should attribute them to the previous selection
instead of 'none' which means no symlinks exist at all.

'file exists' tried to follow the broken symlink, but 'file type' does not and
leads to the expected result.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/macports1.0/macports.tcl

    r138949 r139170  
    43854385            set selected_version ${conf_path}/current
    43864386
    4387             if {![file exists $selected_version]} {
     4387            if {[catch {file type $selected_version} err]} {
     4388                # this might be okay if nothing was selected yet,
     4389                # just log the error for debugging purposes
     4390                ui_debug "cannot determine selected version for $group: $err"
    43884391                return none
    43894392            } else {
Note: See TracChangeset for help on using the changeset viewer.