mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] scripts: xz_wrap.sh: clear BCJ only when set
@ 2023-11-06  8:34 Sascha Hauer
  0 siblings, 0 replies; only message in thread
From: Sascha Hauer @ 2023-11-06  8:34 UTC (permalink / raw)
  To: Barebox List

xz_wrap.sh parses the the xz help output to test if the selected BCJ
filter is actually supported. $BCJ might be empty though for some
architectures like Mips, so test the variable for being non-empty before
grepping for the BCJ filter to avoid warnings from grep:

Usage: grep [OPTION]... PATTERNS [FILE]...
Try 'grep --help' for more information.

Fixes: 02898c798d ("scripts: Select XZ --arm64 BCJ filter for 64-bit arm")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 scripts/xz_wrap.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/scripts/xz_wrap.sh b/scripts/xz_wrap.sh
index a6373a7481..02823bc1df 100755
--- a/scripts/xz_wrap.sh
+++ b/scripts/xz_wrap.sh
@@ -25,6 +25,8 @@ if grep -q '^CONFIG_THUMB2_BAREBOX=y$' include/config/auto.conf; then
 fi
 
 # clear BCJ filter if unsupported
-xz -H | grep -q -- $BCJ || BCJ=
+if [ -n "${BCJ}" ]; then
+	xz -H | grep -q -- $BCJ || BCJ=
+fi
 
 exec xz --check=crc32 $BCJ --lzma2=$LZMA2OPTS,dict=32MiB
-- 
2.39.2




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-06  8:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-06  8:34 [PATCH] scripts: xz_wrap.sh: clear BCJ only when set Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox