mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH] scripts: xz_wrap.sh: clear BCJ only when set
Date: Mon,  6 Nov 2023 09:34:41 +0100	[thread overview]
Message-ID: <20231106083441.483523-1-s.hauer@pengutronix.de> (raw)

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




                 reply	other threads:[~2023-11-06  8:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231106083441.483523-1-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox