darwinports_fastload source iteration

Kevin Ballard eridius at macports.org
Tue Jan 23 14:12:30 PST 2007


Hrm, nobody has responded. I guess nobody cares?

If I don't hear anything back in the next few days, I'll go ahead and  
commit the change.

On Jan 12, 2007, at 2:27 PM, Kevin Ballard wrote:

> 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/20070123/e430521f/attachment.html


More information about the macports-dev mailing list