delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/05/20/17:15:59

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <4BF5A66F.405@redhat.com>
Date: Thu, 20 May 2010 15:15:27 -0600
From: Eric Blake <eblake AT redhat DOT com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-3.fc13 Lightning/1.0b1 Mnenhy/0.8.2 Thunderbird/3.0.4
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: bash pwd returning windows style paths
References: <005101caf85f$22c11060$68433120$@beniston.com>
In-Reply-To: <005101caf85f$22c11060$68433120$@beniston.com>
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

--------------enig753925E5EFA9AB94815BD7BE
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 05/20/2010 02:58 PM, Jon Beniston wrote:
> Hi,
>=20
> I'm trying to get the linuxtools Eclipse autoconf plugin to work on Cygwi=
n.
> One problem I'm having is that a configure script (from newlib) is calling
> pwd which is returning a Windows style path (e.g. c:/something), which
> causes it to fail. This appears to be because Eclipse is setting the
> environment variable PWD to a Windows style path. This can be reproduced
> with:
>=20
> PWD=3Dc:/cygwin/ sh
> $ pwd
> c:/cygwin/

POSIX states that a shell is under no obligation to trust a PWD
inherited from the parent process, and that there are unspecified
results if you try to manually change PWD outside of the use of 'cd'
within the shell.  Bash, in particular, merely checks whether the
current value of the inherited PWD happens to match the current
directory, and not whether it is a canonical spelling.

>=20
> I'm just wondering what would be the recommended way to tackle this:
>=20
> 1. Change Eclipse so it sets PWD to a Cygwin style path.=20

That, or not set it at all in the first place.

> 2. Patch the bash pwd builtin so it doesn't return Windows paths.=20

I don't want to go changing bash just for this.

> 3. Change the configure script so it uses /usr/bin/pwd instead of the
> builtin (which returns the Cygwin style path).
> 4. Something else?=20

You can use 'cd -P .' to force bash to set PWD to the canonical name of
the current directory, which will then get rid of the windows-style naming:

$ (cd /cygdrive/c; PWD=3Dc:/ bash -c pwd)
c:/
$ (cd /cygdrive/c; PWD=3Dc:/ bash -c "cd -P .; pwd")
/cygdrive/c

--=20
Eric Blake   eblake AT redhat DOT com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


--------------enig753925E5EFA9AB94815BD7BE
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJL9aZvAAoJEKeha0olJ0NqxdAH/36P9bYZWeIeTDanemL/UMIP
2qhQR1TCkCTYjvZNCAWzMMhYfNSLynpLuz/5J6bRe6iIDeLp64lFvWEtGVPC9k5Z
oZ9ERFXTTcE+lZhNPIk0wN7ZfTHj26jIAopi3fnkhG5E3z4DtGCea1vptc+pt7QJ
Vj2YZTNKzYrJQ4xPwcARXBEj6pxavoPtNdrUlo+sFGRzKSBZk7+hzWUuMqVeKqIk
13eUElT+PpsOuyF1lw+0rCYJXPLpuEzJfWB5hcNIZIlmFaEfy8A1hDEKfa/3GMgU
udjm+SG8ioq5jdA9FHSy4o6FXN4Avhbb/4V2olLUrWfo83qUfi6hYh472Xcg78g=
=Mfqq
-----END PGP SIGNATURE-----

--------------enig753925E5EFA9AB94815BD7BE--

- Raw text -


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