[klibc] [PATCH] klcc: Remove the need for bash
Ben Hutchings
ben at decadent.org.uk
Sat Jul 25 16:17:25 PDT 2020
On Sat, 2020-07-25 at 10:59 +0200, Olliver Schinagl wrote:
> Currently, in the entire klibc bash is only used to identify the path of
> the perl binary. It is doing so using the bash built-in 'type' function,
> which is POSIX compliant according to [0], but the option -c is not.
>
> By using `command -v` instead, we achieve the same result, in a POSIX
> compliant manor [1], potentially removing the unneeded bash dependency.
>
> 0 https://www.unix.com/man-page/posix/1p/type/
> 1 https://www.unix.com/man-page/posix/1p/command/
>
> Signed-off-by: Olliver Schinagl <oliver at schinagl.nl>
Applied, thanks.
Ben.
> ---
> klcc/Kbuild | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/klcc/Kbuild b/klcc/Kbuild
> index eae753ff..0e625802 100644
> --- a/klcc/Kbuild
> +++ b/klcc/Kbuild
> @@ -35,7 +35,7 @@ targets := $(KLIBCCROSS)klcc
> quiet_cmd_klcc = GEN $@
> cmd_klcc = $(PERL) $< $(srctree)/$(src)/klcc.in \
> $(obj)/$(KLIBCCROSS)klibc.config \
> - $(shell bash -c 'type -p $(PERL)') \
> + $(shell command -v $(PERL)) \
> > $@ || ( rm -f $@ ; exit 1 ) && \
> chmod a+x $@
> $(obj)/$(KLIBCCROSS)klcc: $(src)/makeklcc.pl $(src)/klcc.in \
--
Ben Hutchings
Theory and practice are closer in theory than in practice - John Levine
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <https://lists.zytor.com/archives/klibc/attachments/20200726/529ec79f/attachment.sig>
More information about the klibc
mailing list