public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Subject: [PATCH] image: Fix evaluation of complex ISAR_RELEASE_CMD values
Date: Tue, 5 May 2020 18:32:33 +0200	[thread overview]
Message-ID: <de2cf580-f3c1-4c86-f607-f758f15682c1@siemens.com> (raw)

From: Jan Kiszka <jan.kiszka@siemens.com>

If ISAR_RELEASE_CMD contains a boolean expression make sure to evaluate
it as a whole. So far, "false || true" was incorrectly be detected as
unsuccessful.

This allows to handle failing git version extractions gracefully, e.g.
ISAR_RELEASE_CMD = "git ... describe ... || echo unknown".

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta/classes/image.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 0150f271..a296cc06 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -99,7 +99,7 @@ get_build_id() {
 		       "considered in the build_id. Consider changing" \
 		       "ISAR_RELEASE_CMD."
 	fi
-	if ! ${ISAR_RELEASE_CMD} 2>/dev/null; then
+	if ! ( ${ISAR_RELEASE_CMD} ) 2>/dev/null; then
 		bbwarn "\"${ISAR_RELEASE_CMD}\" failed, returning empty build_id."
 		echo ""
 	fi
-- 
2.26.1

             reply	other threads:[~2020-05-05 16:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-05 16:32 Jan Kiszka [this message]
2020-05-25 14:00 ` Baurzhan Ismagulov

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=de2cf580-f3c1-4c86-f607-f758f15682c1@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=isar-users@googlegroups.com \
    /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