diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-10-11 12:05:35 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-10-18 12:13:42 +0100 |
commit | 214ad320771608f446b5ef9d1c97c4c370db4d10 (patch) | |
tree | f62d641f505a6544e7bc5e62ba16aa2354cc54c7 | |
parent | 1a57708ba8aa85c66da416554aed5f6748f07cf8 (diff) | |
download | poky-214ad320771608f446b5ef9d1c97c4c370db4d10.tar.gz |
scipts/combo-layer: Fix check_rev_branch() for cases where the revision is on more than one branch
If a revision is in more than one branch, the check_rev_branch() function can't
cope with it and the tool returns incorrect errror messages. This patch
ensures it copes with this situation.
(From OE-Core rev: 14bd101c6a86dd048da98817f47694fb21504209)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-x | scripts/combo-layer | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/combo-layer b/scripts/combo-layer index 3baea24dee..ae97471d6d 100755 --- a/scripts/combo-layer +++ b/scripts/combo-layer | |||
@@ -283,19 +283,23 @@ def drop_to_shell(workdir=None): | |||
283 | 283 | ||
284 | def check_rev_branch(component, repodir, rev, branch): | 284 | def check_rev_branch(component, repodir, rev, branch): |
285 | try: | 285 | try: |
286 | actualbranch = runcmd("git branch --contains %s" % rev, repodir, printerr=False).rstrip() | 286 | actualbranch = runcmd("git branch --contains %s" % rev, repodir, printerr=False) |
287 | except subprocess.CalledProcessError as e: | 287 | except subprocess.CalledProcessError as e: |
288 | if e.returncode == 129: | 288 | if e.returncode == 129: |
289 | actualbranch = "" | 289 | actualbranch = "" |
290 | else: | 290 | else: |
291 | raise | 291 | raise |
292 | 292 | ||
293 | if ' ' in actualbranch: | ||
294 | actualbranch = actualbranch.split(' ')[-1] | ||
295 | if not actualbranch: | 293 | if not actualbranch: |
296 | logger.error("%s: specified revision %s is invalid!" % (component, rev)) | 294 | logger.error("%s: specified revision %s is invalid!" % (component, rev)) |
297 | return False | 295 | return False |
298 | elif actualbranch != branch: | 296 | |
297 | branches = [] | ||
298 | branchlist = actualbranch.split("\n") | ||
299 | for b in branchlist: | ||
300 | branches.append(b.strip().split(' ')[-1]) | ||
301 | |||
302 | if branch not in branches: | ||
299 | logger.error("%s: specified revision %s is not on specified branch %s!" % (component, rev, branch)) | 303 | logger.error("%s: specified revision %s is not on specified branch %s!" % (component, rev, branch)) |
300 | return False | 304 | return False |
301 | return True | 305 | return True |