Ticket #55637: patch-allow-reactivation.diff

File patch-allow-reactivation.diff, 2.3 KB (added by RJVB (René Bertin), 7 years ago)
  • src/registry2.0/portimage.tcl

    diff --git src/registry2.0/portimage.tcl src/registry2.0/portimage.tcl
    index b576719c03c932fa9476ded1810c318e84e416f1..7d7a5afaed1beeef6aea9ffb21ae57fe2ae7eebb 100644
    proc activate {name {version ""} {revision ""} {variants 0} {optionslist ""}} { 
    9393        set registry_open yes
    9494    }
    9595    set todeactivate [list]
     96    set actaction "Activating"
    9697
    9798    registry::read {
    9899
    proc activate {name {version ""} {revision ""} {variants 0} {optionslist ""}} { 
    121122            return -code error "Image error: Can't find image file $location"
    122123        }
    123124        if {[$requested state] eq "installed"} {
    124             return -code error "Image error: ${name} @${specifier} is already active."
     125            if {$force} {
     126                set actaction "Reactivating"
     127                lappend todeactivate $requested
     128            } else {
     129                return -code error "Image error: ${name} @${specifier} is already active."
     130            }
    125131        }
    126132    }
    127133    foreach a $todeactivate {
    proc activate {name {version ""} {revision ""} {variants 0} {optionslist ""}} { 
    130136        }
    131137    }
    132138
    133     ui_msg "$UI_PREFIX [format [msgcat::mc "Activating %s @%s"] $name $specifier]"
     139    ui_msg "$UI_PREFIX [format [msgcat::mc "$actaction %s @%s"] $name $specifier]"
    134140
    135141    _activate_contents $requested
    136142}
  • src/port/port.tcl

    diff --git src/port/port.tcl src/port/port.tcl
    index 3320fba6917010c351e7316ae91560c3b7ec77d9..2f99da7c6c528fb448304af289ba9b31e81323e9 100644
    proc action_activate { action portlist opts } { 
    24852506    }
    24862507    foreachport $portlist {
    24872508        set composite_version [composite_version $portversion [array get variations]]
     2509        array set actoptions [array get options]
     2510        set force [expr [info exists actoptions(ports_force)] && [string is true -strict $actoptions(ports_force)]]
    24882511        if {![info exists options(ports_activate_no-exec)]
    24892512            && ![catch {set ilist [registry::installed $portname $composite_version]}]
    2490             && [llength $ilist] == 1} {
     2513            && ([llength $ilist] == 1 && !$force)} {
    24912514
    24922515            set i [lindex $ilist 0]
    24932516            set regref [registry::entry open $portname [lindex $i 1] [lindex $i 2] [lindex $i 3] [lindex $i 5]]