On Mar 23 07:11:45, RD Thrush wrote:
> My PORTSDIR is on an nfs server.  Mounting the particular nfs
> directory on /usr/ports (and setting PORTSDIR accordingly) fails the
> new test in bsd.port.mk.

Can you please show how exactly you are mounting it,
and how exactly it fails?

If you 'mount server:/some/dir /usr/ports',
then you shouldn't need to set PORTSDIR at all,
(because it's the default /usr/ports, right?).

Is possibly /usr/ports a symlink itself on your machine
(the NFS client)?

> Apparently test -h considers an nfs mount the same as a symlink...

No it doesn't; 'test -h foo' only evaluates as true for symlinks.

> -     @if test -h ${PORTSDIR}; then \
> -             echo 1>&2 "Fatal: ${PORTSDIR} is a symlink. Please set to the 
> real directory"; \
> +     @if ! test -d ${PORTSDIR}; then \
> +             echo 1>&2 "Fatal: ${PORTSDIR} is a not a directory."; \

This doesn't help, because

     Symbolic links are followed for all primaries except -h and -L.

So even if PORTSDIR was a symlink to a directory, "test -d"
would follow the symlink and evaluates as true; which is a bad thing.

Lokking at the manpag an source of test(1),

-h file True if file exists and is a symbolic link.
-L file True if file exists and is a symbolic link.
        This operator is for compatibility purposes.
        Do not rely on its existence; use -h instead.

{"-h",  FILSYM, UNOP},          /* for backwards compat */
{"-L",  FILSYM, UNOP},

So shouldn't the comment really be at "-L"?

        Jan

Reply via email to