[clbuild-devel] Symlinks to clbuild script

Stefan Nobis stefan-ml at snobis.de
Tue Feb 12 16:41:54 UTC 2008


Hi.

I have something like the following setup:

  ~/lisp/clbuild
  ~/bin/clbuild -> ../lisp/clbuild/clbuild

with ~/bin being in PATH to be able to call clbuild from
everywhere. But this doesn't work because of this snippet at the
beginning of clbuild:

,----[ clbuild ]
| [...]
| self="$0"
| while test -h "$self"; do
| 	self=`readlink "$self"`
| done
| BASE="$(cd "$(dirname $self)" && pwd)"
| [...]
`----

readlink doesn't resolve to full absolute path and something like
'../lisp/clbuild/clbuild' is returned. If called e.g. from ~ cd
wouldn't find the target.

On Linux this would be easy to solve (readlink -e), but I use MacOS
and it's readlink doesn't have such properties. My Shell-Fu is very
bad, so is anyone here with an idea how to portably resolve a relative
symlink to an absolute path?

-- 
Until the next mail...,
Stefan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 162 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/clbuild-devel/attachments/20080212/b1e77431/attachment.sig>


More information about the clbuild-devel mailing list