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 18:45:46 -0700 |
commit | 2ac291af1f10230525c331ea61e696fb00f2bc33 (patch) | |
tree | 92fd3d25c46986df7886762b38ead8d1b2ceb5ed /meta/recipes-devtools/python/python3/create_manifest3.py | |
parent | 3c69d1a128ad8e2802453cbad8065784199ec63f (diff) | |
download | poky-2ac291af1f10230525c331ea61e696fb00f2bc33.tar.gz |
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.
(From OE-Core rev: 1c67c2146e3644a26367a32885d27a4378f17ac6)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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 | |||
43 | import subprocess | 43 | import subprocess |
44 | import json | 44 | import json |
45 | import os | 45 | import os |
46 | import collections | ||
46 | 47 | ||
47 | # Get python version from ${PYTHON_MAJMIN} | 48 | # Get python version from ${PYTHON_MAJMIN} |
48 | pyversion = str(sys.argv[1]) | 49 | pyversion = str(sys.argv[1]) |
@@ -54,7 +55,7 @@ for p in sys.path: | |||
54 | nativelibfolder = p[:p.find(pivot)+len(pivot)] | 55 | nativelibfolder = p[:p.find(pivot)+len(pivot)] |
55 | 56 | ||
56 | # Empty dict to hold the whole manifest | 57 | # Empty dict to hold the whole manifest |
57 | new_manifest = {} | 58 | new_manifest = collections.OrderedDict() |
58 | 59 | ||
59 | # Check for repeated files, folders and wildcards | 60 | # Check for repeated files, folders and wildcards |
60 | allfiles = [] | 61 | allfiles = [] |
@@ -79,7 +80,7 @@ def isCached(item): | |||
79 | 80 | ||
80 | # Read existing JSON manifest | 81 | # Read existing JSON manifest |
81 | with open('python3-manifest.json') as manifest: | 82 | with open('python3-manifest.json') as manifest: |
82 | old_manifest = json.load(manifest) | 83 | old_manifest = json.load(manifest, object_pairs_hook=collections.OrderedDict) |
83 | 84 | ||
84 | # | 85 | # |
85 | # First pass to get core-package functionality, because we base everything on the fact that core is actually working | 86 | # 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: | |||
195 | 196 | ||
196 | for pypkg in old_manifest: | 197 | for pypkg in old_manifest: |
197 | # Use an empty dict as data structure to hold data for each package and fill it up | 198 | # Use an empty dict as data structure to hold data for each package and fill it up |
198 | new_manifest[pypkg] = {} | 199 | new_manifest[pypkg] = collections.OrderedDict() |
199 | new_manifest[pypkg]['files'] = [] | 200 | new_manifest[pypkg]['summary'] = old_manifest[pypkg]['summary'] |
200 | new_manifest[pypkg]['rdepends'] = [] | 201 | new_manifest[pypkg]['rdepends'] = [] |
202 | new_manifest[pypkg]['files'] = [] | ||
203 | new_manifest[pypkg]['cached'] = old_manifest[pypkg]['cached'] | ||
201 | 204 | ||
202 | # All packages should depend on core | 205 | # All packages should depend on core |
203 | if pypkg != 'core': | 206 | if pypkg != 'core': |
204 | new_manifest[pypkg]['rdepends'].append('core') | 207 | new_manifest[pypkg]['rdepends'].append('core') |
205 | new_manifest[pypkg]['cached'] = [] | 208 | new_manifest[pypkg]['cached'] = [] |
206 | else: | ||
207 | new_manifest[pypkg]['cached'] = old_manifest[pypkg]['cached'] | ||
208 | new_manifest[pypkg]['summary'] = old_manifest[pypkg]['summary'] | ||
209 | |||
210 | 209 | ||
211 | print('\n') | 210 | print('\n') |
212 | print('--------------------------') | 211 | print('--------------------------') |
@@ -400,7 +399,7 @@ for pypkg in new_manifest: | |||
400 | 399 | ||
401 | # Create the manifest from the data structure that was built | 400 | # Create the manifest from the data structure that was built |
402 | with open('python3-manifest.json.new','w') as outfile: | 401 | with open('python3-manifest.json.new','w') as outfile: |
403 | json.dump(new_manifest,outfile,sort_keys=True, indent=4) | 402 | json.dump(new_manifest,outfile, indent=4) |
404 | outfile.write('\n') | 403 | outfile.write('\n') |
405 | 404 | ||
406 | if (repeated): | 405 | if (repeated): |