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@macports.org http://www.tildesoft.com
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@macports.org http://www.tildesoft.com
Le 24 janv. 07 à 07:12, Kevin Ballard a écrit :
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.
I wrote those lines because we use readdir native command through MacPorts instead of glob. I don't know why, but I thought there was a good reason for the presence and use of a native replacement. Maybe when the readdir command was developed, it was in the Tcl 8.2.x area and glob didn't take the -directory option. Or the glob function from the Tcl version that shipped with a supported release of MacOS X was buggy or horribly slow.
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?
Now, to answer this question:
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.
Indeed, darwintracelib1.0 doesn't have a pkgIndex.tcl file, and this is on purpose. The code and the comment above were written before darwintracelib. This package doesn't provide anything Tcl uses directly. Instead, it provides a native library used with library injection mechanism for the implementation of the trace mode. See port (1) for documentation on the trace mode (enabled by -t). Paul
On Jan 24, 2007, at 6:48 PM, Paul Guyot wrote:
Le 24 janv. 07 à 07:12, Kevin Ballard a écrit :
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.
I wrote those lines because we use readdir native command through MacPorts instead of glob. I don't know why, but I thought there was a good reason for the presence and use of a native replacement. Maybe when the readdir command was developed, it was in the Tcl 8.2.x area and glob didn't take the -directory option. Or the glob function from the Tcl version that shipped with a supported release of MacOS X was buggy or horribly slow.
And this isn't a potential issue anymore? Are there any systems that MacPorts may be used on today that might have any of the possible problems you described? -- Kevin Ballard http://kevin.sb.org eridius@macports.org http://www.tildesoft.com
Le 26 janv. 07 à 01:42, Kevin Ballard a écrit :
On Jan 24, 2007, at 6:48 PM, Paul Guyot wrote:
Le 24 janv. 07 à 07:12, Kevin Ballard a écrit :
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.
I wrote those lines because we use readdir native command through MacPorts instead of glob. I don't know why, but I thought there was a good reason for the presence and use of a native replacement. Maybe when the readdir command was developed, it was in the Tcl 8.2.x area and glob didn't take the -directory option. Or the glob function from the Tcl version that shipped with a supported release of MacOS X was buggy or horribly slow.
And this isn't a potential issue anymore? Are there any systems that MacPorts may be used on today that might have any of the possible problems you described?
I don't think so, but others might chime in. Paul
On Jan 24, 2007, at 15:48, Paul Guyot wrote:
I don't know why, but I thought there was a good reason for the presence and use of a native replacement. Maybe when the readdir command was developed, it was in the Tcl 8.2.x area and glob didn't take the -directory option.
As I recall, that (and other missing functionality) was why I originally added it. Since that's no longer an issue, there doesn't seem a need for readdir() in pextlib. -landonf
participants (3)
-
Kevin Ballard
-
Landon Fuller
-
Paul Guyot