[79518] trunk/base/src/registry2.0/portuninstall.tcl

jmr at macports.org jmr at macports.org
Thu Jun 16 07:33:21 PDT 2011


Revision: 79518
          http://trac.macports.org/changeset/79518
Author:   jmr at macports.org
Date:     2011-06-16 07:33:19 -0700 (Thu, 16 Jun 2011)
Log Message:
-----------
restrict recursing both ways when uninstalling with both --follow-dependencies and --follow-dependents

Modified Paths:
--------------
    trunk/base/src/registry2.0/portuninstall.tcl

Modified: trunk/base/src/registry2.0/portuninstall.tcl
===================================================================
--- trunk/base/src/registry2.0/portuninstall.tcl	2011-06-16 14:17:19 UTC (rev 79517)
+++ trunk/base/src/registry2.0/portuninstall.tcl	2011-06-16 14:33:19 UTC (rev 79518)
@@ -113,6 +113,12 @@
 
     # uninstall dependents if requested
     if {[info exists options(ports_uninstall_follow-dependents)] && $options(ports_uninstall_follow-dependents) eq "yes"} {
+        # don't uninstall dependents' dependencies
+        if {[info exists options(ports_uninstall_follow-dependencies)]} {
+            set orig_follow_dependencies $options(ports_uninstall_follow-dependencies)
+            unset options(ports_uninstall_follow-dependencies)
+            set optionslist [array get options]
+        }
         foreach depport [$port dependents] {
             # make sure it's still installed, since a previous dep uninstall may have removed it
             if {[registry::entry exists $depport] && ([$depport state] == "imaged" || [$depport state] == "installed")} {
@@ -121,6 +127,10 @@
                 }
             }
         }
+        if {[info exists orig_follow_dependencies]} {
+            set options(ports_uninstall_follow-dependencies) $orig_follow_dependencies
+            set optionslist [array get options]
+        }
     } else {
         # check its dependents
         registry::check_dependents $port ${uninstall.force} "uninstall"
@@ -211,6 +221,11 @@
     
     # uninstall dependencies if requested
     if {[info exists options(ports_uninstall_follow-dependencies)] && [string is true -strict $options(ports_uninstall_follow-dependencies)]} {
+        # don't uninstall dependencies' dependents
+        if {[info exists options(ports_uninstall_follow-dependents)]} {
+            unset options(ports_uninstall_follow-dependents)
+            set optionslist [array get options]
+        }
         while 1 {
             set remaining_list {}
             foreach dep $all_dependencies {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110616/6505417b/attachment.html>


More information about the macports-changes mailing list