Ticket #12013: upgrade-deactivate.diff

File upgrade-deactivate.diff, 2.6 KB (added by jmroot (Joshua Root), 13 years ago)

proposed fix

  • src/macports1.0/macports.tcl

     
    19261926            exit 1
    19271927        }
    19281928    }
    1929     set anyactive 0
     1929    set anyactive no
    19301930    set version_installed {}
    19311931    set revision_installed {}
    19321932    set epoch_installed 0
     
    19531953                        && [rpm-vercomp $revision $revision_installed] > 0)} {
    19541954                set version_installed $version
    19551955                set revision_installed $revision
     1956                set variant_installed $variant
    19561957                set epoch_installed [registry::property_retrieve [registry::open_entry $portname [lindex $i 1] [lindex $i 2] $variant] epoch]
    19571958                set num $i
    19581959            }
    19591960
    19601961            set isactive [lindex $i 4]
    19611962            if {$isactive == 1} {
    1962                 if { [rpm-vercomp $version_installed $version] < 0
    1963                         || ([rpm-vercomp $version_installed $version] == 0
    1964                             && [rpm-vercomp $revision_installed $revision] < 0)} {
    1965                     # deactivate version
    1966                     if {[catch {portimage::deactivate $portname $version $optionslist} result]} {
    1967                         global errorInfo
    1968                         ui_debug "$errorInfo"
    1969                         ui_error "Deactivating $portname @${version_installed}_${revision_installed} failed: $result"
    1970                         return 1
    1971                     }
    1972                 }
     1963                set anyactive yes
     1964                set version_active $version
     1965                set revision_active $revision
     1966                set variant_active $variant
    19731967            }
    19741968        }
     1969        if { $anyactive && ([rpm-vercomp $version_installed $version_active] != 0
     1970                            || [rpm-vercomp $revision_installed $revision_active] != 0
     1971                            || [string compare $variant_installed $variant_active] != 0)} {
     1972            # deactivate version
     1973            if {[catch {portimage::deactivate $portname ${version_active}_${revision_active}${variant_active} $optionslist} result]} {
     1974                global errorInfo
     1975                ui_debug "$errorInfo"
     1976                ui_error "Deactivating $portname @${version_active}_${revision_active} failed: $result"
     1977                return 1
     1978            }
     1979        }
    19751980        if { [lindex $num 4] == 0 && 0 == [string compare "image" ${macports::registry.installtype}] } {
    19761981            # activate the latest installed version
    19771982            if {[catch {portimage::activate $portname ${version_installed}_${revision_installed}$variant $optionslist} result]} {