Wierd patch problem + simple fix

Corinna Vinschen corinna@vinschen.de
Sun May 21 05:58:00 GMT 2000


I'm completely unable to reproduce that problem...

...as far as the $TMP directory is on the same drive
   as the patched file!

Terry Wilson gave the correct hint. Nothing has changed
with patch itself. It tries to rename the temp file to
the name of the file that should be patched and failes
because the rename failes across drives.

AFAICS we are releasing patch 2.5 in latest. My Linux
edition has a patch version 2.5.3. Maybe that is already
fixed in that version.

Corinna

"Charles S. Wilson" wrote:
> 
> No luck.
> 
> $ export TMP=/tmp
> $ patch -p1 -R < ../bzip2-1.0.0-1.patch
> patching file `Makefile'
> patching file `bzlib.h'
> patching file `libbz2.def'
> 
> $ export TMP=E:/TEMP
> $ patch -p1 < ../bzip2-1.0.0-1.patch
> patching file `Makefile'
> patch: **** can't rename `E:/TEMP/po001048' to `Makefile' : File exists
> 
> $ export TMP=/e/TEMP
> $ patch -p1 < ../bzip2-1.0.0-1.patch
> patching file `Makefile'
> patch: **** can't rename `/e/TEMP/po001051' to `Makefile' : File exists
> 
> $ export TMP=/cygdrive/e/TEMP
> $ patch -p1 < ../bzip2-1.0.0-1.patch
> patching file `Makefile'
> patch: **** can't rename `/cygdrive/e/TEMP/po001056' to `Makefile' :
> File exists
> 
> ------------mount information------------
> $ mount
> Device              Directory           Type         Flags
> F:\cygwin\bin       /usr/bin            user         binmode
> F:\cygwin\lib       /usr/lib            user         binmode
> F:\cygwin           /                   user         binmode
> C:                  /c                  user         binmode
> E:                  /e                  user         binmode
> I:                  /i                  user         binmode
> 
> $ regtool get "user\\software\\Cygnus Solutions\\Cygwin\\mounts
> v2\\cygdrive prefix"
> /cygdrive
> 
> $ regtool get "user\\software\\Cygnus Solutions\\Cygwin\\mounts
> v2\\cygdrive flags"
> 34
> ----------------------------------------
> Is there an easier way to show the value and mount mode of
> cygdrive-prefix?
> 
> --Chuck
> 
> Chris Faylor wrote:
> >
> > This is very strange.  I don't understand why this would have changed.
> > We recently started converting the TMPDIR environment variable to
> > POSIX format but I don't understand why patch would suddenly stop
> > working like this.
> >
> > I'm wondering if it had anything to do with some changes that I
> > asked Corinna to make where a path specified with a ":" or a "\"
> > is interpreted as an MS-DOS spec and not subject to further cygwin
> > interpretation beyond being checked to see if it is a symlink.
> >
> > Out of curiosity, does setting TMP to something like E:/TEMP solve
> > anything?
> >
> > cgf
> >
> > On Sat, May 20, 2000 at 02:42:16AM -0400, Charles S. Wilson wrote:
> > >This behavior seems to have cropped up only recently, but I don't know
> > >*exactly* which of the myriad upgrades to my cygwin installation
> > >triggered it.
> > >
> > >patch gives a strange error:
> > >
> > >$ patch -p1 < ../binutils-patch
> > >patching file `ld/emultempl/pe.em'
> > >patch: **** can't rename `E:\TEMP/po002169' to `ld/emultempl/pe.em' :
> > >File exists
> > >
> > >I thought it may have been related to the line-ending troubles of
> > >cygwin-1.1.1, but after trying both the 5/19 snapshot and the 4/19
> > >snapshot, neither fixed it. This did:
> > >
> > >$ echo $TMP
> > >E:\TEMP
> > >$ export TMP=/tmp
> > >
> > >and then patch works just fine.
> > >
> > >
> > >So, here's two questions to ponder: why is patch now sensitive to the
> > >$TMP variable, and why didn't cygwin1.dll translate the pre-existing
> > >windows variable 'TMP' into /e/temp (since E: is mounted on /e)?
> > >
> > >Which leads to the following:
> > >
> > >$ export TMP=/e/TEMP
> > >$ patch -p1 -R < ../binutils-patch
> > >patching file `ld/emultempl/pe.em'
> > >patch: **** can't rename `/e/TEMP/po002198' to `ld/emultempl/pe.em' :
> > >File exists
> > >
> > >Weird.
> > >
> > >--Chuck
> > >
> > >P.S. I've gotta stress that whatever the underlying cause of this
> > >behavior, simply setting $TMP to /tmp, or unsetting it (e.g. 'export
> > >TMP=') will work around the problem.
> > >
> > >--
> > >Want to unsubscribe from this list?
> > >Send a message to cygwin-unsubscribe@sourceware.cygnus.com
> >
> > --
> > cgf@cygnus.com                        Cygnus Solutions, a Red Hat company
> > http://sourceware.cygnus.com/         http://www.redhat.com/
> >
> > --
> > Want to unsubscribe from this list?
> > Send a message to cygwin-unsubscribe@sourceware.cygnus.com
> 
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe@sourceware.cygnus.com

-- 
Corinna Vinschen
Cygwin Developer
Cygnus Solutions, a Red Hat company

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



More information about the Cygwin mailing list