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-06-26 11:27:16 +0100
commitc341eea9e914f3df7006a88b726e1714112c27ca (patch)
tree47629495d7ba66fdfd67bce46cab385293932f59 /scripts
parent2834c2f853bd0d988dd1e35d4300005be05f8b19 (diff)
downloadpoky-c341eea9e914f3df7006a88b726e1714112c27ca.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: 588d04748dd89b5371ca9144666e97ec82dd6204) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.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 24e3700ece..c6d98299da 100644
--- a/scripts/lib/devtool/upgrade.py
+++ b/scripts/lib/devtool/upgrade.py
@@ -261,21 +261,20 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, srcbranch, branch, kee
261 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 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]))
262 else: 262 else:
263 __run('git checkout devtool-patched -b %s' % branch) 263 __run('git checkout devtool-patched -b %s' % branch)
264 skiptag = False 264 (stdout, _) = __run('git branch --list devtool-override-*')
265 try: 265 branches_to_rebase = [branch] + stdout.split()
266 __run('git rebase %s' % rev) 266 for b in branches_to_rebase:
267 except bb.process.ExecutionError as e: 267 logger.info("Rebasing {} onto {}".format(b, rev))
268 skiptag = True 268 __run('git checkout %s' % b)
269 if 'conflict' in e.stdout: 269 try:
270 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())) 270 __run('git rebase %s' % rev)
271 else: 271 except bb.process.ExecutionError as e:
272 logger.warning('Command \'%s\' failed:\n%s' % (e.command, e.stdout)) 272 if 'conflict' in e.stdout:
273 if not skiptag: 273 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()))
274 if uri.startswith('git://') or uri.startswith('gitsm://'): 274 __run('git rebase --abort')
275 suffix = 'new' 275 else:
276 else: 276 logger.warning('Command \'%s\' failed:\n%s' % (e.command, e.stdout))
277 suffix = newpv 277 __run('git checkout %s' % branch)
278 __run('git tag -f devtool-patched-%s' % suffix)
279 278
280 if tmpsrctree: 279 if tmpsrctree:
281 if keep_temp: 280 if keep_temp: