diff options
author | Paul Eggleton <paul.eggleton@microsoft.com> | 2022-07-12 18:41:24 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-07-14 23:22:09 +0100 |
commit | da71c928cd0e3dceae47993e7edbf4a35292e5de (patch) | |
tree | fb70dbca92e842b3dc444d73923fefd19240fdf0 /meta/lib/oe | |
parent | 3a2a5847371fe59efd2e430c69f03f3fe4dc873d (diff) | |
download | poky-da71c928cd0e3dceae47993e7edbf4a35292e5de.tar.gz |
devtool: finish: handle patching when S points to subdir of a git repo
If devtool finish needs to create a patch and have it applied to the
sources for a recipe where S points to a subdirectory of the sources,
then the patch needs to be applied at the root of the repo i.e. we need
to add a patchdir= parameter to the SRC_URI entry.
(From OE-Core rev: ad3736d9ca14cac14a7da22c1cfdeda219665e6f)
Signed-off-by: Paul Eggleton <paul.eggleton@microsoft.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r-- | meta/lib/oe/recipeutils.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py index 872ff97b89..b04992c66d 100644 --- a/meta/lib/oe/recipeutils.py +++ b/meta/lib/oe/recipeutils.py | |||
@@ -666,7 +666,7 @@ def get_bbappend_path(d, destlayerdir, wildcardver=False): | |||
666 | return (appendpath, pathok) | 666 | return (appendpath, pathok) |
667 | 667 | ||
668 | 668 | ||
669 | def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False, machine=None, extralines=None, removevalues=None, redirect_output=None): | 669 | def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False, machine=None, extralines=None, removevalues=None, redirect_output=None, params=None): |
670 | """ | 670 | """ |
671 | Writes a bbappend file for a recipe | 671 | Writes a bbappend file for a recipe |
672 | Parameters: | 672 | Parameters: |
@@ -696,6 +696,9 @@ def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False, | |||
696 | redirect_output: | 696 | redirect_output: |
697 | If specified, redirects writing the output file to the | 697 | If specified, redirects writing the output file to the |
698 | specified directory (for dry-run purposes) | 698 | specified directory (for dry-run purposes) |
699 | params: | ||
700 | Parameters to use when adding entries to SRC_URI. If specified, | ||
701 | should be a list of dicts with the same length as srcfiles. | ||
699 | """ | 702 | """ |
700 | 703 | ||
701 | if not removevalues: | 704 | if not removevalues: |
@@ -762,12 +765,14 @@ def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False, | |||
762 | copyfiles = {} | 765 | copyfiles = {} |
763 | if srcfiles: | 766 | if srcfiles: |
764 | instfunclines = [] | 767 | instfunclines = [] |
765 | for newfile, origsrcfile in srcfiles.items(): | 768 | for i, (newfile, origsrcfile) in enumerate(srcfiles.items()): |
766 | srcfile = origsrcfile | 769 | srcfile = origsrcfile |
767 | srcurientry = None | 770 | srcurientry = None |
768 | if not srcfile: | 771 | if not srcfile: |
769 | srcfile = os.path.basename(newfile) | 772 | srcfile = os.path.basename(newfile) |
770 | srcurientry = 'file://%s' % srcfile | 773 | srcurientry = 'file://%s' % srcfile |
774 | if params and params[i]: | ||
775 | srcurientry = '%s;%s' % (srcurientry, ';'.join('%s=%s' % (k,v) for k,v in params[i].items())) | ||
771 | # Double-check it's not there already | 776 | # Double-check it's not there already |
772 | # FIXME do we care if the entry is added by another bbappend that might go away? | 777 | # FIXME do we care if the entry is added by another bbappend that might go away? |
773 | if not srcurientry in rd.getVar('SRC_URI').split(): | 778 | if not srcurientry in rd.getVar('SRC_URI').split(): |