Browse Source

fix(sstate): don't fail if there are no packages

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>
Adriaan Schmidt 3 năm trước cách đây
mục cha
commit
33b5aa65fa
1 tập tin đã thay đổi với 4 bổ sung2 xóa
  1. 4 2
      meta/classes/dpkg-base.bbclass

+ 4 - 2
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() {