summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2021-06-22 13:21:08 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-07-06 13:02:30 +0100
commitf663644c3befe0465af1dac844c8bb9940bc93e7 (patch)
tree66c44ab61d5c8f573313b288f23fec8df644a994 /scripts
parent28a9886ff258334917796a2ced8865a3a506f5bc (diff)
downloadpoky-f663644c3befe0465af1dac844c8bb9940bc93e7.tar.gz
devtool upgrade: rebase override-only patches as well
There's a number of recipes (such as nettle or glib) which were upgraded incorrectly due to rebasing only the default set of patches in main SRC_URI. Native-only or musl-only patches were not handled, causing do_patch fails and overall misery. Unfortunately, this also necessitates aborting any incomplete rebases as devtool needs to be able to return to the original branch to complete the upgrade command. Also, do not add devtool-patched-%version tags, as they are not used anywhere, and it's unclear how to extend them to cover multiple override branches. (From OE-Core rev: 00131cbc969f6a73caffe068fcb983287cbe577f) (From OE-Core rev: a4a5bebcc06637e097f074be9e401aafa8685c38) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit 588d04748dd89b5371ca9144666e97ec82dd6204) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/devtool/upgrade.py29
1 files changed, 14 insertions, 15 deletions
diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py
index 5a057e95f5..4605355681 100644
--- a/scripts/lib/devtool/upgrade.py
+++ b/scripts/lib/devtool/upgrade.py
@@ -260,21 +260,20 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, srcbranch, branch, kee
260 logger.warning('By user choice, the following patches will NOT be applied to the new source tree:\n %s' % '\n '.join([os.path.basename(patch) for patch in patches])) 260 logger.warning('By user choice, the following patches will NOT be applied to the new source tree:\n %s' % '\n '.join([os.path.basename(patch) for patch in patches]))
261 else: 261 else:
262 __run('git checkout devtool-patched -b %s' % branch) 262 __run('git checkout devtool-patched -b %s' % branch)
263 skiptag = False 263 (stdout, _) = __run('git branch --list devtool-override-*')
264 try: 264 branches_to_rebase = [branch] + stdout.split()
265 __run('git rebase %s' % rev) 265 for b in branches_to_rebase:
266 except bb.process.ExecutionError as e: 266 logger.info("Rebasing {} onto {}".format(b, rev))
267 skiptag = True 267 __run('git checkout %s' % b)
268 if 'conflict' in e.stdout: 268 try:
269 logger.warning('Command \'%s\' failed:\n%s\n\nYou will need to resolve conflicts in order to complete the upgrade.' % (e.command, e.stdout.rstrip())) 269 __run('git rebase %s' % rev)
270 else: 270 except bb.process.ExecutionError as e:
271 logger.warning('Command \'%s\' failed:\n%s' % (e.command, e.stdout)) 271 if 'conflict' in e.stdout:
272 if not skiptag: 272 logger.warning('Command \'%s\' failed:\n%s\n\nYou will need to resolve conflicts in order to complete the upgrade.' % (e.command, e.stdout.rstrip()))
273 if uri.startswith('git://') or uri.startswith('gitsm://'): 273 __run('git rebase --abort')
274 suffix = 'new' 274 else:
275 else: 275 logger.warning('Command \'%s\' failed:\n%s' % (e.command, e.stdout))
276 suffix = newpv 276 __run('git checkout %s' % branch)
277 __run('git tag -f devtool-patched-%s' % suffix)
278 277
279 if tmpsrctree: 278 if tmpsrctree:
280 if keep_temp: 279 if keep_temp: