[2/4] python3: respect package order in manifest

Message ID 20180921114900.26338-2-ross.burton@intel.com
State Accepted
Commit 80dae6218efd25c92b9c43360e0846bb0af56c7e
Headers show
Series
  • [1/4] python3: don't sort the manifest in create_manifest
Related show

Commit Message

Ross Burton Sept. 21, 2018, 11:48 a.m.
Don't sort the manifest when using it to generate packaging rules, so ordering
can be used to have complex packaging rules.

Signed-off-by: Ross Burton <ross.burton@intel.com>

---
 meta/recipes-devtools/python/python3_3.5.6.bb | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

-- 
2.11.0

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Patch

diff --git a/meta/recipes-devtools/python/python3_3.5.6.bb b/meta/recipes-devtools/python/python3_3.5.6.bb
index 605ea6abfe7..6085e36b7db 100644
--- a/meta/recipes-devtools/python/python3_3.5.6.bb
+++ b/meta/recipes-devtools/python/python3_3.5.6.bb
@@ -252,7 +252,7 @@  RPROVIDES_${PN} += "${PN}-modules"
 INCLUDE_PYCS ?= "1"
 
 python(){
-    import json
+    import collections, json
 
     filename = os.path.join(d.getVar('THISDIR'), 'python3', 'python3-manifest.json')
     # This python changes the datastore based on the contents of a file, so mark
@@ -260,7 +260,7 @@  python(){
     bb.parse.mark_dependency(d, filename)
 
     with open(filename) as manifest_file:
-        python_manifest=json.load(manifest_file)
+        python_manifest=json.load(manifest_file, object_pairs_hook=collections.OrderedDict)
 
     include_pycs = d.getVar('INCLUDE_PYCS')
 
@@ -294,8 +294,6 @@  python(){
             d.appendVar('RDEPENDS_' + pypackage, ' ' + pn + '-' + value)
         d.setVar('SUMMARY_' + pypackage, python_manifest[key]['summary'])
 
-    # We need to ensure staticdev packages match for files first so we sort in reverse
-    newpackages.sort(reverse=True)
     # Prepending so to avoid python-misc getting everything
     packages = newpackages + packages
     d.setVar('PACKAGES', ' '.join(packages))