aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Enedino Hernandez Samaniego <alejandro.enedino.hernandez-samaniego@xilinx.com>2018-04-02 13:08:41 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-04-03 23:53:13 +0100
commit4c2af72f51a7bf187615fc0b3a229d25c3e191e9 (patch)
tree769ad3631ef81df5f24d24f774de7fdaa6a7413f
parentb751e865375b325df4083d85af191da4dc3a27ee (diff)
downloadopenembedded-core-contrib-4c2af72f51a7bf187615fc0b3a229d25c3e191e9.tar.gz
python3: Improve logging capabilities for do_create_manifest
Adds a couple of prints to get a nicer log, and creates a small summary or report after checking every module, it makes it more feasible for adoption, easier to debug why a module ended at a certain package and see how the manifest was created. 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.py34
1 files changed, 27 insertions, 7 deletions
diff --git a/meta/recipes-devtools/python/python3/create_manifest3.py b/meta/recipes-devtools/python/python3/create_manifest3.py
index 212ddd434a..44f3454582 100644
--- a/meta/recipes-devtools/python/python3/create_manifest3.py
+++ b/meta/recipes-devtools/python/python3/create_manifest3.py
@@ -80,7 +80,7 @@ with open('python3-manifest.json') as manifest:
# First pass to get core-package functionality, because we base everything on the fact that core is actually working
# Not exactly the same so it should not be a function
-print ('Getting dependencies for core package:')
+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')
@@ -128,6 +128,7 @@ for value in old_manifest['core']['files']:
# Each module will only import what is necessary for it to work in specific
print ('Getting dependencies for module: %s' % value)
output = subprocess.check_output([sys.executable, 'get_module_deps3.py', '%s' % value]).decode('utf8')
+ print ('The following dependencies were found for module %s:\n' % value)
print (output)
for item in output.split():
# We append it so it doesnt hurt what we currently have:
@@ -170,7 +171,10 @@ for key in old_manifest:
# Handle special cases, we assume that when they were manually added
# to the manifest we knew what we were doing.
+ print('\n')
+ print('--------------------------')
print ('Handling package %s' % key)
+ print('--------------------------')
special_packages=['misc', 'modules', 'dev']
if key in special_packages or 'staticdev' in key:
print('Passing %s package directly' % key)
@@ -219,11 +223,16 @@ for key in old_manifest:
# Launch separate task for each module for deterministic behavior
# Each module will only import what is necessary for it to work in specific
- print ('Getting dependencies for module: %s' % value)
+ print ('\nGetting dependencies for module: %s' % value)
output = subprocess.check_output([sys.executable, 'get_module_deps3.py', '%s' % value]).decode('utf8')
# We can print dependencies for debugging purposes
+ print ('The following dependencies were found for module %s:\n' % value)
print (output)
# Output will have all dependencies
+
+ reportFILES = []
+ reportRDEPS = []
+
for item in output.split():
# Warning: This first part is ugly
@@ -255,7 +264,7 @@ for key in old_manifest:
#print('Checking folder %s on package %s' % (item,keyfolder))
for file_folder in old_manifest[keyfolder]['files'] or file_folder in old_manifest[keyfolder]['cached']:
if file_folder==folder:
- print ('%s found in %s' % (folder, keyfolder))
+ print ('%s folder found in %s' % (folder, keyfolder))
folderFound = True
if keyfolder not in new_manifest[key]['rdepends'] and keyfolder != key:
new_manifest[key]['rdepends'].append(keyfolder)
@@ -267,6 +276,7 @@ for key in old_manifest:
if inFolders:
continue
+
# We might already have it on the dictionary since it could depend on a (previously checked) module
if item not in new_manifest[key]['files'] and item not in new_manifest[key]['cached']:
# Handle core as a special package, we already did it so we pass it to NEW data structure directly
@@ -287,6 +297,7 @@ for key in old_manifest:
else:
+
# Check if this dependency is already contained on another package, so we add it
# as an RDEPENDS, or if its not, it means it should be contained on the current
# package, so we should add it to FILES
@@ -298,19 +309,19 @@ for key in old_manifest:
if(newkey!=key):
if newkey not in new_manifest[key]['rdepends']:
# Add it to the new manifest data struct
- # Debug
- print('Adding %s to %s RDEPENDS, because it contains %s' % (newkey, key, item))
+ reportRDEPS.append('Adding %s to %s RDEPENDS, because it contains %s\n' % (newkey, key, item))
new_manifest[key]['rdepends'].append(newkey)
break
else:
# A module shouldn't contain itself (${libdir}/python3/sqlite3 shouldnt be on sqlite3 files)
if os.path.basename(item) != key:
- print('Adding %s to %s FILES' % (item, key))
+ reportFILES.append(('Adding %s to %s FILES\n' % (item, key)))
# Since it wasnt found on another package, its not an RDEP, so add it to FILES for this package
if isCached(item):
new_manifest[key]['cached'].append(item)
else:
new_manifest[key]['files'].append(item)
+
if item.endswith('*'):
wildcards.append(item)
if item not in allfiles:
@@ -318,6 +329,15 @@ for key in old_manifest:
else:
repeated.append(item)
+ print('\n')
+ print('#################################')
+ print('Summary for module %s' % value)
+ print('FILES found for module %s:' % value)
+ print(''.join(reportFILES))
+ print('RDEPENDS found for module %s:' % value)
+ print(''.join(reportRDEPS))
+ print('#################################')
+
print ('The following files are repeated (contained in more than one package), please check which package should get it:')
print (repeated)
print('The following files contain wildcards, please check they are necessary')
@@ -334,4 +354,4 @@ for key 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)
- outfile.write("\n")
+ outfile.write('\n')