diff options
author | Ross Burton <ross.burton@intel.com> | 2018-09-14 12:08:10 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-09-21 08:15:19 -0700 |
commit | 1c67c2146e3644a26367a32885d27a4378f17ac6 (patch) | |
tree | f26fa6982eceebf1516c8f1a68b29b77894a18b0 /meta/recipes-devtools/python/python3/create_manifest3.py | |
parent | 0e94737e7124f689c3697d4227bfcd228cc04295 (diff) | |
download | openembedded-core-1c67c2146e3644a26367a32885d27a4378f17ac6.tar.gz openembedded-core-1c67c2146e3644a26367a32885d27a4378f17ac6.tar.bz2 openembedded-core-1c67c2146e3644a26367a32885d27a4378f17ac6.zip |
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 <ross.burton@intel.com>
Diffstat (limited to 'meta/recipes-devtools/python/python3/create_manifest3.py')
-rw-r--r-- | meta/recipes-devtools/python/python3/create_manifest3.py | 21 |
1 files changed, 10 insertions, 11 deletions
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): |