From: Henning Schild <henning.schild@siemens.com>
To: Adriaan Schmidt <adriaan.schmidt@siemens.com>
Cc: <isar-users@googlegroups.com>
Subject: Re: [PATCH] fix(sstate): don't fail if there are no packages
Date: Tue, 11 Jan 2022 10:13:58 +0100 [thread overview]
Message-ID: <20220111101358.6ab6a30b@md1za8fc.ad001.siemens.net> (raw)
In-Reply-To: <20220111080200.3365264-1-adriaan.schmidt@siemens.com>
Am Tue, 11 Jan 2022 09:02:00 +0100
schrieb Adriaan Schmidt <adriaan.schmidt@siemens.com>:
> 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
I think we can skip the "-print" while at it. And is that hard linking
not problematic when DPKG_SSTATE and S are in different filesystems?
regards,
Henning
> }
>
> 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() {
next prev parent reply other threads:[~2022-01-11 9:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-11 8:02 Adriaan Schmidt
2022-01-11 9:13 ` Henning Schild [this message]
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
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=20220111101358.6ab6a30b@md1za8fc.ad001.siemens.net \
--to=henning.schild@siemens.com \
--cc=adriaan.schmidt@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