From 78991600dde43868bb3e362a014dd81dc8784b5f Mon Sep 17 00:00:00 2001 From: Eric Molitor Date: Sat, 29 Jun 2019 07:52:00 -0500 Subject: Bash Compatibility Patch I know that you are working on toysh which I'm looking forward to. In the meantime below is a patch to improve compatibility with older/odd versions of bash. This fixed a minor build issue I was having on MacOS (which was using zsh in emulated bash mode) as well as an oddball embedded SDK using a non-gnu version of bash. I believe these changes are minimal and should be safe to apply, if not I wanted to at least get them on the mailing list in case others ran into these issues. --- scripts/make.sh | 6 +++--- scripts/portability.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/make.sh b/scripts/make.sh index 6649999e..2a78844d 100755 --- a/scripts/make.sh +++ b/scripts/make.sh @@ -152,7 +152,7 @@ then $KCONFIG_CONFIG > generated/config.h || exit 1 fi -if [ generated/mkflags -ot scripts/mkflags.c ] +if [ ! -f generated/mkflags ] || [ generated/mkflags -ot scripts/mkflags.c ] then do_loudly $HOSTCC scripts/mkflags.c -o generated/mkflags || exit 1 fi @@ -236,7 +236,7 @@ then ) > generated/globals.h fi -if [ generated/mktags -ot scripts/mktags.c ] +if [ ! -f generated/mktags ] || [ generated/mktags -ot scripts/mktags.c ] then do_loudly $HOSTCC scripts/mktags.c -o generated/mktags || exit 1 fi @@ -249,7 +249,7 @@ then toys/*/*.c lib/*.c | generated/mktags > generated/tags.h fi -if [ generated/config2help -ot scripts/config2help.c ] +if [ ! -f generated/config2help ] || [ generated/config2help -ot scripts/config2help.c ] then do_loudly $HOSTCC scripts/config2help.c -o generated/config2help || exit 1 fi diff --git a/scripts/portability.sh b/scripts/portability.sh index abeb31f2..618022c7 100644 --- a/scripts/portability.sh +++ b/scripts/portability.sh @@ -10,5 +10,5 @@ fi if [ -z "$SED" ] then - [ ! -z "$(which gsed 2>/dev/null)" ] && SED=gsed || SED=sed + [ ! -z "$(command -v gsed 2>/dev/null)" ] && SED=gsed || SED=sed fi -- cgit v1.2.3