darwinports_fastload source iteration

Kevin Ballard eridius at macports.org
Fri Jan 12 11:27:36 PST 2007


I was just poking around and in darwinports_fastload.tcl.in I  
discovered the following:

# I could iterate on the directory, but the only way I know in Tcl  
involves a
# native function we provide in pextlib.
set dir [file join "@prefix_expanded@" share darwinports Tcl port1.0]
catch {source [file join $dir pkgIndex.tcl]}
set dir [file join "@prefix_expanded@" share darwinports Tcl package1.0]
catch {source [file join $dir pkgIndex.tcl]}
set dir [file join "@prefix_expanded@" share darwinports Tcl pextlib1.0]
catch {source [file join $dir pkgIndex.tcl]}
set dir [file join "@prefix_expanded@" share darwinports Tcl  
registry1.0]
catch {source [file join $dir pkgIndex.tcl]}

It's actually rather trivial to do this iteration - that block can be  
replaced with:

foreach dir [glob -directory "@prefix_expanded@" -join share  
darwinports Tcl *] {
     catch {source [file join $dir pkgIndex.tcl]}
}

Should I go ahead and commit this change?

Incidentally, this will source darwintrace1.0/pkgIndex.tcl (which the  
manual sourcing doesn't), but I looked in that file and it's just  
comments, so it won't make a difference. I am curious as to what  
darwintrace1.0 is for, since it doesn't provide any packages in  
pkgIndex.tcl.

-- 
Kevin Ballard
http://kevin.sb.org
eridius at macports.org
http://www.tildesoft.com


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-dev/attachments/20070112/59a6311e/attachment.html


More information about the macports-dev mailing list