summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-05-24 16:18:51 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-25 07:50:16 +0100
commit93a1c016661567292d52bb8a6d3e77f486f5febd (patch)
tree58d23baf25c3b6342a24ccd3ab7aa0d2cd61e0c1 /scripts
parentab227452c79eda9a30c1461a2b611b2453e0c650 (diff)
downloadpoky-93a1c016661567292d52bb8a6d3e77f486f5febd.tar.gz
devtool: upgrade: tweak conflict handling
Make a couple of changes to the rebase operation: 1) Only wrap the actual rebase command in try...except since a failure in any of the other commands should be an error, not a warning 2) If it's a conflict (which unfortunately we can only tell by checking for the keyword "conflict" since git doesn't return error codes based on the type of error) then print a message clarifying that the user needs to resolve the issue themselves to finish the upgrade. (From OE-Core rev: 2a76be958432a35a0de30e9a5433089a54a06cad) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/devtool/upgrade.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py
index e34234a34f..7e6aa4278a 100644
--- a/scripts/lib/devtool/upgrade.py
+++ b/scripts/lib/devtool/upgrade.py
@@ -236,16 +236,22 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, branch, keep_temp, tin
236 for patch in patches: 236 for patch in patches:
237 logger.warn("%s" % os.path.basename(patch)) 237 logger.warn("%s" % os.path.basename(patch))
238 else: 238 else:
239 __run('git checkout devtool-patched -b %s' % branch)
240 skiptag = False
239 try: 241 try:
240 __run('git checkout devtool-patched -b %s' % branch)
241 __run('git rebase %s' % rev) 242 __run('git rebase %s' % rev)
243 except bb.process.ExecutionError as e:
244 skiptag = True
245 if 'conflict' in e.stdout:
246 logger.warn('Command \'%s\' failed:\n%s\n\nYou will need to resolve conflicts in order to complete the upgrade.' % (e.command, e.stdout.rstrip()))
247 else:
248 logger.warn('Command \'%s\' failed:\n%s' % (e.command, e.stdout))
249 if not skiptag:
242 if uri.startswith('git://'): 250 if uri.startswith('git://'):
243 suffix = 'new' 251 suffix = 'new'
244 else: 252 else:
245 suffix = newpv 253 suffix = newpv
246 __run('git tag -f devtool-patched-%s' % suffix) 254 __run('git tag -f devtool-patched-%s' % suffix)
247 except bb.process.ExecutionError as e:
248 logger.warn('Command \'%s\' failed:\n%s' % (e.command, e.stdout))
249 255
250 if tmpsrctree: 256 if tmpsrctree:
251 if keep_temp: 257 if keep_temp: