[adelie-devel] Re: dash as /bin/sh

From: William Pitcock <nenolod_at_dereferenced.org>
Date: Tue, 13 Feb 2018 09:08:36 -0600

Hello,

On Tue, Feb 13, 2018 at 4:53 AM, Horst G. Burkhardt
<horst(a)adelielinux.org> wrote:
> On Mon, 12 Feb 2018 17:38:33 -0600
> "A. Wilcox" <awilfox(a)adelielinux.org> wrote:
>
>> Let me start off by saying abuild, as written upstream, is not falsely
>> advertising anything.
>
> I stand corrected; my only experience with abuild at this point is what
> I've picked up here and there by orbiting Adelie.
>
>> Upstream ships abuild with #!/bin/ash. They require BusyBox shell. I
>> managed to make it work on bash *and* get the patches upstreamed:
>>
>> https://github.com/alpinelinux/abuild/commit/f1faef786
>> https://github.com/alpinelinux/abuild/commit/f39ef92cd
>> https://github.com/alpinelinux/abuild/commit/597a7f167
>>
>> That said, I do not think Alpine's developers had any intention of
>> making a POSIX sh script when they wrote abuild.
>>
>> The line that failed with "bad substitution" is:
>>
>> if [ ! -f
>> "$REPODEST/$repo/${subpkgarch/noarch/$CARCH}/$subpkgname-$pkgver-r$pkgrel.apk"
>> ]; then
>>
>> This is a blatant bashism, but it's supported in BusyBox (and zsh), so
>> there is no harm in using it for them.
>>
>> Additionally, since they require BusyBox, they specifically told me
>> two years ago that making it #!/bin/sh on Adélie was unsupported and
>> that I can keep the pieces when it breaks.
>
> Then it sounds very much like if you've made it work with bash
> reliably, and it uses bashisms that just happen to be supported by
> their implementation of ash, that the sensible choice is indeed to
> make abuild depend on bash specifically.
>
>> Let me remind everyone that Alpine is *upstream*, not *downstream*.
>> They enforce the rules, and we play by them. We aren't the ones who
>> tell them to use POSIX, they're the ones that tell us to use a
>> bash-like.
>
> If they're telling us to use a bash-like, then we should clearly just
> comply and make abuild depend on bash, then :)

Actually, I am interested in fixing the bashism there. abuild is
intended to work with any Almquist shell, but it is true that Alpine
does prefer Busybox ash as it's Almquist shell of choice.
So, patches definitely accepted if somebody wants to work on it.

William
Received on Tue Feb 13 2018 - 15:08:45 UTC

This archive was generated by hypermail 2.4.0 : Sat May 08 2021 - 22:54:40 UTC