[39116] trunk/base/src/registry1.0

jmr at macports.org jmr at macports.org
Fri Aug 8 09:12:17 PDT 2008


Revision: 39116
          http://trac.macosforge.org/projects/macports/changeset/39116
Author:   jmr at macports.org
Date:     2008-08-08 09:12:16 -0700 (Fri, 08 Aug 2008)
Log Message:
-----------
Add clean_dep_map proc to registry, for removing duplicate dependency entries. (See #8763)

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

Modified: trunk/base/src/registry1.0/receipt_flat.tcl
===================================================================
--- trunk/base/src/registry1.0/receipt_flat.tcl	2008-08-08 15:14:06 UTC (rev 39115)
+++ trunk/base/src/registry1.0/receipt_flat.tcl	2008-08-08 16:12:16 UTC (rev 39116)
@@ -763,6 +763,28 @@
 	set dep_map $new_map
 }
 
+# remove duplicate entries from the dep_map
+# (could be put there by older versions of MacPorts)
+proc clean_dep_map {args} {
+    variable dep_map
+    set new_map [list]
+    set oldlen [llength $dep_map]
+    ui_debug "Current dep_map has $oldlen entries"
+    foreach de $dep_map {
+        if {[lsearch -exact $new_map $de] == -1} {
+            lappend new_map $de
+        } else {
+            ui_debug "Removing $de from dep_map"
+        }
+    }
+    set dep_map $new_map
+    
+    set newlen [llength $dep_map]
+    set diff [expr $oldlen - $newlen]
+    ui_debug "New dep_map has $newlen entries"
+    ui_info "Removed $diff duplicate entries from the dependency map"
+}
+
 proc write_dep_map {args} {
 	global macports::registry.path
 	variable dep_map

Modified: trunk/base/src/registry1.0/registry.tcl
===================================================================
--- trunk/base/src/registry1.0/registry.tcl	2008-08-08 15:14:06 UTC (rev 39115)
+++ trunk/base/src/registry1.0/registry.tcl	2008-08-08 16:12:16 UTC (rev 39116)
@@ -370,6 +370,11 @@
 	return [${macports::registry.format}::unregister_dep $dep $type $port]
 }
 
+proc clean_dep_map {args} {
+    global macports::registry.format
+    return [${macports::registry.format}::clean_dep_map $args]
+}
+
 proc write_dep_map {args} {
 	global macports::registry.format
 	return [${macports::registry.format}::write_dep_map $args]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080808/8e242e11/attachment.html 


More information about the macports-changes mailing list