delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/07/28/10:40:56

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Tue, 28 Jul 2009 16:40:24 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Odd directory created when installing 1.7
Message-ID: <20090728144024.GU18621@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <4A6E4A0C DOT 9000503 AT hones DOT org DOT uk> <20090728102724 DOT GO18621 AT calimero DOT vinschen DOT de> <4A6EFBEB DOT 8030800 AT hones DOT org DOT uk> <4A6F0096 DOT 9000209 AT hones DOT org DOT uk>
MIME-Version: 1.0
In-Reply-To: <4A6F0096.9000209@hones.org.uk>
User-Agent: Mutt/1.5.19 (2009-02-20)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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

On Jul 28 14:43, Cliff Hones wrote:
> Cliff Hones wrote:
> > .. One further possibly useful piece
> > of informaion - the create timestamps on the odd directories are all the
> > same, and 14 seconds later than the timestamp on the correct "dev" directory.
> 
> Looking at the install log, I see this timestamp matches the time the
> bash.sh postinstall was run, so it would have been this snippet which
> did it, I imagine:
> 
>   # Install /dev/fd, /dev/std{in,out,err}.  The bash builtin test was compiled
>   # to assume these exist, so use /bin/test to really check.
>   DEVDIR="$(cygpath -au "C:/$(cygpath -am /dev/)" | sed 's|/c/\(.\):/|/\1/|')"
>   mkdir -p "$DEVDIR" || result=1

Hmm, this looks kind of fragile.  Not to say it looks wrong.

$ cygpath -am /dev/
C:/cygwin/dev

Ok.

$ echo "C:/$(cygpath -am /dev/)"
C:/C:/cygwin/dev

Huh?

$ cygpath -au "C:/$(cygpath -am /dev/)"
/cygdrive/c/C:/cygwin/dev

Huh^2?

$ echo "$(cygpath -au "C:/$(cygpath -am /dev/)" | sed 's|/c/\(.\):/|/\1/|')"
/cygdrive/C/cygwin/dev

That's ok again, but is it always right?  I can't believe it.

Already using the fixed "C:/" in the expression is incorrect, given
that everybody is free to install Cygwin to a non-C: drive.

What this postinstall script should do is just this:

  mkdir -p /dev || result=1

or to drop the mkdir entirely since the /dev/ dir has been already
created by the 000-cygwin-post-install.sh script.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

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

- Raw text -


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