diff options
Diffstat (limited to 'scripts/combo-layer')
-rwxr-xr-x | scripts/combo-layer | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/combo-layer b/scripts/combo-layer index 65435db8c0..3baea24dee 100755 --- a/scripts/combo-layer +++ b/scripts/combo-layer | |||
@@ -183,6 +183,9 @@ def action_init(conf, args): | |||
183 | lastrev = repo.get('last_revision', None) | 183 | lastrev = repo.get('last_revision', None) |
184 | if lastrev and lastrev != "HEAD": | 184 | if lastrev and lastrev != "HEAD": |
185 | initialrev = lastrev | 185 | initialrev = lastrev |
186 | if branch: | ||
187 | if not check_rev_branch(name, ldir, lastrev, branch): | ||
188 | sys.exit(1) | ||
186 | logger.info("Copying data from %s at specified revision %s..." % (name, lastrev)) | 189 | logger.info("Copying data from %s at specified revision %s..." % (name, lastrev)) |
187 | else: | 190 | else: |
188 | lastrev = None | 191 | lastrev = None |
@@ -278,7 +281,7 @@ def drop_to_shell(workdir=None): | |||
278 | else: | 281 | else: |
279 | return True | 282 | return True |
280 | 283 | ||
281 | def check_rev_branch(repodir, rev, branch): | 284 | def check_rev_branch(component, repodir, rev, branch): |
282 | try: | 285 | try: |
283 | actualbranch = runcmd("git branch --contains %s" % rev, repodir, printerr=False).rstrip() | 286 | actualbranch = runcmd("git branch --contains %s" % rev, repodir, printerr=False).rstrip() |
284 | except subprocess.CalledProcessError as e: | 287 | except subprocess.CalledProcessError as e: |
@@ -290,10 +293,10 @@ def check_rev_branch(repodir, rev, branch): | |||
290 | if ' ' in actualbranch: | 293 | if ' ' in actualbranch: |
291 | actualbranch = actualbranch.split(' ')[-1] | 294 | actualbranch = actualbranch.split(' ')[-1] |
292 | if not actualbranch: | 295 | if not actualbranch: |
293 | logger.error("Specified revision %s is invalid!" % rev) | 296 | logger.error("%s: specified revision %s is invalid!" % (component, rev)) |
294 | return False | 297 | return False |
295 | elif actualbranch != branch: | 298 | elif actualbranch != branch: |
296 | logger.error("Specified revision %s is not on specified branch %s!" % (rev, branch)) | 299 | logger.error("%s: specified revision %s is not on specified branch %s!" % (component, rev, branch)) |
297 | return False | 300 | return False |
298 | return True | 301 | return True |
299 | 302 | ||
@@ -373,7 +376,7 @@ def action_update(conf, args): | |||
373 | patch_cmd_range = "--root %s" % branch | 376 | patch_cmd_range = "--root %s" % branch |
374 | rev_cmd_range = branch | 377 | rev_cmd_range = branch |
375 | else: | 378 | else: |
376 | if not check_rev_branch(ldir, repo['last_revision'], branch): | 379 | if not check_rev_branch(name, ldir, repo['last_revision'], branch): |
377 | sys.exit(1) | 380 | sys.exit(1) |
378 | patch_cmd_range = "%s..%s" % (repo['last_revision'], branch) | 381 | patch_cmd_range = "%s..%s" % (repo['last_revision'], branch) |
379 | rev_cmd_range = patch_cmd_range | 382 | rev_cmd_range = patch_cmd_range |