X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:reply-to:message-id:to:subject
	:in-reply-to:references:mime-version:content-type
	:content-transfer-encoding; q=dns; s=default; b=Iv1q7dCcWaso74EI
	OgPfzCrhLKiWewiESV41YsvzySw+38beHeUtsBZyZaYRVkm+e3GUJ7DHNDfJHcJu
	4eutNbI5ZQeeqfp4Zlk6gFAXhTalR7UdNnEyZrIHdBdPiV30SS5R4Hd8Uy2na7wW
	nOmo632EMnC3nrQ45r7T96t+bfI=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:reply-to:message-id:to:subject
	:in-reply-to:references:mime-version:content-type
	:content-transfer-encoding; s=default; bh=L7NK5rc4uiukwVlAzFdaP1
	ym7co=; b=Fakw+bKHFkTBQIei/OutAYlRewbBo6ZT1Mzqz4RtHBTdIx3uoEbIfg
	M72gFnEHEfM1IQ74EfcbmZ3+e0LFmSY3hTjpr6VjCNVl3CKzM0w/hsNRvn9hOEfH
	buRDtPGEh7e7D+KtDZ4EZ8ljNJnsNX1vni/8qSfxDKb7HbmQZdYeU=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=4.0 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,KAM_THEBAT,MIME_BASE64_BLANKS,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=H*UA:Bat!, H*x:Bat!, H*r:sk:postmas, H*r:4.80.1
X-Spam-User: qpsmtpd, 2 recipients
X-HELO: smtp.ht-systems.ru
Date: Mon, 4 Apr 2016 14:10:29 +0300
From: Andrey Repin <anrdaemon@yandex.ru>
Reply-To: cygwin@cygwin.com
Message-ID: <667681616.20160404141029@yandex.ru>
To: Yaakov Selkowitz <yselkowitz@cygwin.com>, cygwin@cygwin.com
Subject: Re: How to install a custom permanent postinstall handler?
In-Reply-To: <57020525.90909@cygwin.com>
References: <838469265.20160401235308@yandex.ru> <87a8lcicxg.fsf@Rainer.invalid>   <5700975A.3070002@cygwin.com> <87y48vqkfx.fsf@Rainer.invalid>  <57015B97.3010401@cygwin.com> <1564992119.20160404020533@yandex.ru>  <57020525.90909@cygwin.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1252
X-IsSubscribed: yes
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id u34BKUO4023330

Greetings, Yaakov Selkowitz!

> On 2016-04-03 18:05, Andrey Repin wrote:
>> Because, within my reach, Cygwin is the only system that not using DASH as
>> /bin/sh. Though, I may try rolling some busybox…

> There *is* a world outside of Debian/Ubuntu;

I have no doubt in that.

> Fedora, RHEL/CentOS, and Arch Linux all use bash for /bin/sh.

I tested on CentOS and FreeBSD, CentOS failed for the aforementiond
reason(bash!), FreeBSD test succeed, but I were unable to obtain exact version
info about used shell. For some reason, /bin/sh doesn't like -V or --version.
But it wasn't dash (not present).

(The simple test was "/bin/sh -c '_test(){ local -; echo 1;}; _test'.")

> However, a simple test in the form of building GCC with dash as /bin/sh, while
> noticeably faster, showed that Debian/Ubuntu have yet to fully upstream
> their work ("gcc/genmultilib: 261: shift: can't shift that many").

Well, what did you expect shifting nonexistent parameters?
POSIX explicitly required[1] that n must not be greater than $#.

> As much as the speed difference is promising (and frankly tempting), I'm 
> afraid we simply don't have the resources to fix everything to work with 
> dash as /bin/sh.

If you want to blame anything, blame your GCC build script.

P.S.
The same place[2] answered my original question. It doesn't look like "local"
is at all defined by POSIX, so using it with /bin/sh scripts is always a risk.

[1] http://pubs.opengroup.org/onlinepubs/009696699/utilities/shift.html
[2] http://pubs.opengroup.org/onlinepubs/009696699/idx/sbi.html

-- 
With best regards,
Andrey Repin
Monday, April 4, 2016 13:29:38

Sorry for my terrible english...

