public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] fix(sstate): don't fail if there are no packages
@ 2022-01-11  8:02 Adriaan Schmidt
  2022-01-11  9:13 ` Henning Schild
  2022-01-18  7:34 ` Anton Mikanovich
  0 siblings, 2 replies; 6+ messages in thread
From: Adriaan Schmidt @ 2022-01-11  8:02 UTC (permalink / raw)
  To: isar-users; +Cc: Adriaan Schmidt

The code to put generated deb packages into the sstate cache
currently uses the pattern
  test <condition> && do_stuff
which, if the condition is not met, not only skips do_stuff,
but also returns failure.

The consequence is that in cases where there are no packages
found in ${S}/../*.deb, the sstate caching fails completely.

This changes that pattern to use an explicit "if" instead.

Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
---
 meta/classes/dpkg-base.bbclass | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index cb5ce4a..2add0b2 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -222,13 +222,15 @@ do_dpkg_build[sstate-plaindirs] = "${DPKG_SSTATE}"
 do_dpkg_build[sstate-interceptfuncs] = "dpkg_build_sstate_prepare"
 
 dpkg_build_sstate_prepare() {
-    test -n "$(find ${S}/.. -maxdepth 1 -name '*.deb' -print -quit)" &&
+    if [ -n "$(find ${S}/.. -maxdepth 1 -name '*.deb' -print -quit)" ]; then
         ln -f ${S}/../*.deb -t ${DPKG_SSTATE}
+    fi
 }
 
 dpkg_build_sstate_finalize() {
-    test -n "$(find ${DPKG_SSTATE} -maxdepth 1 -name '*.deb' -print -quit)" &&
+    if [ -n "$(find ${DPKG_SSTATE} -maxdepth 1 -name '*.deb' -print -quit)" ]; then
         ln -f ${DPKG_SSTATE}/*.deb -t ${S}/..
+    fi
 }
 
 python do_dpkg_build_setscene() {
-- 
2.30.2


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

end of thread, other threads:[~2022-01-18  7:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-11  8:02 [PATCH] fix(sstate): don't fail if there are no packages Adriaan Schmidt
2022-01-11  9:13 ` Henning Schild
2022-01-11 10:23   ` Schmidt, Adriaan
2022-01-11 10:31     ` Henning Schild
2022-01-11 11:50       ` Schmidt, Adriaan
2022-01-18  7:34 ` Anton Mikanovich

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