[OE-core] [RFC][PATCH 1/2] packagedata: show error when there are multiple pkgdata directories

Martin Jansa martin.jansa at gmail.com
Wed Apr 3 10:14:33 UTC 2013


* when PACKAGE_ARCH is changed e.g. from MACHINE_ARCH to TUNE_PKGARCH
  get_subpkgedata_fn is still reading old MACHINE_ARCH directory instead of newer with TUNE_PKGARCH
---
 meta/lib/oe/packagedata.py | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oe/packagedata.py b/meta/lib/oe/packagedata.py
index 62fd718..2533700 100644
--- a/meta/lib/oe/packagedata.py
+++ b/meta/lib/oe/packagedata.py
@@ -34,11 +34,18 @@ def get_subpkgedata_fn(pkg, d):
     dirs = all_pkgdatadirs(d)
 
     pkgdata = d.expand('${TMPDIR}/pkgdata/')
+    found = None
     for dir in dirs:
         fn = pkgdata + dir + pkg
         if os.path.exists(fn):
-            return fn
-    return d.expand('${PKGDATA_DIR}/runtime/%s' % pkg)
+	    if found:
+                bb.error("More then one pkgdata dir found for pkg '%s' ('%s', '%s'), returning first" % (pkg, found, fn))
+                continue
+            found = fn
+    if found:
+        return found
+    else:
+        return d.expand('${PKGDATA_DIR}/runtime/%s' % pkg)
 
 def has_subpkgdata(pkg, d):
     return os.access(get_subpkgedata_fn(pkg, d), os.R_OK)
@@ -68,6 +75,7 @@ def read_subpkgdata_dict(pkg, d):
     return ret
 
 def _pkgmap(d):
+    import bb
     """Return a dictionary mapping package to recipe name."""
 
     target_os = d.getVar("TARGET_OS", True)
@@ -85,6 +93,7 @@ def _pkgmap(d):
             continue
 
         for pn in filter(lambda f: not os.path.isdir(os.path.join(pkgdatadir, f)), files):
+            bb.warn("Trying path '%s'" % os.path.join(pkgdatadir, pn))
             try:
                 pkgdata = read_pkgdatafile(os.path.join(pkgdatadir, pn))
             except OSError:
-- 
1.8.1.5





More information about the Openembedded-core mailing list