summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2021-06-22 13:21:08 +0200
committerAnuj Mittal <anuj.mittal@intel.com>2021-06-30 14:00:11 +0800
commita4a5bebcc06637e097f074be9e401aafa8685c38 (patch)
treee4083b725605bab6378fc2557714a6c390b58bdd
parent0fc4e10250e69a67c5250ce48bfc632d90a34097 (diff)
downloadopenembedded-core-contrib-a4a5bebcc06637e097f074be9e401aafa8685c38.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) 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>
-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
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]))
else:
__run('git checkout devtool-patched -b %s' % branch)
- skiptag = False
- try:
- __run('git rebase %s' % rev)
- except bb.process.ExecutionError as e:
- skiptag = True
- if 'conflict' in e.stdout:
- 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()))
- else:
- logger.warning('Command \'%s\' failed:\n%s' % (e.command, e.stdout))
- if not skiptag:
- if uri.startswith('git://') or uri.startswith('gitsm://'):
- suffix = 'new'
- else:
- suffix = newpv
- __run('git tag -f devtool-patched-%s' % suffix)
+ (stdout, _) = __run('git branch --list devtool-override-*')
+ branches_to_rebase = [branch] + stdout.split()
+ for b in branches_to_rebase:
+ logger.info("Rebasing {} onto {}".format(b, rev))
+ __run('git checkout %s' % b)
+ try:
+ __run('git rebase %s' % rev)
+ except bb.process.ExecutionError as e:
+ if 'conflict' in e.stdout:
+ 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()))
+ __run('git rebase --abort')
+ else:
+ logger.warning('Command \'%s\' failed:\n%s' % (e.command, e.stdout))
+ __run('git checkout %s' % branch)
if tmpsrctree:
if keep_temp: