diff options
author | Stefan Stanacar <stefanx.stanacar@intel.com> | 2013-11-28 15:27:00 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-12-03 17:45:51 +0000 |
commit | d4398d41be6974d57e834cc9737348ba13e10547 (patch) | |
tree | c4a10dd9f65ad87347119d4656cb6ec919bfe5ad /meta | |
parent | 1611b474b69228597b46590db5fe8532b71147df (diff) | |
download | poky-d4398d41be6974d57e834cc9737348ba13e10547.tar.gz |
lib/oeqa: use the new manifest file for determining if a package is installed
Use the new manifest file instead of ${WORKDIR}/installed_pkgs.txt for determining
if an image has a certain package, because installed_pkgs.txt goes away with rm_work
enabled.
We can't use the IMAGE_MANIFEST var for the file path because that relies on IMAGE_NAME which
changes at every run (because of date), so we use the link which points to the last
one built.
[ YOCTO #5072 ]
(From OE-Core rev: f57c83fc33583c140f668946f3f3e79b960aa9ee)
Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/lib/oeqa/oetest.py | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/meta/lib/oeqa/oetest.py b/meta/lib/oeqa/oetest.py index 3bb3589468..95661506e3 100644 --- a/meta/lib/oeqa/oetest.py +++ b/meta/lib/oeqa/oetest.py | |||
@@ -56,17 +56,11 @@ class oeTest(unittest.TestCase): | |||
56 | 56 | ||
57 | @classmethod | 57 | @classmethod |
58 | def hasPackage(self, pkg): | 58 | def hasPackage(self, pkg): |
59 | 59 | manifest = os.path.join(oeTest.tc.d.getVar("DEPLOY_DIR_IMAGE", True), oeTest.tc.d.getVar("IMAGE_LINK_NAME", True) + ".manifest") | |
60 | pkgfile = os.path.join(oeTest.tc.d.getVar("WORKDIR", True), "installed_pkgs.txt") | 60 | with open(manifest) as f: |
61 | 61 | data = f.read() | |
62 | with open(pkgfile) as f: | 62 | if re.search(pkg, data): |
63 | data = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ) | ||
64 | match = re.search(pkg, data) | ||
65 | data.close() | ||
66 | |||
67 | if match: | ||
68 | return True | 63 | return True |
69 | |||
70 | return False | 64 | return False |
71 | 65 | ||
72 | @classmethod | 66 | @classmethod |