Skip to content
Permalink
Browse files

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.

git-svn-id: https://svn.macports.org/repository/macports/trunk/base@14492 d073be05-634f-4543-b044-5fe20cf6d1d6
  • Loading branch information
jdberry committed Oct 9, 2005
1 parent d82112d commit 34b9b6d9c660dc5f4671b9416335ddf44446f60f
Showing with 20 additions and 1 deletion.
  1. +20 −1 src/port/portindex.tcl
@@ -4,7 +4,7 @@ exec @TCLSH@ "$0" "$@"

# Traverse through all ports, creating an index and archiving port directories
# if requested
# $Id: portindex.tcl,v 1.30 2005/09/22 23:03:13 jberry Exp $
# $Id: portindex.tcl,v 1.31 2005/10/09 01:02:08 jberry Exp $

catch {source \
[file join "@TCL_PACKAGE_DIR@" darwinports1.0 darwinports_fastload.tcl]}
@@ -100,6 +100,8 @@ proc print_usage args {
}

proc pindex {portdir} {
variable prefix $darwinports::prefix

global target fd directory archive outdir stats
incr stats(total)
if {[catch {set interp [dportopen file://[file join $directory $portdir]]} result]} {
@@ -125,6 +127,23 @@ proc pindex {portdir} {
exit 1
}
}

# Canonicalize any path: dependencies by substituting out $prefix
foreach dependstype { depends_build depends_lib depends_run } {
if {[info exists portinfo($dependstype)]} {
set deps $portinfo($dependstype)
set newDeps {}
foreach dep $deps {
if {[string match "path:$prefix/*" $dep]} {
lappend newDeps [regsub "^path:$prefix/" $dep "path:\$prefix/"]
} else {
lappend newDeps $dep
}
}
set portinfo($dependstype) $newDeps
}
}

set output [array get portinfo]
set len [expr [string length $output] + 1]
puts $fd [list $portinfo(name) $len]

0 comments on commit 34b9b6d

Please sign in to comment.
You can’t perform that action at this time.