[36762] trunk/base/src/macports1.0/macports.tcl
jmr at macports.org
jmr at macports.org
Wed May 14 01:48:55 PDT 2008
Revision: 36762
http://trac.macosforge.org/projects/macports/changeset/36762
Author: jmr at macports.org
Date: 2008-05-14 01:48:55 -0700 (Wed, 14 May 2008)
Log Message:
-----------
upgrade: if the latest installed version of a port is not active, deactivate
the currently active version, if any, before trying to activate the latest
version. Fix for #12013.
Modified Paths:
--------------
trunk/base/src/macports1.0/macports.tcl
Modified: trunk/base/src/macports1.0/macports.tcl
===================================================================
--- trunk/base/src/macports1.0/macports.tcl 2008-05-14 08:43:33 UTC (rev 36761)
+++ trunk/base/src/macports1.0/macports.tcl 2008-05-14 08:48:55 UTC (rev 36762)
@@ -1937,7 +1937,7 @@
exit 1
}
}
- set anyactive 0
+ set anyactive no
set version_installed {}
set revision_installed {}
set epoch_installed 0
@@ -1964,25 +1964,30 @@
&& [rpm-vercomp $revision $revision_installed] > 0)} {
set version_installed $version
set revision_installed $revision
+ set variant_installed $variant
set epoch_installed [registry::property_retrieve [registry::open_entry $portname [lindex $i 1] [lindex $i 2] $variant] epoch]
set num $i
}
set isactive [lindex $i 4]
if {$isactive == 1} {
- if { [rpm-vercomp $version_installed $version] < 0
- || ([rpm-vercomp $version_installed $version] == 0
- && [rpm-vercomp $revision_installed $revision] < 0)} {
- # deactivate version
- if {[catch {portimage::deactivate $portname $version $optionslist} result]} {
- global errorInfo
- ui_debug "$errorInfo"
- ui_error "Deactivating $portname @${version_installed}_${revision_installed} failed: $result"
- return 1
- }
- }
+ set anyactive yes
+ set version_active $version
+ set revision_active $revision
+ set variant_active $variant
}
}
+ if { $anyactive && ([rpm-vercomp $version_installed $version_active] != 0
+ || [rpm-vercomp $revision_installed $revision_active] != 0
+ || [string compare $variant_installed $variant_active] != 0)} {
+ # deactivate version
+ if {[catch {portimage::deactivate $portname ${version_active}_${revision_active}${variant_active} $optionslist} result]} {
+ global errorInfo
+ ui_debug "$errorInfo"
+ ui_error "Deactivating $portname @${version_active}_${revision_active} failed: $result"
+ return 1
+ }
+ }
if { [lindex $num 4] == 0 && 0 == [string compare "image" ${macports::registry.installtype}] } {
# activate the latest installed version
if {[catch {portimage::activate $portname ${version_installed}_${revision_installed}$variant $optionslist} result]} {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080514/270c2d50/attachment-0001.html
More information about the macports-changes
mailing list