[61480] trunk/base/src/registry1.0/portimage.tcl

jmr at macports.org jmr at macports.org
Sat Dec 12 12:33:26 PST 2009


Revision: 61480
          http://trac.macports.org/changeset/61480
Author:   jmr at macports.org
Date:     2009-12-12 12:33:24 -0800 (Sat, 12 Dec 2009)
Log Message:
-----------
deactivate ports with conflicting files when they are replaced_by a port being activated

Modified Paths:
--------------
    trunk/base/src/registry1.0/portimage.tcl

Modified: trunk/base/src/registry1.0/portimage.tcl
===================================================================
--- trunk/base/src/registry1.0/portimage.tcl	2009-12-12 19:54:14 UTC (rev 61479)
+++ trunk/base/src/registry1.0/portimage.tcl	2009-12-12 20:33:24 UTC (rev 61480)
@@ -313,8 +313,18 @@
 
 		set port [registry::file_registered $file]
 
-		if { $port != 0  && $force != 1 && $port != $name } {
-			return -code error "Image error: $file is being used by the active $port port.  Please deactivate this port first, or use 'port -f activate $name' to force the activation."
+        if { $port != 0  && $force != 1 && $port != $name } {
+            if {[catch {mportlookup $port} result]} {
+                global errorInfo
+                ui_debug "$errorInfo"
+                return -code error "port lookup failed: $result"
+            }
+            array set portinfo [lindex $result 1]
+            if {[info exists portinfo(replaced_by)] && [lsearch -exact -nocase $portinfo(replaced_by) $name] != -1} {
+                deactivate $port "" ""
+            } else {
+                return -code error "Image error: $file is being used by the active $port port.  Please deactivate this port first, or use 'port -f activate $name' to force the activation."
+            }
 		} elseif { [file exists $file] && $force != 1 } {
 			return -code error "Image error: $file already exists and does not belong to a registered port.  Unable to activate port $name."
 		} elseif { $force == 1 && [file exists $file] || $port != 0 } {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20091212/99b4b474/attachment.html>


More information about the macports-changes mailing list