[47757] trunk/base/src/macports1.0/macports.tcl
jmr at macports.org
jmr at macports.org
Thu Mar 5 07:34:58 PST 2009
Revision: 47757
http://trac.macports.org/changeset/47757
Author: jmr at macports.org
Date: 2009-03-05 07:34:58 -0800 (Thu, 05 Mar 2009)
Log Message:
-----------
upgrade: remove a redundant check (and indentation level)
Modified Paths:
--------------
trunk/base/src/macports1.0/macports.tcl
Modified: trunk/base/src/macports1.0/macports.tcl
===================================================================
--- trunk/base/src/macports1.0/macports.tcl 2009-03-05 15:24:46 UTC (rev 47756)
+++ trunk/base/src/macports1.0/macports.tcl 2009-03-05 15:34:58 UTC (rev 47757)
@@ -2309,66 +2309,62 @@
set version_installed {}
set revision_installed {}
set epoch_installed 0
- if {$ilist == ""} {
- ui_error "Port $portname should now be installed but isn't!"
- exit 1
- } else {
- # a port could be installed but not activated
- # so, deactivate all and save newest for activation later
- set num 0
- set variant ""
- foreach i $ilist {
- set variant [lindex $i 3]
- set version [lindex $i 1]
- set revision [lindex $i 2]
- if { $version_installed == {} ||
- [rpm-vercomp $version $version_installed] > 0
- || ([rpm-vercomp $version $version_installed] == 0
- && [rpm-vercomp $revision $revision_installed] > 0)} {
- set iname [lindex $i 0]
- set version_installed $version
- set revision_installed $revision
- set variant_installed $variant
- set epoch_installed [registry::property_retrieve [registry::open_entry $iname [lindex $i 1] [lindex $i 2] $variant] epoch]
- set num $i
- }
- set isactive [lindex $i 4]
- if {$isactive == 1} {
- set anyactive yes
- set active_name [lindex $i 0]
- set version_active $version
- set revision_active $revision
- set variant_active $variant
- }
+ # a port could be installed but not activated
+ # so, deactivate all and save newest for activation later
+ set num 0
+ set variant ""
+ foreach i $ilist {
+ set variant [lindex $i 3]
+ set version [lindex $i 1]
+ set revision [lindex $i 2]
+ if { $version_installed == {} ||
+ [rpm-vercomp $version $version_installed] > 0
+ || ([rpm-vercomp $version $version_installed] == 0
+ && [rpm-vercomp $revision $revision_installed] > 0)} {
+ set iname [lindex $i 0]
+ set version_installed $version
+ set revision_installed $revision
+ set variant_installed $variant
+ set epoch_installed [registry::property_retrieve [registry::open_entry $iname [lindex $i 1] [lindex $i 2] $variant] epoch]
+ set num $i
}
- 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 {$is_dryrun eq "yes"} {
- ui_msg "Skipping deactivate $active_name @${version_active}_${revision_active} (dry run)"
- } elseif {[catch {portimage::deactivate $active_name ${version_active}_${revision_active}${variant_active} $optionslist} result]} {
- global errorInfo
- ui_debug "$errorInfo"
- ui_error "Deactivating $active_name @${version_active}_${revision_active} failed: $result"
- return 1
- }
+
+ set isactive [lindex $i 4]
+ if {$isactive == 1} {
+ set anyactive yes
+ set active_name [lindex $i 0]
+ set version_active $version
+ set revision_active $revision
+ set variant_active $variant
}
- # record the variant of the latest version
- set variant [lindex $num 3]
- if { [lindex $num 4] == 0 && 0 == [string compare "image" ${macports::registry.installtype}] } {
- # activate the latest installed version
- if {$is_dryrun eq "yes"} {
- ui_msg "Skipping activate $iname @${version_installed}_${revision_installed} (dry run)"
- } elseif {[catch {portimage::activate $iname ${version_installed}_${revision_installed}$variant $optionslist} result]} {
- global errorInfo
- ui_debug "$errorInfo"
- ui_error "Activating $iname @${version_installed}_${revision_installed} failed: $result"
- return 1
- }
+ }
+ 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 {$is_dryrun eq "yes"} {
+ ui_msg "Skipping deactivate $active_name @${version_active}_${revision_active} (dry run)"
+ } elseif {[catch {portimage::deactivate $active_name ${version_active}_${revision_active}${variant_active} $optionslist} result]} {
+ global errorInfo
+ ui_debug "$errorInfo"
+ ui_error "Deactivating $active_name @${version_active}_${revision_active} failed: $result"
+ return 1
}
}
+ # record the variant of the latest version
+ set variant [lindex $num 3]
+ if { [lindex $num 4] == 0 && 0 == [string compare "image" ${macports::registry.installtype}] } {
+ # activate the latest installed version
+ if {$is_dryrun eq "yes"} {
+ ui_msg "Skipping activate $iname @${version_installed}_${revision_installed} (dry run)"
+ } elseif {[catch {portimage::activate $iname ${version_installed}_${revision_installed}$variant $optionslist} result]} {
+ global errorInfo
+ ui_debug "$errorInfo"
+ ui_error "Activating $iname @${version_installed}_${revision_installed} failed: $result"
+ return 1
+ }
+ }
# output version numbers
ui_debug "epoch: in tree: $epoch_in_tree installed: $epoch_installed"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090305/fa982d59/attachment.html>
More information about the macports-changes
mailing list