summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Stephan <jstephan@baylibre.com>2024-04-15 21:20:09 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-04-22 22:05:57 +0100
commit68432c657ede5d4a35c9c0eb48a3ad0c92b03c38 (patch)
treeb46b556a59923a9e0194a196c42bd91ba9d41753
parented3d2e881f5bcfed314dbf877822bc4134c93cd9 (diff)
downloadpoky-68432c657ede5d4a35c9c0eb48a3ad0c92b03c38.tar.gz
devtool: standard: update-recipe/finish: fix update localfile in another layer
When trying to use devtool update-recipe/finish on another layer, with modified local file we have the following error: Traceback (most recent call last): File "<..>/poky/scripts/devtool", line 350, in <module> ret = main() ^^^^^^ File "<..>/poky/scripts/devtool", line 337, in main ret = args.func(args, config, basepath, workspace) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<..>/poky/scripts/lib/devtool/standard.py", line 1968, in update_recipe updated, _, _ = _update_recipe(args.recipename, workspace, rd, args.mode, args.append, args.wildcard_version, args.no_remove, args.initial_rev, dry_run_outdir=dry_run_outdir, no_overrides=args.no_overrides, force_patch_refresh=args.force_patch_refresh) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<..>/poky/scripts/lib/devtool/standard.py", line 1930, in _update_recipe updated, appendf, removed = _update_recipe_patch(recipename, workspace, srctree, crd, appendlayerdir, wildcard_version, no_remove, no_report_remove, initial_rev, dry_run_outdir, force_patch_refresh) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<..>/poky/scripts/lib/devtool/standard.py", line 1747, in _update_recipe_patch patchdir = param.get('patchdir', ".") ^^^^^^^^^ AttributeError: 'str' object has no attribute 'get' This was introduced when adding support for git submodules. No selftest case exists to catch this, so a selftest will be added in another commit. (From OE-Core rev: 0ce3f3414499f15133882b197120a3d10b8ef8d0) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--scripts/lib/devtool/standard.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index d0d8cb85a2..bd009f44b1 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -1463,8 +1463,10 @@ def _export_local_files(srctree, rd, destdir, srctreebase):
1463 1. updated - files that already exist in SRCURI 1463 1. updated - files that already exist in SRCURI
1464 2. added - new files files that don't exist in SRCURI 1464 2. added - new files files that don't exist in SRCURI
1465 3 removed - files that exist in SRCURI but not in exported files 1465 3 removed - files that exist in SRCURI but not in exported files
1466 In each dict the key is the 'basepath' of the URI and value is the 1466 In each dict the key is the 'basepath' of the URI and value is:
1467 absolute path to the existing file in recipe space (if any). 1467 - for updated and added dicts, a dict with 1 optionnal key:
1468 - 'path': the absolute path to the existing file in recipe space (if any)
1469 - for removed dict, the absolute path to the existing file in recipe space
1468 """ 1470 """
1469 import oe.recipeutils 1471 import oe.recipeutils
1470 1472
@@ -1546,9 +1548,9 @@ def _export_local_files(srctree, rd, destdir, srctreebase):
1546 origpath = existing_files.pop(fname) 1548 origpath = existing_files.pop(fname)
1547 workpath = os.path.join(local_files_dir, fname) 1549 workpath = os.path.join(local_files_dir, fname)
1548 if not filecmp.cmp(origpath, workpath): 1550 if not filecmp.cmp(origpath, workpath):
1549 updated[fname] = origpath 1551 updated[fname] = {'path' : origpath}
1550 elif fname != '.gitignore': 1552 elif fname != '.gitignore':
1551 added[fname] = None 1553 added[fname] = {}
1552 1554
1553 workdir = rd.getVar('WORKDIR') 1555 workdir = rd.getVar('WORKDIR')
1554 s = rd.getVar('S') 1556 s = rd.getVar('S')
@@ -1565,7 +1567,7 @@ def _export_local_files(srctree, rd, destdir, srctreebase):
1565 if os.path.exists(fpath): 1567 if os.path.exists(fpath):
1566 origpath = existing_files.pop(fname) 1568 origpath = existing_files.pop(fname)
1567 if not filecmp.cmp(origpath, fpath): 1569 if not filecmp.cmp(origpath, fpath):
1568 updated[fpath] = origpath 1570 updated[fpath] = {'path' : origpath}
1569 1571
1570 removed = existing_files 1572 removed = existing_files
1571 return (updated, added, removed) 1573 return (updated, added, removed)
@@ -1651,7 +1653,8 @@ def _update_recipe_srcrev(recipename, workspace, srctree, rd, appendlayerdir, wi
1651 redirect_output=dry_run_outdir) 1653 redirect_output=dry_run_outdir)
1652 else: 1654 else:
1653 files_dir = _determine_files_dir(rd) 1655 files_dir = _determine_files_dir(rd)
1654 for basepath, path in upd_f.items(): 1656 for basepath, param in upd_f.items():
1657 path = param['path']
1655 logger.info('Updating file %s%s' % (basepath, dry_run_suffix)) 1658 logger.info('Updating file %s%s' % (basepath, dry_run_suffix))
1656 if os.path.isabs(basepath): 1659 if os.path.isabs(basepath):
1657 # Original file (probably with subdir pointing inside source tree) 1660 # Original file (probably with subdir pointing inside source tree)
@@ -1661,7 +1664,8 @@ def _update_recipe_srcrev(recipename, workspace, srctree, rd, appendlayerdir, wi
1661 _move_file(os.path.join(local_files_dir, basepath), path, 1664 _move_file(os.path.join(local_files_dir, basepath), path,
1662 dry_run_outdir=dry_run_outdir, base_outdir=recipedir) 1665 dry_run_outdir=dry_run_outdir, base_outdir=recipedir)
1663 update_srcuri= True 1666 update_srcuri= True
1664 for basepath, path in new_f.items(): 1667 for basepath, param in new_f.items():
1668 path = param['path']
1665 logger.info('Adding new file %s%s' % (basepath, dry_run_suffix)) 1669 logger.info('Adding new file %s%s' % (basepath, dry_run_suffix))
1666 _move_file(os.path.join(local_files_dir, basepath), 1670 _move_file(os.path.join(local_files_dir, basepath),
1667 os.path.join(files_dir, basepath), 1671 os.path.join(files_dir, basepath),
@@ -1783,7 +1787,8 @@ def _update_recipe_patch(recipename, workspace, srctree, rd, appendlayerdir, wil
1783 else: 1787 else:
1784 # Update existing files 1788 # Update existing files
1785 files_dir = _determine_files_dir(rd) 1789 files_dir = _determine_files_dir(rd)
1786 for basepath, path in upd_f.items(): 1790 for basepath, param in upd_f.items():
1791 path = param['path']
1787 logger.info('Updating file %s' % basepath) 1792 logger.info('Updating file %s' % basepath)
1788 if os.path.isabs(basepath): 1793 if os.path.isabs(basepath):
1789 # Original file (probably with subdir pointing inside source tree) 1794 # Original file (probably with subdir pointing inside source tree)
@@ -1817,7 +1822,7 @@ def _update_recipe_patch(recipename, workspace, srctree, rd, appendlayerdir, wil
1817 dry_run_outdir=dry_run_outdir, base_outdir=recipedir) 1822 dry_run_outdir=dry_run_outdir, base_outdir=recipedir)
1818 updatefiles = True 1823 updatefiles = True
1819 # Add any new files 1824 # Add any new files
1820 for basepath, path in new_f.items(): 1825 for basepath, param in new_f.items():
1821 logger.info('Adding new file %s%s' % (basepath, dry_run_suffix)) 1826 logger.info('Adding new file %s%s' % (basepath, dry_run_suffix))
1822 _move_file(os.path.join(local_files_dir, basepath), 1827 _move_file(os.path.join(local_files_dir, basepath),
1823 os.path.join(files_dir, basepath), 1828 os.path.join(files_dir, basepath),