Ticket #12013: upgrade-deactivate.diff
File upgrade-deactivate.diff, 2.6 KB (added by jmroot (Joshua Root), 17 years ago) |
---|
-
src/macports1.0/macports.tcl
1926 1926 exit 1 1927 1927 } 1928 1928 } 1929 set anyactive 01929 set anyactive no 1930 1930 set version_installed {} 1931 1931 set revision_installed {} 1932 1932 set epoch_installed 0 … … 1953 1953 && [rpm-vercomp $revision $revision_installed] > 0)} { 1954 1954 set version_installed $version 1955 1955 set revision_installed $revision 1956 set variant_installed $variant 1956 1957 set epoch_installed [registry::property_retrieve [registry::open_entry $portname [lindex $i 1] [lindex $i 2] $variant] epoch] 1957 1958 set num $i 1958 1959 } 1959 1960 1960 1961 set isactive [lindex $i 4] 1961 1962 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 1973 1967 } 1974 1968 } 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 } 1975 1980 if { [lindex $num 4] == 0 && 0 == [string compare "image" ${macports::registry.installtype}] } { 1976 1981 # activate the latest installed version 1977 1982 if {[catch {portimage::activate $portname ${version_installed}_${revision_installed}$variant $optionslist} result]} {