Projects
New Ticket     Wiki     Browse Source     Timeline     Roadmap     Bug Reports     Search

Changeset 39116 for trunk/base/src

Show
Ignore:
Timestamp:
08/08/08 09:12:16 (4 months ago)
Author:
jmr@…
Message:

Add clean_dep_map proc to registry, for removing duplicate dependency entries. (See #8763)

Location:
trunk/base/src/registry1.0
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/base/src/registry1.0/receipt_flat.tcl

    r37349 r39116  
    764764} 
    765765 
     766# remove duplicate entries from the dep_map 
     767# (could be put there by older versions of MacPorts) 
     768proc clean_dep_map {args} { 
     769    variable dep_map 
     770    set new_map [list] 
     771    set oldlen [llength $dep_map] 
     772    ui_debug "Current dep_map has $oldlen entries" 
     773    foreach de $dep_map { 
     774        if {[lsearch -exact $new_map $de] == -1} { 
     775            lappend new_map $de 
     776        } else { 
     777            ui_debug "Removing $de from dep_map" 
     778        } 
     779    } 
     780    set dep_map $new_map 
     781     
     782    set newlen [llength $dep_map] 
     783    set diff [expr $oldlen - $newlen] 
     784    ui_debug "New dep_map has $newlen entries" 
     785    ui_info "Removed $diff duplicate entries from the dependency map" 
     786} 
     787 
    766788proc write_dep_map {args} { 
    767789        global macports::registry.path 
  • trunk/base/src/registry1.0/registry.tcl

    r26177 r39116  
    371371} 
    372372 
     373proc clean_dep_map {args} { 
     374    global macports::registry.format 
     375    return [${macports::registry.format}::clean_dep_map $args] 
     376} 
     377 
    373378proc write_dep_map {args} { 
    374379        global macports::registry.format