summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe
diff options
context:
space:
mode:
authorJulien Stephan <jstephan@baylibre.com>2023-12-05 15:56:31 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-12-06 22:55:49 +0000
commit165626f7b97d905835337bdde9e30fd54d15cc08 (patch)
treef29067349053883dc45d6cc07d0ba1fe586e834b /meta/lib/oe
parent11d4d437d52af4e2abd103ba372e00d69186c516 (diff)
downloadpoky-165626f7b97d905835337bdde9e30fd54d15cc08.tar.gz
recipeutils: bbappend_recipe: remove old srcuri entry if parameters are different
Currently we do not add a new src_ury entry if the entry already exists AND the parameters are the same. I believe that when an entry already exist with different parameters, we should remove it and add the new entry otherwise we end up with two entries with different parameters (From OE-Core rev: a4628fffcfecb5cd95dc2558dfd39ebd71121eab) 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>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r--meta/lib/oe/recipeutils.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index 1d793693bf..d86873056f 100644
--- a/meta/lib/oe/recipeutils.py
+++ b/meta/lib/oe/recipeutils.py
@@ -776,14 +776,22 @@ def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False,
776 else: 776 else:
777 srcfile = os.path.basename(newfile) 777 srcfile = os.path.basename(newfile)
778 srcurientry = 'file://%s' % srcfile 778 srcurientry = 'file://%s' % srcfile
779 oldentry = None
780 for uri in rd.getVar('SRC_URI').split():
781 if srcurientry in uri:
782 oldentry = uri
779 if params and params[i]: 783 if params and params[i]:
780 srcurientry = '%s;%s' % (srcurientry, ';'.join('%s=%s' % (k,v) for k,v in params[i].items())) 784 srcurientry = '%s;%s' % (srcurientry, ';'.join('%s=%s' % (k,v) for k,v in params[i].items()))
781 # Double-check it's not there already 785 # Double-check it's not there already
782 # FIXME do we care if the entry is added by another bbappend that might go away? 786 # FIXME do we care if the entry is added by another bbappend that might go away?
783 if not srcurientry in rd.getVar('SRC_URI').split(): 787 if not srcurientry in rd.getVar('SRC_URI').split():
784 if machine: 788 if machine:
789 if oldentry:
790 appendline('SRC_URI:remove%s' % appendoverride, '=', ' ' + oldentry)
785 appendline('SRC_URI:append%s' % appendoverride, '=', ' ' + srcurientry) 791 appendline('SRC_URI:append%s' % appendoverride, '=', ' ' + srcurientry)
786 else: 792 else:
793 if oldentry:
794 appendline('SRC_URI:remove', '=', oldentry)
787 appendline('SRC_URI', '+=', srcurientry) 795 appendline('SRC_URI', '+=', srcurientry)
788 param['path'] = srcfile 796 param['path'] = srcfile
789 else: 797 else: