This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: How to install a custom permanent postinstall handler?
- From: Andrey Repin <anrdaemon at yandex dot ru>
- To: Yaakov Selkowitz <yselkowitz at cygwin dot com>, cygwin at cygwin dot com
- Date: Mon, 4 Apr 2016 14:10:29 +0300
- Subject: Re: How to install a custom permanent postinstall handler?
- Authentication-results: sourceware.org; auth=none
- References: <838469265 dot 20160401235308 at yandex dot ru> <87a8lcicxg dot fsf at Rainer dot invalid> <5700975A dot 3070002 at cygwin dot com> <87y48vqkfx dot fsf at Rainer dot invalid> <57015B97 dot 3010401 at cygwin dot com> <1564992119 dot 20160404020533 at yandex dot ru> <57020525 dot 90909 at cygwin dot com>
- Reply-to: cygwin at cygwin dot com
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...