]> code.ossystems Code Review - openembedded-core.git/commitdiff
package_manager.py: create index files for all backends in PACKAGE_CLASSES
authorLaurentiu Palcu <laurentiu.palcu@intel.com>
Tue, 25 Feb 2014 12:36:17 +0000 (14:36 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 25 Feb 2014 17:49:55 +0000 (17:49 +0000)
The previous implementation was checking IMAGE_PKGTYPE and created the
index files just for the backend used to create the image. Apparently,
'bitbake package-index' should attempt to create the index files for all
backends specified in PACKAGE_CLASSES.

[YOCTO #5827]

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/package_manager.py

index d29adaca7b94c79f925e557283397c0d8da37044..ff4f1dee0351b342b23af638a80abd2b18f79e7b 100644 (file)
@@ -1519,19 +1519,25 @@ class DpkgPM(PackageManager):
 
 
 def generate_index_files(d):
-    img_type = d.getVar('IMAGE_PKGTYPE', True)
+    classes = d.getVar('PACKAGE_CLASSES', True).replace("package_", "").split()
+
+    indexer_map = {
+        "rpm": (RpmIndexer, d.getVar('DEPLOY_DIR_RPM', True)),
+        "ipk": (OpkgIndexer, d.getVar('DEPLOY_DIR_IPK', True)),
+        "deb": (DpkgIndexer, d.getVar('DEPLOY_DIR_DEB', True))
+    }
 
     result = None
 
-    if img_type == "rpm":
-        result = RpmIndexer(d, d.getVar('DEPLOY_DIR_RPM', True)).write_index()
-    elif img_type == "ipk":
-        result = OpkgIndexer(d, d.getVar('DEPLOY_DIR_IPK', True)).write_index()
-    elif img_type == "deb":
-        result = DpkgIndexer(d, d.getVar('DEPLOY_DIR_DEB', True)).write_index()
+    for pkg_class in classes:
+        if not pkg_class in indexer_map:
+            continue
+
+        if os.path.exists(indexer_map[pkg_class][1]):
+            result = indexer_map[pkg_class][0](d, indexer_map[pkg_class][1]).write_index()
 
-    if result is not None:
-        bb.fatal(result)
+            if result is not None:
+                bb.fatal(result)
 
 if __name__ == "__main__":
     """