summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2024-05-14 16:15:20 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-05-15 16:36:46 +0100
commitc5486d6ad32457f09c104d5dd31314bd570912d3 (patch)
tree607375d03ffefc9906ec61bbef212d4bc86456f4
parentaada7fda2b118152d82b1ab295d92b8251afe4ac (diff)
downloadopenembedded-core-c5486d6ad32457f09c104d5dd31314bd570912d3.tar.gz
selftest/classes: add localpkgfeed class
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> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta-selftest/classes/localpkgfeed.bbclass27
1 files changed, 27 insertions, 0 deletions
diff --git a/meta-selftest/classes/localpkgfeed.bbclass b/meta-selftest/classes/localpkgfeed.bbclass
new file mode 100644
index 0000000000..b796375e55
--- /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)
+}