delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/02/11/18:57:57

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Message-ID: <012501c2d229$5fd434f0$78d96f83@pomello>
From: "Max Bowsher" <maxb AT ukf DOT net>
To: <cygwin AT cygwin DOT com>, "Newton, Doug" <dnewton AT htc DOT net>
References: <Pine DOT GSO DOT 4 DOT 44 DOT 0302111832460 DOT 14791-100000 AT slinky DOT cs DOT nyu DOT edu>
Subject: Re: cygpath bug in version 1.25 -- Fundamental Change in the Behaviour of Cygpath
Date: Tue, 11 Feb 2003 23:57:45 -0000
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106

Igor Pechtchanski wrote:
> On Tue, 11 Feb 2003, Newton, Doug wrote:
>
>> If this change is what is desired by the majority, that is fine.
>> BUT, it should have been made clear that the fundamental behaviour
>> of cygpath had changed.  I have many scripts that no longer work.
>> Even the jakarata ant tool's start-up script now mangles the
>> classpath because of this change in behaviour.
>
> This change makes the output correct.  I suppose that would be
> something desired by the majority...

Yet technical correctness has come at the price of usability and
functionality.
E.g. You cannot convert to --mixed style from --windows style with --path.

>> At least with version 1.21 (and I believe through 1.24, just glancing
>> through the CVS history), the behaviour was always as follows:
>>
>> "cygpath --path --unix $UNIX_CLASSPATH" returns UNIX_CLASSPATH
>> "cygpath --path --unix $DOS_CLASSPATH" return UNIX_CLASSPATH
>> "cygpath --path --windows $UNIX_CLASSPATH" returns DOS_CLASSPATH
>> "cygpath --path --windows $DOS_CLASSPATH" returns DOS_CLASSPATH
>>
>> Now the behaviour is as follows:
>>
>> "cygpath --path --unix $UNIX_CLASSPATH" returns a truncated
>> UNIX_CLASSPATH if it is too long
>
> Yes, because it treats it as one filename...
>
>> "cygpath --path --unix $DOS_CLASSPATH" return UNIX_CLASSPATH
>> "cygpath --path --windows $UNIX_CLASSPATH" returns DOS_CLASSPATH
>> "cygpath --path --windows $DOS_CLASSPATH" returns a garbled
>> DOS_CLASSPATH regardless of length (e.g. the path is transformed
>> from "C:/home/build" to "C;c:/home/build"
>
> Yes, because it treats ":" as a separator.
>
>> We no longer have the option to run a classpath of unknown format
>> through cgypath to make sure it is in a known format.  This is the
>> issue in the jakarta ant tool.  It makes no assumptions on what the
>> format of the path is -- it immediately converts it to unix
>> regardless of the current format.
>
> It makes an assumption that the format is Windows.  Otherwise,
> there'd be no need to convert to Unix format...

Of course, if you simply wanted to *ensure* that the path was in unix
format... you're stuck.

>> Is there another utility that can be used to identify the format of a
>> classpath?  This will be needed to account for the changed behaviour
>> in modifying scripts.
>
> Umm, 'grep'?  In particular, grep for a ";" or a "\" for a
> windows-format path...

Which is presumably vaguely what cygpath used to do.

Doug: have you considered making a patch to cygpath to make it behave more
to your liking (conditional on a command line option if need be), and
submitting that?



Max.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.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