[PATCH] Tweaks to build process for embedded scripts
Ron Yorston
rmy at pobox.com
Mon Nov 19 09:43:16 UTC 2018
Denys Vlasenko wrote:
>On Sun, Nov 18, 2018 at 10:06 AM Ron Yorston <rmy at pobox.com> wrote:
>> - Strip leading comments and blank lines from embedded scripts before
>> compressing them. Removing all comments would be nice but is hard.
>
>Well, this last item can mangle scripts. Let's not do this.
What's the concern?
The awk script that removes the lines is:
/^#/ { if (!found) next; }
/^$/ { if (!found) next; }
{ found=1; print; }
It's pretty conservative in what it deletes. As soon as it finds a
line that doesn't match its definition of a comment it copies the
rest of the script verbatim.
It would break scripts that use a shebang line to run a different
interpreter but they aren't supported in this context anyway.
Ron
More information about the busybox
mailing list