delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/06/01/08:27:37

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Fri, 1 Jun 2001 14:27:04 +0200
From: Corinna Vinschen <cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: patching symlinks
Message-ID: <20010601142704.A595@cygbert.vinschen.de>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <15126 DOT 27720 DOT 592000 DOT 876140 AT gargle DOT gargle DOT HOWL>
Mime-Version: 1.0
User-Agent: Mutt/1.2.5i
In-Reply-To: <15126.27720.592000.876140@gargle.gargle.HOWL>; from Markus.Hoenicka@uth.tmc.edu on Thu, May 31, 2001 at 04:07:36PM +0000

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 AT cygwin DOT com
Red Hat, Inc.

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019