[51429] trunk/base/src/macports1.0/macports_fastload.tcl.in

Bryan Blackburn blb at macports.org
Mon May 25 12:52:55 PDT 2009


On Mon, May 25, 2009 at 01:58:20PM +0200, Rainer Müller said:
> On 2009-05-25 06:17, blb at macports.org wrote:
> > Revision: 51429
> >           http://trac.macports.org/changeset/51429
[...]
> > -foreach dir [glob -directory "@prefix_expanded@" -join share macports Tcl *] {
> > -	catch {source [file join $dir pkgIndex.tcl]}
> > +set sharetcldir [file join "@prefix_expanded@" share macports Tcl]
> > +if {[file exists $sharetcldir]} {
> > +	foreach dir [glob -directory $sharetcldir *] {
> > +		catch {source [file join $dir pkgIndex.tcl]}
> > +	}
> >  }
> 
> Shouldn't this correctly result in an error otherwise as it failed to
> load port1.0 and others?

The problem is that it does result in an error, during make; for a new
prefix, the share/macports/Tcl dir doesn't exist and glob errors out.  For
example:

$ ./configure --prefix=/newlocation
...
$ make
...
===> making all in src/macports1.0
gcc -c -DUSE_TCL_STUBS -DTCL_NO_DEPRECATED -g -O2 -W -Wall -pedantic
-DHAVE_CONFIG_H -I.. -I.  -I"/usr/include" -fno-common macports.c -o
macports.o
cc -dynamiclib -L/usr/local/lib  macports.o -o MacPorts.dylib
-L/System/Library/Frameworks/Tcl.framework/Versions/8.4 -ltclstub8.4
-L/usr/local/lib  
warning: error while sourcing macports_fastload.tcl: no files matched glob
pattern "*"
make[2]: *** [pkgIndex.tcl] Error 1
make[1]: *** [all] Error 1
make: *** [all] Error 1


Since macports_fastload.tcl doesn't know whether it's being called during
make or actual runtime, I couldn't think of a better solution than this.

> 
> Is the problem with one of the Tcl scripts we run at install time? Maybe
> they have to be delayed until all files are copied then.

It's part of the pkgIndex stuff so when you made it more sensitive to errors
with pkg_mkindex.sh the error now stops make.  Note that if you run make
again all is fine...

Bryan


> 
> Rainer


More information about the macports-dev mailing list