public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Adriaan Schmidt <adriaan.schmidt@siemens.com>
To: isar-users@googlegroups.com
Cc: Adriaan Schmidt <adriaan.schmidt@siemens.com>
Subject: [PATCH v3 10/10] sstate: add caching to debian packages
Date: Tue, 19 Oct 2021 10:29:13 +0200	[thread overview]
Message-ID: <20211019082913.199818-11-adriaan.schmidt@siemens.com> (raw)
In-Reply-To: <20211019082913.199818-1-adriaan.schmidt@siemens.com>

We cache *.deb packages at the end of dpkg_build.

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

diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index 7e372de..eb57e35 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -214,6 +214,31 @@ python do_dpkg_build() {
 
 addtask dpkg_build
 
+SSTATETASKS += "do_dpkg_build"
+DPKG_SSTATE = "${WORKDIR}/dpkg-sstate"
+do_dpkg_build[dirs] += "${DPKG_SSTATE} ${S}/.."
+do_dpkg_build[cleandirs] += "${DPKG_SSTATE}"
+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)" &&
+        ln -f ${S}/../*.deb -t ${DPKG_SSTATE}
+}
+
+dpkg_build_sstate_finalize() {
+    test -n "$(find ${DPKG_SSTATE} -maxdepth 1 -name '*.deb' -print -quit)" &&
+        ln -f ${DPKG_SSTATE}/*.deb -t ${S}/..
+}
+
+python do_dpkg_build_setscene() {
+    sstate_setscene(d)
+    bb.build.exec_func('dpkg_build_sstate_finalize', d)
+}
+
+addtask dpkg_build_setscene
+do_dpkg_build_setscene[dirs] += "${S}/.."
+
 KEEP_INSTALLED_ON_CLEAN ?= "0"
 
 CLEANFUNCS += "deb_clean"
-- 
2.30.2


      parent reply	other threads:[~2021-10-19  8:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-19  8:29 [PATCH v3 00/10] Add sstate-cache Adriaan Schmidt
2021-10-19  8:29 ` [PATCH v3 01/10] oe imports in central location Adriaan Schmidt
2021-10-19  8:29 ` [PATCH v3 02/10] images: create deploy dir Adriaan Schmidt
2021-10-19  8:29 ` [PATCH v3 03/10] rootfs: recursively depend on packages Adriaan Schmidt
2021-10-19  8:29 ` [PATCH v3 04/10] base: remove unneeded "before do_build" task dependencies Adriaan Schmidt
2021-10-19  8:29 ` [PATCH v3 05/10] dpkg: add explicit dependency to isar-apt Adriaan Schmidt
2021-10-19  8:29 ` [PATCH v3 06/10] meta: add sstate feature from oe Adriaan Schmidt
2021-10-19  8:29 ` [PATCH v3 07/10] sstate: configure Adriaan Schmidt
2021-10-19  8:29 ` [PATCH v3 08/10] sstate: add caching to isar-bootstrap Adriaan Schmidt
2021-10-19  8:29 ` [PATCH v3 09/10] sstate: add caching to rootfs Adriaan Schmidt
2021-10-19  8:29 ` Adriaan Schmidt [this message]

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=20211019082913.199818-11-adriaan.schmidt@siemens.com \
    --to=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