delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/06/04/11:57:53

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Eric Blake <ebb9 AT byu DOT net>
Subject: lndir problems
Date: Wed, 4 Jun 2008 15:57:10 +0000 (UTC)
Lines: 59
Message-ID: <loom.20080604T150904-38@post.gmane.org>
Mime-Version: 1.0
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019