diff options
Diffstat (limited to 'meta/recipes-devtools/python/python3/create_manifest3.py')
| -rw-r--r-- | meta/recipes-devtools/python/python3/create_manifest3.py | 43 |
1 files changed, 28 insertions, 15 deletions
diff --git a/meta/recipes-devtools/python/python3/create_manifest3.py b/meta/recipes-devtools/python/python3/create_manifest3.py index 43e95ce96b..212ddd434a 100644 --- a/meta/recipes-devtools/python/python3/create_manifest3.py +++ b/meta/recipes-devtools/python/python3/create_manifest3.py | |||
| @@ -124,7 +124,6 @@ for value in old_manifest['core']['files']: | |||
| 124 | # Get module name , shouldnt be affected by libdir/bindir | 124 | # Get module name , shouldnt be affected by libdir/bindir |
| 125 | value = os.path.splitext(os.path.basename(os.path.normpath(value)))[0] | 125 | value = os.path.splitext(os.path.basename(os.path.normpath(value)))[0] |
| 126 | 126 | ||
| 127 | |||
| 128 | # Launch separate task for each module for deterministic behavior | 127 | # Launch separate task for each module for deterministic behavior |
| 129 | # Each module will only import what is necessary for it to work in specific | 128 | # Each module will only import what is necessary for it to work in specific |
| 130 | print ('Getting dependencies for module: %s' % value) | 129 | print ('Getting dependencies for module: %s' % value) |
| @@ -203,8 +202,20 @@ for key in old_manifest: | |||
| 203 | if value not in new_manifest[key]['files']: | 202 | if value not in new_manifest[key]['files']: |
| 204 | new_manifest[key]['files'].append(value) | 203 | new_manifest[key]['files'].append(value) |
| 205 | continue | 204 | continue |
| 205 | |||
| 206 | # Get module name , shouldnt be affected by libdir/bindir | 206 | # Get module name , shouldnt be affected by libdir/bindir |
| 207 | value = os.path.splitext(os.path.basename(os.path.normpath(value)))[0] | 207 | # We need to check if the imported module comes from another (e.g. sqlite3.dump) |
| 208 | path,value = os.path.split(value) | ||
| 209 | path = os.path.basename(path) | ||
| 210 | value = os.path.splitext(os.path.basename(value))[0] | ||
| 211 | |||
| 212 | # If this condition is met, it means we need to import it from another module | ||
| 213 | # or its the folder itself (e.g. unittest) | ||
| 214 | if path == key: | ||
| 215 | if value: | ||
| 216 | value = path + '.' + value | ||
| 217 | else: | ||
| 218 | value = path | ||
| 208 | 219 | ||
| 209 | # Launch separate task for each module for deterministic behavior | 220 | # Launch separate task for each module for deterministic behavior |
| 210 | # Each module will only import what is necessary for it to work in specific | 221 | # Each module will only import what is necessary for it to work in specific |
| @@ -292,19 +303,20 @@ for key in old_manifest: | |||
| 292 | new_manifest[key]['rdepends'].append(newkey) | 303 | new_manifest[key]['rdepends'].append(newkey) |
| 293 | break | 304 | break |
| 294 | else: | 305 | else: |
| 295 | # Debug | 306 | # A module shouldn't contain itself (${libdir}/python3/sqlite3 shouldnt be on sqlite3 files) |
| 296 | print('Adding %s to %s FILES' % (item, key)) | 307 | if os.path.basename(item) != key: |
| 297 | # Since it wasnt found on another package, its not an RDEP, so add it to FILES for this package | 308 | print('Adding %s to %s FILES' % (item, key)) |
| 298 | if isCached(item): | 309 | # Since it wasnt found on another package, its not an RDEP, so add it to FILES for this package |
| 299 | new_manifest[key]['cached'].append(item) | 310 | if isCached(item): |
| 300 | else: | 311 | new_manifest[key]['cached'].append(item) |
| 301 | new_manifest[key]['files'].append(item) | 312 | else: |
| 302 | if item.endswith('*'): | 313 | new_manifest[key]['files'].append(item) |
| 303 | wildcards.append(item) | 314 | if item.endswith('*'): |
| 304 | if item not in allfiles: | 315 | wildcards.append(item) |
| 305 | allfiles.append(item) | 316 | if item not in allfiles: |
| 306 | else: | 317 | allfiles.append(item) |
| 307 | repeated.append(item) | 318 | else: |
| 319 | repeated.append(item) | ||
| 308 | 320 | ||
| 309 | print ('The following files are repeated (contained in more than one package), please check which package should get it:') | 321 | print ('The following files are repeated (contained in more than one package), please check which package should get it:') |
| 310 | print (repeated) | 322 | print (repeated) |
| @@ -322,3 +334,4 @@ for key in new_manifest: | |||
| 322 | # Create the manifest from the data structure that was built | 334 | # Create the manifest from the data structure that was built |
| 323 | with open('python3-manifest.json.new','w') as outfile: | 335 | with open('python3-manifest.json.new','w') as outfile: |
| 324 | json.dump(new_manifest,outfile,sort_keys=True, indent=4) | 336 | json.dump(new_manifest,outfile,sort_keys=True, indent=4) |
| 337 | outfile.write("\n") | ||
