Changeset 53711


Ignore:
Timestamp:
Jul 12, 2009, 2:59:39 PM (10 years ago)
Author:
jmr@…
Message:

when activating, if another version of the same port is active, deactivate it first instead of erroring out (#10571)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/registry1.0/portimage.tcl

    r53660 r53711  
    8383        set revision [lindex $ilist 2]
    8484        set     variants [lindex $ilist 3]
    85        
    86     if {$v != ""} {
    87         ui_msg "$UI_PREFIX [format [msgcat::mc "Activating %s @%s"] $name $v]"
    88     } else {
    89         ui_msg "$UI_PREFIX [format [msgcat::mc "Activating %s"] $name]"
    90     }
    91 
     85
     86        # if another version of this port is active, deactivate it first
    9287        set ilist [registry::installed $name]
    9388        if { [llength $ilist] > 1 } {
     
    9994                        set iactive [lindex $i 4]
    10095                        if { ![string equal ${iversion}_${irevision}${ivariants} ${version}_${revision}${variants}] && $iactive == 1 } {
    101                                 return -code error "Image error: Another version of this port ($iname @${iversion}_${irevision}${ivariants}) is already active."
    102                         }
    103                 }
    104         }
     96                                deactivate $iname ${iversion}_${irevision}${ivariants} $optionslist
     97                        }
     98                }
     99        }
     100       
     101    if {$v != ""} {
     102        ui_msg "$UI_PREFIX [format [msgcat::mc "Activating %s @%s"] $name $v]"
     103    } else {
     104        ui_msg "$UI_PREFIX [format [msgcat::mc "Activating %s"] $name]"
     105    }
    105106
    106107        set ref [registry::open_entry $name $version $revision $variants]
Note: See TracChangeset for help on using the changeset viewer.