[Toybox] [PATCH] Re: Alpine bug.
Isaac Dunham
ibid.ag at gmail.com
Fri Jul 25 06:51:11 PDT 2014
scripts/single.sh: make the sed regex work with musl.
--
This is what I'm using for now; it works, and is as clear as I can make it.
If you'd rather not apply it, it's your project.
On Fri, Jul 25, 2014 at 07:22:23AM -0500, Rob Landley wrote:
> Sorry for the delay answering (and being unable to thread properly),
> the power brick for the machine with my email filters set up on it is
> still in a box so I have to use the gmail web interface. (No idea
> which pile to start looking in: floods are no fun. But hey, the giant
> fans are finally gone. Now we talk to flooring people...)
Flooring! Now I could do that...if I weren't on the opposite side of
the country. OTOH I've only done tile a couple times, years ago.
<snip>
> The guts of singleconfig.sh are fairly straightforward:
>
> export KCONFIG_CONFIG=.singleconfig
>
> make allnoconfig > /dev/null &&
> sed -i -e "s/\(CONFIG_TOYBOX\)=y/# \1 is not set/" \
> -e "s/# CONFIG_\($NAME\|${NAME}_[^ ]*\|TOYBOX_HELP[^ ]*\|TOYBOX_I18N\|TOY
> "$KCONFIG_CONFIG" &&
> make &&
> mv toybox $PREFIX$1
>
> Alas, gmail has horribly wrapped the sed expression here, but it looks
> like it's boiling down to busybox sed regexes supporting "\|" when
> built against glibc or uClibc, but _not_ working when built against
> musl. (I know I've complained at dalias about this before.)
Thanks for figuring out what the issue is.
> I expect the gnu/dammit sed would work even built against musl because
> it implements its own regex engine internally and ignores the libc
> one. (Of course.)
Ah, that's why it worked for me at first. I used ssed, which was apparently
(if the documentation can be trusted on the maintainer) Paolo Bonzini's
temporary fork of gnu sed. ssed is where -i was first added.
> But yeah, known bug in musl that dalias insists is not a bug, which is
> changing busybox behavior. I'll try to patch musl when I get it
> installed the rest of the way in aboriginal and we can just have an
> out of tree patch (same as the #ifdef _musl_ patch).
>
> Rob
Thanks,
Isaac Dunham
-------------- next part --------------
diff --git a/scripts/single.sh b/scripts/single.sh
index e7e42ed..a07770b 100755
--- a/scripts/single.sh
+++ b/scripts/single.sh
@@ -10,10 +10,14 @@ fi
NAME=$(echo $1 | tr a-z- A-Z_)
export KCONFIG_CONFIG=.singleconfig
+USET="is not set"
make allnoconfig > /dev/null &&
-sed -i -e "s/\(CONFIG_TOYBOX\)=y/# \1 is not set/" \
- -e "s/# CONFIG_\($NAME\|${NAME}_[^ ]*\|TOYBOX_HELP[^ ]*\|TOYBOX_I18N\|TOYBOX_FLOAT\) is not set/CONFIG_\1=y/" \
+sed -i -e "s/\(CONFIG_TOYBOX\)=y/# \1 $USET/" \
+ -e "s/# \(CONFIG_$NAME\) $USET/\1=y/" \
+ -e "s/# \(CONFIG_TOYBOX_HELP\) $USET/\1=y/" \
+ -e "s/# \(CONFIG_TOYBOX_I18N\) $USET/\1=y/" \
+ -e "s/# \(CONFIG_TOYBOX_FLOAT\) $USET/\1=y/" \
"$KCONFIG_CONFIG" &&
make &&
mv toybox $PREFIX$1
More information about the Toybox
mailing list