summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python/create_manifest2.py
diff options
context:
space:
mode:
authorAndrew Geissler <geissonator@gmail.com>2018-09-19 09:22:27 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-09-21 18:45:46 -0700
commitb0f5feea01646613626fca99b8e632ab712eaca2 (patch)
tree10b9a2cdb66928f5a3c15179bafa1ce749682e27 /meta/recipes-devtools/python/python/create_manifest2.py
parentef753fc7b3a58596403417381abede5193ef2ddd (diff)
downloadopenembedded-core-contrib-b0f5feea01646613626fca99b8e632ab712eaca2.tar.gz
python: 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. This is a backport of the same changes done by Ross Burton for python3 Changes since v1: - Moved distutils-staticdev above distutils so packaging rules work as expected. Changes since v2: - Rebase (From OE-Core rev: 3c62c42ebde9dd4acdc74c56160d6ce8639b497c) Signed-off-by: Andrew Geissler <geissonator@gmail.com> 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/python/create_manifest2.py')
-rw-r--r--meta/recipes-devtools/python/python/create_manifest2.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/meta/recipes-devtools/python/python/create_manifest2.py b/meta/recipes-devtools/python/python/create_manifest2.py
index e7450452ba..1af1443f47 100644
--- a/meta/recipes-devtools/python/python/create_manifest2.py
+++ b/meta/recipes-devtools/python/python/create_manifest2.py
@@ -37,6 +37,7 @@ import sys
import subprocess
import json
import os
+import collections
# Hack to get native python search path (for folders), not fond of it but it works for now
pivot='recipe-sysroot-native'
@@ -45,7 +46,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=[]
@@ -63,7 +64,7 @@ def isFolder(value):
# Read existing JSON manifest
with open('python2-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
@@ -124,13 +125,14 @@ for key in old_manifest:
for key in old_manifest:
# Use an empty dict as data structure to hold data for each package and fill it up
- new_manifest[key]={}
- new_manifest[key]['files']=[]
+ new_manifest[key] = collections.OrderedDict()
+ new_manifest[key]['summary'] = old_manifest[key]['summary']
new_manifest[key]['rdepends']=[]
+ new_manifest[key]['files'] = []
+
# All packages should depend on core
if key != 'core':
- new_manifest[key]['rdepends'].append('core')
- new_manifest[key]['summary']=old_manifest[key]['summary']
+ new_manifest[key]['rdepends'].append('core')
# Handle special cases, we assume that when they were manually added
# to the manifest we knew what we were doing.
@@ -274,4 +276,4 @@ for key in new_manifest:
# Create the manifest from the data structure that was built
with open('python2-manifest.json.new','w') as outfile:
- json.dump(new_manifest,outfile,sort_keys=True, indent=4, separators=(',', ': '))
+ json.dump(new_manifest,outfile, indent=4)