Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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 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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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