delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/11/05/13:17:53

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Thu, 5 Nov 2009 13:17:32 -0500
From: Christopher Faylor <cgf-use-the-mailinglist-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: src/winsup/cygwin ChangeLog syscalls.cc
Message-ID: <20091105181732.GB1918@ednor.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20091105144413 DOT 31963 DOT qmail AT sourceware DOT org> <4AF30801 DOT 7090508 AT users DOT sourceforge DOT net> <20091105173450 DOT GQ26344 AT calimero DOT vinschen DOT de> <20091105180847 DOT GA1918 AT ednor DOT casa DOT cgf DOT cx>
MIME-Version: 1.0
In-Reply-To: <20091105180847.GA1918@ednor.casa.cgf.cx>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Thu, Nov 05, 2009 at 01:08:47PM -0500, Christopher Faylor wrote:
>On Thu, Nov 05, 2009 at 06:34:50PM +0100, Corinna Vinschen wrote:
>>On Nov  5 11:14, Yaakov S wrote:
>>> On 05/11/2009 08:44, corinna-rDBXBDvO6BXQT0dZR+AlfA AT public DOT gmane DOT org wrote:
>>> >Modified files:
>>> >	winsup/cygwin  : ChangeLog syscalls.cc
>>> >
>>> >Log message:
>>> >	* syscalls.cc (nt_path_has_suffix): New function.
>>> >	(rename): Don't append .exe suffix if binary target name has any suffix
>>> >	at all.
>>> >
>>> >Patches:
>>> >http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/winsup/cygwin/ChangeLog.diff?cvsroot=src&r1=1.4708&r2=1.4709
>>> >http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/winsup/cygwin/syscalls.cc.diff?cvsroot=src&r1=1.543&r2=1.544
>>> 
>>> On my system dozens of executables do have a '.' near the end of
>>> their names, either representing a version (e.g. perl5.10.0.exe,
>>> python2.5.exe), or OCaml native code (*.opt.exe), or for other
>>> reasons (e.g. *.bin.exe where the program is launched via a script).
>>> How does this change affect building/installing them?
>>
>>Let's see:
>>
>>  rename ("foo.exe", "perl5.10.0.exe")  result: perl5.10.0.exe
>>  rename ("foo.exe", "perl5.10.0")      result: perl5.10.0
>>  rename ("foo", "perl5.10.0.exe")      result: perl5.10.0.exe
>>  rename ("foo", "perl5.10.0")          result: perl5.10.0
>>
>>The latter one is a problem, because that's what happens when calling
>>
>>  strip perl5.10.0
>>
>>so after strip the binary is missing a .exe suffix.
>>
>>Sigh.
>>
>>Is there any *reliable* solution to this problem, other than never to
>>add a .exe suffix?
>
>Isn't the reliable-but-slow method to check the magic at the beginning
>of the file to see if it actually is a .exe?  I'm not sure we want to do
>that though.

Which is, of course, what we're doing.  Duh.

I see why the strip case is problematic but I can't think of a way to
fix it since the "state" of the temporary file is lost between stripping
and renaming.

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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