[Ecls-list] enough-namestring

timothy tschaef at sbcglobal.net
Fri Jun 30 03:57:17 UTC 2006


Hello,

I'm running on Debian, and am trying to adapt the post...install stuff
in a local copy so asdf can compile packages.  When ecl tries to compile
packages, it tries to write the output files in the source directory,
but common-lisp-controller, and I, would like them to go to a
user-specific directory somewhere else.

After playing with :after methods on asdf output-files, I found that the
function to translate the pathname was using enough-namestring.  This
function does not function correctly when the source is in a
subdirectory of the defaults.

> (enough-namestring
   "/usr/share/common-lisp/source/package.fas" 
   "/usr/share/common-lisp/source/")
"package.fas"
> (enough-namestring 
   "/usr/share/common-lisp/source/iterate/package.fas"
   "/usr/share/common-lisp/source/")
"/usr/share/common-lisp/source/iterate/package.fas"

This from the Hyperspec:

enough-namestring returns an abbreviated namestring that is just
sufficient to identify the file named by pathname when considered
relative to the defaults. It is required that
(merge-pathnames (enough-namestring pathname defaults) defaults)
==  (merge-pathnames (parse-namestring pathname nil defaults) defaults)

The condition is met (I checked it) but the second case above does not
seem to do what is described here.  I would expect to get
"iterate/package.fas" in the second case.  

Here's the source(from pathname.d):

@(defun enough_namestring (path
	&o (defaults si_default_pathname_defaults()))
	cl_object newpath;
@
	defaults = cl_pathname(defaults);
	path = cl_pathname(path);
	newpath
	= make_pathname(equalp(path->pathname.host,
                        defaults->pathname.host) ?
			Cnil : path->pathname.host,
	                equalp(path->pathname.device,
			       defaults->pathname.device) ?
			Cnil : path->pathname.device,
	                equalp(path->pathname.directory,
			       defaults->pathname.directory) ?
			Cnil : path->pathname.directory,
	                equalp(path->pathname.name,
                        defaults->pathname.name) ?
			Cnil : path->pathname.name,
	                equalp(path->pathname.type,
                        defaults->pathname.type) ?
			Cnil : path->pathname.type,
	                equalp(path->pathname.version,
			       defaults->pathname.version) ?
			Cnil : path->pathname.version);
	newpath->pathname.logical = path->pathname.logical;
	@(return ecl_namestring(newpath, 1))
@)

I think everything is ok except the directory matching. I'll try to come
up with a solution and send a patch, unless someone else comes up with
something first.  Is set-difference avialable here? Any suggestions?

Thanks,
Tim Schaeffer





More information about the ecl-devel mailing list