diff options
| author | Ross Burton <ross.burton@arm.com> | 2024-05-14 16:15:20 +0000 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2024-05-23 08:55:01 -0700 |
| commit | 86ea22d04788bf1b02f3d599d87b1692688f0410 (patch) | |
| tree | b483b4a6ad4f55edda12dc8c21b4aac917e67775 | |
| parent | 0fe72b1a67b9aebc8f74df950d2dadbbb923d68e (diff) | |
| download | poky-86ea22d04788bf1b02f3d599d87b1692688f0410.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.
(From OE-Core rev: 00e4eb179b6bd4fca2499d997c60889c3d7ff632)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit c5486d6ad32457f09c104d5dd31314bd570912d3)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
| -rw-r--r-- | meta-selftest/classes/localpkgfeed.bbclass | 27 |
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 @@ | |||
| 1 | # Create a subset of the package feed that just contain the | ||
| 2 | # packages depended on by this recipe. | ||
| 3 | |||
| 4 | LOCALPKGFEED_DIR = "${WORKDIR}/localpkgfeed" | ||
| 5 | |||
| 6 | addtask localpkgfeed after do_build | ||
| 7 | do_localpkgfeed[cleandirs] = "${LOCALPKGFEED_DIR}" | ||
| 8 | do_localpkgfeed[nostamp] = "1" | ||
| 9 | |||
| 10 | def get_packaging_class(d): | ||
| 11 | package_class = d.getVar("PACKAGE_CLASSES").split()[0] | ||
| 12 | return package_class.replace("package_", "") | ||
| 13 | |||
| 14 | python () { | ||
| 15 | packaging = get_packaging_class(d) | ||
| 16 | d.setVarFlag("do_localpkgfeed", "rdeptask", "do_package_write_" + packaging) | ||
| 17 | } | ||
| 18 | |||
| 19 | python do_localpkgfeed() { | ||
| 20 | import oe.package_manager | ||
| 21 | |||
| 22 | packaging = get_packaging_class(d) | ||
| 23 | deploydir = d.getVar("DEPLOY_DIR_" + packaging.upper()) | ||
| 24 | task = "package_write_" + packaging | ||
| 25 | |||
| 26 | oe.package_manager.create_packages_dir(d, d.getVar("LOCALPKGFEED_DIR"), deploydir, task, True, True) | ||
| 27 | } | ||
