summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDan Dedrick <dan.dedrick@gmail.com>2019-01-21 11:05:02 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-02-25 22:27:39 +0000
commit68934a4beb45b2e734c0cac0ec57b06587ec1cbf (patch)
tree2ddf709f25a2642dc6e47ae2b71da6afdb5ce182 /scripts
parent67e7e1aaab7c7086f8e7730c9ba86bbebfe7add1 (diff)
downloadpoky-68934a4beb45b2e734c0cac0ec57b06587ec1cbf.tar.gz
devtool: remove duplicate overrides
DEVTOOL_EXTRA_OVERRIDES only needs one entry for each instance of overrides. Previous to these changes it would find every override to SRC_URI and add it to the list. This would duplicate instances where SRC_URI is modified multiple times with the same override like: SRC_URI_append_foo += "file://0001-foo.patch" SRC_URI_append_foo += "file://0002-bar.patch" A bbappend might also overwrite a SRC_URI override, which would also cause multiple instances to occur. When there are multiple instances of the same override in DEVTOOL_EXTRA_OVERRIDES it causes devtool modify to fail when creating override branches. The failure occurs when attempting to create the same override branch a second time and looks like this: The stack trace of python calls that resulted in this exception/failure was: File: 'exec_python_func() autogenerated', lineno: 2, function: <module> 0001: *** 0002:devtool_post_patch(d) 0003: File: '/build/poky/meta/classes/devtool-source.bbclass', lineno: 202, function: devtool_post_patch 0198: 0199: for override in extra_override_list: 0200: localdata = bb.data.createCopy(d) 0201: if override in default_overrides: *** 0202: bb.process.run('git branch devtool-override-%s %s' % (override, devbranch), cwd=srcsubdir) 0203: else: 0204: # Reset back to the initial commit on a new branch 0205: bb.process.run('git checkout %s -b devtool-override-%s' % (initial_rev, override), cwd=srcsubdir) 0206: # Run do_patch function with the override applied File: '/build/poky/bitbake/lib/bb/process.py', lineno: 178, function: run 0174: if not stderr is None: 0175: stderr = stderr.decode("utf-8") 0176: 0177: if pipe.returncode != 0: *** 0178: raise ExecutionError(cmd, pipe.returncode, stdout, stderr) 0179: return stdout, stderr Exception: bb.process.ExecutionError: Execution of 'git branch devtool-override-foo devtool' failed with exit code 128: fatal: A branch named 'devtool-override-foo' already exists. (From OE-Core rev: 90f667db2219f04e6d61588cd61056d3d8da6d7d) (From OE-Core rev: 162be3d43f1d48a22b3aed32cc2f593355e5bf81) Signed-off-by: Dan Dedrick <ddedrick@lexmark.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/devtool/standard.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index d14b7a6543..a45ad36812 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -509,6 +509,11 @@ def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, works
509 if not 'flag' in event: 509 if not 'flag' in event:
510 if event['op'].startswith(('_append[', '_prepend[')): 510 if event['op'].startswith(('_append[', '_prepend[')):
511 extra_overrides.append(event['op'].split('[')[1].split(']')[0]) 511 extra_overrides.append(event['op'].split('[')[1].split(']')[0])
512 # We want to remove duplicate overrides. If a recipe had multiple
513 # SRC_URI_override += values it would cause mulitple instances of
514 # overrides. This doesn't play nicely with things like creating a
515 # branch for every instance of DEVTOOL_EXTRA_OVERRIDES.
516 extra_overrides = list(set(extra_overrides))
512 if extra_overrides: 517 if extra_overrides:
513 logger.info('SRC_URI contains some conditional appends/prepends - will create branches to represent these') 518 logger.info('SRC_URI contains some conditional appends/prepends - will create branches to represent these')
514 519