This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: patching symlinks


On Thu, May 31, 2001 at 04:07:36PM +0000, Markus Hoenicka wrote:
> I hope I didn't miss something obvious. I tried to apply a patch to a
> file which is a symlink to the real file. What happens is that the
> .lnk file is patched, rendering it unusable as a symlink, whereas the
> real file is not touched. Is this the expected behaviour?

Partly. Just to be clear, let's create a situation:

$ ls -l
-rw-r--r--   1 corinna  root         9298 May 31 18:11 cyg_utils.cc
lrwxrwxrwx   1 corinna  root          104 Jun  1 14:15 utils.cc -> cyg_utils.cc
-rw-r--r--   1 corinna  root          756 May 31 18:11 utils.patch

`utils.patch' contains a patch to a file called `utils.cc'.

$ patch -p0 -i utils.patch
patching file `utils.cc'

$ ls -l
-rw-r--r--   1 corinna  root         9298 May 31 18:11 cyg_utils.cc
-rw-r--r--   1 corinna  root         9623 May 31 18:11 utils.cc
-rw-r--r--   1 corinna  root          756 May 31 18:11 utils.patch

That situation is absolute normal. Patch ignores that a file is
actually a symlink, not only on Cygwin. Patch merges the patches
into a file by creating another file including the merge,
typically in /tmp, and then simply moves the new file to the old
one. If that file is actually a symlink, the symlink is simply
substituted by the temporary file which is the result of
applying the patch.

In the current Cygwin version is an error in rename(2), though,
which has a slightly different (and wrong) result.
I have applied a patch to the Cygwin CVS repository.

Thanks for pointing this out,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]