public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] image: Fix evaluation of complex ISAR_RELEASE_CMD values
@ 2020-05-05 16:32 Jan Kiszka
  2020-05-25 14:00 ` Baurzhan Ismagulov
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2020-05-05 16:32 UTC (permalink / raw)
  To: isar-users

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-25 14:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-05 16:32 [PATCH] image: Fix evaluation of complex ISAR_RELEASE_CMD values Jan Kiszka
2020-05-25 14:00 ` Baurzhan Ismagulov

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