public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* bash [ -f filename ] behavior
@ 2000-10-01 19:58 Harold Hunt
  2000-10-01 20:06 ` Chris Faylor
  0 siblings, 1 reply; 3+ messages in thread
From: Harold Hunt @ 2000-10-01 19:58 UTC (permalink / raw)
  To: Cygx (E-mail), 'cygwin@sources.redhat.com'

When building XFree86 from CVS under Cygwin you may encounter a problem
where 'make World' reports that a file 'imake' cannot be moved because it
does not exist.

I have looked into this problem extensively, and it is due to bash behaving
differently under Cygwin than it does under Linux.  However, I believe it
deserves to at least be brought to light.

Make a bash script file containing the following line:
if [ -f imake ]; then mv imake imake.foo; fi

Follow these steps under Cygwin's Bash:

Run the script in a directory with no files named imake or imake.exe.  The
script will detect that imake does not exist, so it will not attempt to move
the file.

Run 'touch imake', then run the script again.  The script will move file
imake to imake.foo, as it should.

Run 'touch imake.exe', then run the script again.  The script will think
that a file named 'imake' exists, even though it doesn't; the script will
then attempt to move file 'imake', which does not exist, and the script will
fail.

Now, run the same steps under Linux's Bash, and you'll notice that the
script does not get confused when a file named 'imake.exe' exists.

This bug, or feature (as it may help compatibility), currently causes
XFree86 to fail when building under Cygwin.  I'm going to send in a patch to
XFree86 to check for 'imake.exe' before checking for 'imake'; that will fix
the build bustage for now.  But, I figure the Cygwin guys might want to
evaluate whether this is really desired behavior...

(I'm not on the Cygwin list, just the Cygwin/XFree86 list, so Cygwin people
please CC me.  Thanks.)

Harold 

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: bash [ -f filename ] behavior
  2000-10-01 19:58 bash [ -f filename ] behavior Harold Hunt
@ 2000-10-01 20:06 ` Chris Faylor
  0 siblings, 0 replies; 3+ messages in thread
From: Chris Faylor @ 2000-10-01 20:06 UTC (permalink / raw)
  To: Cygx (E-mail), 'cygwin@sources.redhat.com'; +Cc: Harold

On Sun, Oct 01, 2000 at 10:54:28PM -0400, Harold Hunt wrote:
>Make a bash script file containing the following line:
>if [ -f imake ]; then mv imake imake.foo; fi
>
>Follow these steps under Cygwin's Bash:
>
>Run the script in a directory with no files named imake or imake.exe.  The
>script will detect that imake does not exist, so it will not attempt to move
>the file.

FYI, the shell that make will use, by default, in a normal Cygwin
installation is 'ash' (aka /bin/sh), not 'bash'.

>Run 'touch imake', then run the script again.  The script will move file
>imake to imake.foo, as it should.
>
>Run 'touch imake.exe', then run the script again.  The script will think
>that a file named 'imake' exists, even though it doesn't; the script will
>then attempt to move file 'imake', which does not exist, and the script will
>fail.

Cygwin's stat() function has historically always found a 'foo.exe' when
passed a 'foo' argument.

>Now, run the same steps under Linux's Bash, and you'll notice that the
>script does not get confused when a file named 'imake.exe' exists.

I'm sure that you can find many many many similar observations of this
sort on the cygwin mailing list over the years if you want to search
the archives.

>This bug, or feature (as it may help compatibility), currently causes
>XFree86 to fail when building under Cygwin.  I'm going to send in a
>patch to XFree86 to check for 'imake.exe' before checking for 'imake';
>that will fix the build bustage for now.  But, I figure the Cygwin guys
>might want to evaluate whether this is really desired behavior...

It's long standing behavior.  I have no idea what would break if we
changed it now.

cgf

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: bash [ -f filename ] behavior
@ 2000-10-01 20:09 Harold Hunt
  0 siblings, 0 replies; 3+ messages in thread
From: Harold Hunt @ 2000-10-01 20:09 UTC (permalink / raw)
  To: 'cygwin@sources.redhat.com'

Thanks for the info.  I had a feeling it was for compatibility...

Harold

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-10-01 20:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-01 19:58 bash [ -f filename ] behavior Harold Hunt
2000-10-01 20:06 ` Chris Faylor
2000-10-01 20:09 Harold Hunt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).