You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Stefan Bodewig <bo...@apache.org> on 2003/03/25 16:09:17 UTC

Cygwin tester needed

Hi,

please take a look at
<http://issues.apache.org/bugzilla/show_bug.cgi?id=17721>.  I can
reprodice this bug, but I'm afraid that the proposed patch will break
Cygwin - as I have no idea how it handles absolute paths.

The change would be in line 54 of the ant wrapper script (CVS HEAD),
instead of 

    if expr "$link" : '.*/.*' > /dev/null; then

we'd use

    if expr "$link" : '^/.*' > /dev/null; then

Oh, to run into this code, you must not set ANT_HOME and the script
you invoke must be a symlink (is this possible on Cygwin?) to the real
script.

Stefan

Re: Cygwin tester needed

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Stefan Bodewig wrote:
[rearranged]
 > you invoke must be a symlink (is this possible on Cygwin?)

Cygwin apparently has its own symlink mechanism. From my current
installation, the content of /cygwin/bin/aclocal-1.7 is
   !<symlink>../autotool/devel/bin/aclocal-1.7
Note that there are also the .lnk files inherited from Win95,
which are interpreted by Explorer components but probably
not handled by Cygwin (I didn't try), and NTFS has also its
own capability for symlinks, though I doubt this was ever
used for production.

> Cygwin - as I have no idea how it handles absolute paths.

The problem is that drive letter+colon combinations can be
interpreted as a path, you can e.g. do
   ls c:
and get the dir listing of your C drive. Valid drive letters can
change dynamically both due to innvoking mount/umount commands and
Windows drive mounts.
Internally such names are mapped to path names like /cygdrive/c
(prefix is configurable, so YMMV).
It is possible that cygpath can be used to expand C: to /cygdrive/c
in shell scripts, there ought to be a manual explaining this...

J.Pietschmann


Re: Cygwin tester needed

Posted by Stefan Bodewig <bo...@apache.org>.
On Tue, 25 Mar 2003, Stefan Moebius <st...@yahoo.com> wrote:

> warning: unportable BRE: `^/.*': using `^' as the first character of
> the basic regular expression is not portable;

That's funny.

The GNU man pages of expr(1) are a bit vague here (they talk about
"anchored" expressions in context of the : operator) - at least the
man pages installed on my RedHat 7.3 box.

The FreeBSD and Mac OS X pages state that a leading ^ would be added
implicitly and it seems to work on Solaris as well.  So I think we'll
go without the leading ^.  This seems to be POSIX.2 conformant as
well.

> So basically, the modification works as expected. 

Great, thanks.

Stefan

Re: Cygwin tester needed

Posted by Stefan Moebius <st...@yahoo.com>.
Ok - I've installed 1.5.3b1 and replaced the wrapper script by HEAD.
Install dir: C:\apache-ant-1.5.3Beta1

Test 1:
ln -s /cygdrive/c/apache-ant-1.5.3Beta1/bin/ant /usr/local/bin/ant

without modification:
ANT_HOME=/cygdrive/c/apache-ant-1.5.3Beta1

with modification:
expr: warning: unportable BRE: `^/.*': using `^' as the first character
of the basic regular expression is not portable; it is being ignored
ANT_HOME=/cygdrive/c/apache-ant-1.5.3Beta1

with '/.*' instead of '^/.*':
ANT_HOME=/cygdrive/c/apache-ant-1.5.3Beta1

Test 2:
ln -s /cygdrive/c/apache-ant-1.5.3Beta1 /usr/local/ant
cd /usr/local/bin
ln -s ../ant/bin/ant ant

without modification:
shows the buggy behavior

with modification:
same as test 1

with '/.*' instead of '^/.*':
same as test 1

So basically, the modification works as expected. 

Stefan

--- Stefan Bodewig <bo...@apache.org> wrote:
> Hi,
> 
> please take a look at
> <http://issues.apache.org/bugzilla/show_bug.cgi?id=17721>.  I can
> reprodice this bug, but I'm afraid that the proposed patch will break
> Cygwin - as I have no idea how it handles absolute paths.
> 
> The change would be in line 54 of the ant wrapper script (CVS HEAD),
> instead of 
> 
>     if expr "$link" : '.*/.*' > /dev/null; then
> 
> we'd use
> 
>     if expr "$link" : '^/.*' > /dev/null; then
> 
> Oh, to run into this code, you must not set ANT_HOME and the script
> you invoke must be a symlink (is this possible on Cygwin?) to the
> real
> script.
> 
> Stefan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
> 


=====
Stefan Moebius       <st...@gmx.de> 
  Wurzener Str. 43        +49 351 8475827
  01127 Dresden           +49 172 8739617

__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com