From 1c67c2146e3644a26367a32885d27a4378f17ac6 Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Fri, 14 Sep 2018 12:08:10 +0100 Subject: python3: don't sort the manifest in create_manifest Instead of sorting the entire manifest when it is updated, use OrderedDict to preserve the order of fields. This means that packages can be ordered in the manifest to allow non-trivial FILES assignments (such as a package that picks up pieces of other packages) The manifest has been regenerated with the new stable ordering, and distutils-staticdev moved above distutils so the packaging rules work as expected. Signed-off-by: Ross Burton --- .../python/python3/create_manifest3.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'meta/recipes-devtools/python/python3/create_manifest3.py') diff --git a/meta/recipes-devtools/python/python3/create_manifest3.py b/meta/recipes-devtools/python/python3/create_manifest3.py index 2db5e3b0b6..efef62af94 100644 --- a/meta/recipes-devtools/python/python3/create_manifest3.py +++ b/meta/recipes-devtools/python/python3/create_manifest3.py @@ -43,6 +43,7 @@ import sys import subprocess import json import os +import collections # Get python version from ${PYTHON_MAJMIN} pyversion = str(sys.argv[1]) @@ -54,7 +55,7 @@ for p in sys.path: nativelibfolder = p[:p.find(pivot)+len(pivot)] # Empty dict to hold the whole manifest -new_manifest = {} +new_manifest = collections.OrderedDict() # Check for repeated files, folders and wildcards allfiles = [] @@ -79,7 +80,7 @@ def isCached(item): # Read existing JSON manifest with open('python3-manifest.json') as manifest: - old_manifest = json.load(manifest) + old_manifest = json.load(manifest, object_pairs_hook=collections.OrderedDict) # # First pass to get core-package functionality, because we base everything on the fact that core is actually working @@ -195,18 +196,16 @@ for pypkg in old_manifest: for pypkg in old_manifest: # Use an empty dict as data structure to hold data for each package and fill it up - new_manifest[pypkg] = {} - new_manifest[pypkg]['files'] = [] + new_manifest[pypkg] = collections.OrderedDict() + new_manifest[pypkg]['summary'] = old_manifest[pypkg]['summary'] new_manifest[pypkg]['rdepends'] = [] + new_manifest[pypkg]['files'] = [] + new_manifest[pypkg]['cached'] = old_manifest[pypkg]['cached'] # All packages should depend on core if pypkg != 'core': - new_manifest[pypkg]['rdepends'].append('core') - new_manifest[pypkg]['cached'] = [] - else: - new_manifest[pypkg]['cached'] = old_manifest[pypkg]['cached'] - new_manifest[pypkg]['summary'] = old_manifest[pypkg]['summary'] - + new_manifest[pypkg]['rdepends'].append('core') + new_manifest[pypkg]['cached'] = [] print('\n') print('--------------------------') @@ -400,7 +399,7 @@ for pypkg in new_manifest: # Create the manifest from the data structure that was built with open('python3-manifest.json.new','w') as outfile: - json.dump(new_manifest,outfile,sort_keys=True, indent=4) + json.dump(new_manifest,outfile, indent=4) outfile.write('\n') if (repeated): -- cgit v1.2.3