aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Enedino Hernandez Samaniego <alejandro.enedino.hernandez-samaniego@xilinx.com>2018-09-04 23:45:43 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-09-06 10:36:05 +0100
commitb94af33b5ffdd62617cf69fca4d99e927447740a (patch)
tree363e8e13ba456470c1ac6a2f145e21e380791f1b
parenta6fab3ca81e3dc6ee226840ed7e9f1cd21ecbc2a (diff)
downloadopenembedded-core-contrib-b94af33b5ffdd62617cf69fca4d99e927447740a.tar.gz
python3: Modify create_manifest to make it versionless
This patch improves the create_manifest script by making it use PYTHON_MAJMIN instead of hard coded paths containing the version number when looking at the necessary modules for every package, the script should now be independent of the python(3) version on which were working Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandr@xilinx.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/python/python3/create_manifest3.py10
-rw-r--r--meta/recipes-devtools/python/python3_3.5.5.bb2
2 files changed, 10 insertions, 2 deletions
diff --git a/meta/recipes-devtools/python/python3/create_manifest3.py b/meta/recipes-devtools/python/python3/create_manifest3.py
index 2f944f9b13..41a6bb071a 100644
--- a/meta/recipes-devtools/python/python3/create_manifest3.py
+++ b/meta/recipes-devtools/python/python3/create_manifest3.py
@@ -44,6 +44,9 @@ import subprocess
import json
import os
+# Get python version from ${PYTHON_MAJMIN}
+pyversion = str(sys.argv[1])
+
# Hack to get native python search path (for folders), not fond of it but it works for now
pivot='recipe-sysroot-native'
for p in sys.path:
@@ -62,6 +65,7 @@ hasfolders=[]
allfolders=[]
def isFolder(value):
+ value = value.replace('${PYTHON_MAJMIN}',pyversion)
if os.path.isdir(value.replace('${libdir}',nativelibfolder+'/usr/lib')) or os.path.isdir(value.replace('${libdir}',nativelibfolder+'/usr/lib64')) or os.path.isdir(value.replace('${libdir}',nativelibfolder+'/usr/lib32')):
return True
else:
@@ -85,6 +89,7 @@ print ('Getting dependencies for package: core')
# Special call to check for core package
output = subprocess.check_output([sys.executable, 'get_module_deps3.py', 'python-core-package']).decode('utf8')
for item in output.split():
+ item = item.replace(pyversion,'${PYTHON_MAJMIN}')
# We append it so it doesnt hurt what we currently have:
if isCached(item):
if item not in old_manifest['core']['cached']:
@@ -98,6 +103,7 @@ for item in output.split():
old_manifest['core']['files'].append(item)
for value in old_manifest['core']['files']:
+ value = value.replace(pyversion,'${PYTHON_MAJMIN}')
# Ignore folders, since we don't import those, difficult to handle multilib
if isFolder(value):
# Pass it directly
@@ -131,6 +137,8 @@ for value in old_manifest['core']['files']:
print ('The following dependencies were found for module %s:\n' % value)
print (output)
for item in output.split():
+ item = item.replace(pyversion,'${PYTHON_MAJMIN}')
+
# We append it so it doesnt hurt what we currently have:
if isCached(item):
if item not in old_manifest['core']['cached']:
@@ -250,6 +258,7 @@ for key in old_manifest:
# is folder_string inside path/folder1/folder2/filename?,
# Yes, it works, but we waste a couple of milliseconds.
+ item = item.replace(pyversion,'${PYTHON_MAJMIN}')
inFolders=False
for folder in allfolders:
if folder in item:
@@ -265,7 +274,6 @@ for key in old_manifest:
folderFound = True
if keyfolder not in new_manifest[key]['rdepends'] and keyfolder != key:
new_manifest[key]['rdepends'].append(keyfolder)
-
else:
break
diff --git a/meta/recipes-devtools/python/python3_3.5.5.bb b/meta/recipes-devtools/python/python3_3.5.5.bb
index 8afe15eee6..9e31fa6f29 100644
--- a/meta/recipes-devtools/python/python3_3.5.5.bb
+++ b/meta/recipes-devtools/python/python3_3.5.5.bb
@@ -334,7 +334,7 @@ do_create_manifest() {
cd ${WORKDIR}
# This needs to be executed by python-native and NOT by HOST's python
- nativepython3 create_manifest3.py
+ nativepython3 create_manifest3.py ${PYTHON_MAJMIN}
cp python3-manifest.json.new ${THISDIR}/python3/python3-manifest.json
}