This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

lndir problems


It looks like /usr/X11R6/bin/lndir has a bug when trying to link from a 
directory where stat() shows st_nlink of 1.  Rather than recursively create new 
subdirectories, it creates links to the original subdirectories, apparently 
under the (wrong) assumption that since st_nlink is <= 2, there are no 
subdirectories, so everything can be symlinked rather than stat'ting each 
readdir() entry to see which ones are subdirectories.

With 1.5.x, on a local drive,

$ mkdir -p a/b a/c e
$ touch a/d a/b/a
$ lndir `pwd`/a `pwd`/e
$ ls -FR e
e:
b/  c/  d@

e/b:
a@

e/c:

but on a remote drive,

$ cd /cygdrive/u
$ mkdir -p a/b a/c e
$ touch a/d a/b/a
$ lndir `pwd`/a `pwd`/e
..: File exists
$ ls -FR e
e:
b@  c@  d@

This becomes a problem for cygwin 1.7.0, which gives all directories an 
st_nlink of 1 rather than just remote directories.  It also impacts trying to 
build packages for cygwin 1.7.0, since cygport tries to use lndir.exe if it 
exists.  In the case of building wget, this means that instead of having a 
fully-populated link tree for an in-path build, I am now running configure in 
${B}, but then switching over to ${S} for building in subdirectories.  And the 
wget Makefile.in (incorrectly) tries to depend on ../config.status, which in 
${S} doesn't exist (since the symlink tree was built incorrectly).  At any 
rate, I'm wondering whether cygport should always use the fallback code when 
lndir does not exist, since the existing lndir.exe interferes with my attempt 
to create wget-1.11.3-2.

It also appears that lndir refuses to operate on relative arguments:

$ lndir a e
a: No such file or directory

but as there is no man page or even lndir --help, it isn't obvious whether this 
is intended behavior.

For that matter, even in the 1.5.x tree, the setup.hint for xorg-x11-bin-lndir 
has no external-source: line, but there is also no xorg-x11-bin-lndir-
6.8.99.901-1-src.tar.bz2.  Where is the source for lndir?

-- 
Eric Blake



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]