Changeset 14492


Ignore:
Timestamp:
Oct 9, 2005, 1:02:08 AM (15 years ago)
Author:
jberry
Message:

While creating the portindex, canonicalize any path dependencies that
start with $prefix, by substiting the word "$prefix" for this prefix.
This should mean that portindex generation is consistent no matter the
local prefix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/port/portindex.tcl

    r14224 r14492  
    55# Traverse through all ports, creating an index and archiving port directories
    66# if requested
    7 # $Id: portindex.tcl,v 1.30 2005/09/22 23:03:13 jberry Exp $
     7# $Id: portindex.tcl,v 1.31 2005/10/09 01:02:08 jberry Exp $
    88
    99catch {source \
     
    101101
    102102proc pindex {portdir} {
     103        variable prefix $darwinports::prefix
     104       
    103105    global target fd directory archive outdir stats
    104106    incr stats(total)
     
    126128            }
    127129        }
     130       
     131        # Canonicalize any path: dependencies by substituting out $prefix
     132        foreach dependstype { depends_build depends_lib depends_run } {
     133                if {[info exists portinfo($dependstype)]} {
     134                        set deps $portinfo($dependstype)
     135                        set newDeps {}
     136                        foreach dep $deps {
     137                                if {[string match "path:$prefix/*" $dep]} {
     138                                        lappend newDeps [regsub "^path:$prefix/" $dep "path:\$prefix/"]
     139                                } else {
     140                                        lappend newDeps $dep
     141                                }
     142                        }
     143                        set portinfo($dependstype) $newDeps
     144                }
     145        }
     146       
    128147        set output [array get portinfo]
    129148        set len [expr [string length $output] + 1]
Note: See TracChangeset for help on using the changeset viewer.