This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to install a custom permanent postinstall handler?


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...

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]