($INBOX_DIR/description missing)
 help / color / mirror / Atom feed
From: Ross Burton <ross.burton@arm.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH v2 2/3] selftest/classes: add localpkgfeed class
Date: Tue, 14 May 2024 16:15:20 +0000	[thread overview]
Message-ID: <20240514161521.4082896-2-ross.burton@arm.com> (raw)
In-Reply-To: <20240514161521.4082896-1-ross.burton@arm.com>

This class can be used to construct a subset of a deployed package feed
for use in tests which iterate the deploy directory, and as such a huge
feed of 30K+ packages can result in very slow tests.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta-selftest/classes/localpkgfeed.bbclass | 27 ++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 meta-selftest/classes/localpkgfeed.bbclass

diff --git a/meta-selftest/classes/localpkgfeed.bbclass b/meta-selftest/classes/localpkgfeed.bbclass
new file mode 100644
index 00000000000..b796375e55c
--- /dev/null
+++ b/meta-selftest/classes/localpkgfeed.bbclass
@@ -0,0 +1,27 @@
+# Create a subset of the package feed that just contain the
+# packages depended on by this recipe.
+
+LOCALPKGFEED_DIR = "${WORKDIR}/localpkgfeed"
+
+addtask localpkgfeed after do_build
+do_localpkgfeed[cleandirs] = "${LOCALPKGFEED_DIR}"
+do_localpkgfeed[nostamp] = "1"
+
+def get_packaging_class(d):
+    package_class = d.getVar("PACKAGE_CLASSES").split()[0]
+    return package_class.replace("package_", "")
+
+python () {
+    packaging = get_packaging_class(d)
+    d.setVarFlag("do_localpkgfeed", "rdeptask", "do_package_write_" + packaging)
+}
+
+python do_localpkgfeed() {
+    import oe.package_manager
+
+    packaging = get_packaging_class(d)
+    deploydir = d.getVar("DEPLOY_DIR_" + packaging.upper())
+    task = "package_write_" + packaging
+
+    oe.package_manager.create_packages_dir(d, d.getVar("LOCALPKGFEED_DIR"), deploydir, task, True, True)
+}
-- 
2.34.1



  reply	other threads:[~2024-05-14 16:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-14 16:15 [PATCH v2 1/3] lib/oe/package-manager: allow including self in create_packages_dir Ross Burton
2024-05-14 16:15 ` Ross Burton [this message]
2024-05-14 16:15 ` [PATCH v2 3/3] oeqa/selftest/debuginfod: use localpkgfeed to speed server startup Ross Burton

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=20240514161521.4082896-2-ross.burton@arm.com \
    --to=ross.burton@arm.com \
    --cc=openembedded-core@lists.openembedded.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).