summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-10-11 12:05:35 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-10-18 12:03:26 +0100
commit14bd101c6a86dd048da98817f47694fb21504209 (patch)
tree74679f566b182d8349beb9396e903de37837d987 /scripts
parent01300254d710c91b3dbcded9c42f6dcf21b75462 (diff)
downloadopenembedded-core-14bd101c6a86dd048da98817f47694fb21504209.tar.gz
openembedded-core-14bd101c6a86dd048da98817f47694fb21504209.tar.bz2
openembedded-core-14bd101c6a86dd048da98817f47694fb21504209.zip
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/combo-layer12
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):
def check_rev_branch(component, repodir, rev, branch):
try:
- actualbranch = runcmd("git branch --contains %s" % rev, repodir, printerr=False).rstrip()
+ actualbranch = runcmd("git branch --contains %s" % rev, repodir, printerr=False)
except subprocess.CalledProcessError as e:
if e.returncode == 129:
actualbranch = ""
else:
raise
- if ' ' in actualbranch:
- actualbranch = actualbranch.split(' ')[-1]
if not actualbranch:
logger.error("%s: specified revision %s is invalid!" % (component, rev))
return False
- elif actualbranch != branch:
+
+ branches = []
+ branchlist = actualbranch.split("\n")
+ for b in branchlist:
+ branches.append(b.strip().split(' ')[-1])
+
+ if branch not in branches:
logger.error("%s: specified revision %s is not on specified branch %s!" % (component, rev, branch))
return False
return True