diff options
Diffstat (limited to 'scripts/lib')
| -rw-r--r-- | scripts/lib/devtool/upgrade.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py index 4c268af3a7..9ec6648851 100644 --- a/scripts/lib/devtool/upgrade.py +++ b/scripts/lib/devtool/upgrade.py | |||
| @@ -76,19 +76,19 @@ def _rename_recipe_dirs(oldpv, newpv, path): | |||
| 76 | bb.utils.rename(os.path.join(path, oldfile), | 76 | bb.utils.rename(os.path.join(path, oldfile), |
| 77 | os.path.join(path, newfile)) | 77 | os.path.join(path, newfile)) |
| 78 | 78 | ||
| 79 | def _rename_recipe_file(oldrecipe, bpn, oldpv, newpv, path): | 79 | def _rename_recipe_file(oldrecipe, pn, oldpv, newpv, path): |
| 80 | oldrecipe = os.path.basename(oldrecipe) | 80 | oldrecipe = os.path.basename(oldrecipe) |
| 81 | if oldrecipe.endswith('_%s.bb' % oldpv): | 81 | if oldrecipe.endswith('_%s.bb' % oldpv): |
| 82 | newrecipe = '%s_%s.bb' % (bpn, newpv) | 82 | newrecipe = '%s_%s.bb' % (pn, newpv) |
| 83 | if oldrecipe != newrecipe: | 83 | if oldrecipe != newrecipe: |
| 84 | shutil.move(os.path.join(path, oldrecipe), os.path.join(path, newrecipe)) | 84 | shutil.move(os.path.join(path, oldrecipe), os.path.join(path, newrecipe)) |
| 85 | else: | 85 | else: |
| 86 | newrecipe = oldrecipe | 86 | newrecipe = oldrecipe |
| 87 | return os.path.join(path, newrecipe) | 87 | return os.path.join(path, newrecipe) |
| 88 | 88 | ||
| 89 | def _rename_recipe_files(oldrecipe, bpn, oldpv, newpv, path): | 89 | def _rename_recipe_files(oldrecipe, pn, oldpv, newpv, path): |
| 90 | _rename_recipe_dirs(oldpv, newpv, path) | 90 | _rename_recipe_dirs(oldpv, newpv, path) |
| 91 | return _rename_recipe_file(oldrecipe, bpn, oldpv, newpv, path) | 91 | return _rename_recipe_file(oldrecipe, pn, oldpv, newpv, path) |
| 92 | 92 | ||
| 93 | def _write_append(rc, srctreebase, srctree, same_dir, no_same_dir, revs, copied, workspace, d): | 93 | def _write_append(rc, srctreebase, srctree, same_dir, no_same_dir, revs, copied, workspace, d): |
| 94 | """Writes an append file""" | 94 | """Writes an append file""" |
| @@ -335,19 +335,19 @@ def _add_license_diff_to_recipe(path, diff): | |||
| 335 | def _create_new_recipe(newpv, checksums, srcrev, srcbranch, srcsubdir_old, srcsubdir_new, workspace, tinfoil, rd, license_diff, new_licenses, srctree, keep_failure): | 335 | def _create_new_recipe(newpv, checksums, srcrev, srcbranch, srcsubdir_old, srcsubdir_new, workspace, tinfoil, rd, license_diff, new_licenses, srctree, keep_failure): |
| 336 | """Creates the new recipe under workspace""" | 336 | """Creates the new recipe under workspace""" |
| 337 | 337 | ||
| 338 | bpn = rd.getVar('BPN') | 338 | pn = rd.getVar('PN') |
| 339 | path = os.path.join(workspace, 'recipes', bpn) | 339 | path = os.path.join(workspace, 'recipes', pn) |
| 340 | bb.utils.mkdirhier(path) | 340 | bb.utils.mkdirhier(path) |
| 341 | copied, _ = oe.recipeutils.copy_recipe_files(rd, path, all_variants=True) | 341 | copied, _ = oe.recipeutils.copy_recipe_files(rd, path, all_variants=True) |
| 342 | if not copied: | 342 | if not copied: |
| 343 | raise DevtoolError('Internal error - no files were copied for recipe %s' % bpn) | 343 | raise DevtoolError('Internal error - no files were copied for recipe %s' % pn) |
| 344 | logger.debug('Copied %s to %s' % (copied, path)) | 344 | logger.debug('Copied %s to %s' % (copied, path)) |
| 345 | 345 | ||
| 346 | oldpv = rd.getVar('PV') | 346 | oldpv = rd.getVar('PV') |
| 347 | if not newpv: | 347 | if not newpv: |
| 348 | newpv = oldpv | 348 | newpv = oldpv |
| 349 | origpath = rd.getVar('FILE') | 349 | origpath = rd.getVar('FILE') |
| 350 | fullpath = _rename_recipe_files(origpath, bpn, oldpv, newpv, path) | 350 | fullpath = _rename_recipe_files(origpath, pn, oldpv, newpv, path) |
| 351 | logger.debug('Upgraded %s => %s' % (origpath, fullpath)) | 351 | logger.debug('Upgraded %s => %s' % (origpath, fullpath)) |
| 352 | 352 | ||
| 353 | newvalues = {} | 353 | newvalues = {} |
| @@ -610,7 +610,7 @@ def upgrade(args, config, basepath, workspace): | |||
| 610 | license_diff = _generate_license_diff(old_licenses, new_licenses) | 610 | license_diff = _generate_license_diff(old_licenses, new_licenses) |
| 611 | rf, copied = _create_new_recipe(args.version, checksums, args.srcrev, srcbranch, srcsubdir1, srcsubdir2, config.workspace_path, tinfoil, rd, license_diff, new_licenses, srctree, args.keep_failure) | 611 | rf, copied = _create_new_recipe(args.version, checksums, args.srcrev, srcbranch, srcsubdir1, srcsubdir2, config.workspace_path, tinfoil, rd, license_diff, new_licenses, srctree, args.keep_failure) |
| 612 | except (bb.process.CmdError, DevtoolError) as e: | 612 | except (bb.process.CmdError, DevtoolError) as e: |
| 613 | recipedir = os.path.join(config.workspace_path, 'recipes', rd.getVar('BPN')) | 613 | recipedir = os.path.join(config.workspace_path, 'recipes', rd.getVar('PN')) |
| 614 | _upgrade_error(e, recipedir, srctree, args.keep_failure) | 614 | _upgrade_error(e, recipedir, srctree, args.keep_failure) |
| 615 | standard._add_md5(config, pn, os.path.dirname(rf)) | 615 | standard._add_md5(config, pn, os.path.dirname(rf)) |
| 616 | 616 | ||
