Patchwork lib/oeqa: use the new manifest file for determining if a package is installed

login
register
mail settings
Submitter Stanacar, StefanX
Date Nov. 28, 2013, 1:27 p.m.
Message ID <1385645220-27463-1-git-send-email-stefanx.stanacar@intel.com>
Download mbox | patch
Permalink /patch/62533/
State Accepted
Commit d4398d41be6974d57e834cc9737348ba13e10547
Headers show

Comments

Stanacar, StefanX - Nov. 28, 2013, 1:27 p.m.
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 ]

Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
---
 meta/lib/oeqa/oetest.py | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

Patch

diff --git a/meta/lib/oeqa/oetest.py b/meta/lib/oeqa/oetest.py
index 3bb3589..9566150 100644
--- a/meta/lib/oeqa/oetest.py
+++ b/meta/lib/oeqa/oetest.py
@@ -56,17 +56,11 @@  class oeTest(unittest.TestCase):
 
     @classmethod
     def hasPackage(self, pkg):
-
-        pkgfile = os.path.join(oeTest.tc.d.getVar("WORKDIR", True), "installed_pkgs.txt")
-
-        with open(pkgfile) as f:
-            data = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
-            match = re.search(pkg, data)
-            data.close()
-
-        if match:
+        manifest = os.path.join(oeTest.tc.d.getVar("DEPLOY_DIR_IMAGE", True), oeTest.tc.d.getVar("IMAGE_LINK_NAME", True) + ".manifest")
+        with open(manifest) as f:
+            data = f.read()
+        if re.search(pkg, data):
             return True
-
         return False
 
     @classmethod