diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2015-01-07 18:00:42 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-01-29 15:36:52 +0000 |
commit | 3592507a149b668c0a925e176535f7f2002fa543 (patch) | |
tree | 08862c1383532935046c6e81242836dcb1dedade /scripts | |
parent | 62d94a44ae85055b9812aad694f55d483bf0e642 (diff) | |
download | poky-3592507a149b668c0a925e176535f7f2002fa543.tar.gz |
combo-layer: support updating up to arbitrary commit
Support defining the top commit up to which to update. In other words,
this makes it possible to update up to certain point other than the
branch head. The update point (git commitish) is given on the command
line by appending the component name(s) with a colon and the commitish,
e.g.
$ combo-layer update my_component:sha1
Only the "update" action supports this.
(From OE-Core rev: b7ee7cf5bbfd0f305a75e4df9455f9968aa67878)
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/combo-layer | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/scripts/combo-layer b/scripts/combo-layer index 37d1f4712d..851003d855 100755 --- a/scripts/combo-layer +++ b/scripts/combo-layer | |||
@@ -26,6 +26,7 @@ import logging | |||
26 | import subprocess | 26 | import subprocess |
27 | import ConfigParser | 27 | import ConfigParser |
28 | import re | 28 | import re |
29 | from collections import OrderedDict | ||
29 | 30 | ||
30 | __version__ = "0.2.1" | 31 | __version__ = "0.2.1" |
31 | 32 | ||
@@ -347,7 +348,13 @@ def action_update(conf, args): | |||
347 | generate the patch list | 348 | generate the patch list |
348 | apply the generated patches | 349 | apply the generated patches |
349 | """ | 350 | """ |
350 | repos = get_repos(conf, args[1:]) | 351 | components = [arg.split(':')[0] for arg in args[1:]] |
352 | revisions = [] | ||
353 | for arg in args[1:]: | ||
354 | revision= arg.split(':', 1)[1] if ':' in arg else None | ||
355 | revisions.append(revision) | ||
356 | # Map commitishes to repos | ||
357 | repos = OrderedDict(zip(get_repos(conf, components), revisions)) | ||
351 | 358 | ||
352 | # make sure combo repo is clean | 359 | # make sure combo repo is clean |
353 | check_repo_clean(os.getcwd()) | 360 | check_repo_clean(os.getcwd()) |
@@ -361,9 +368,9 @@ def action_update(conf, args): | |||
361 | if conf.nopull: | 368 | if conf.nopull: |
362 | logger.info("Skipping pull (-n)") | 369 | logger.info("Skipping pull (-n)") |
363 | else: | 370 | else: |
364 | action_pull(conf, args) | 371 | action_pull(conf, ['arg0'] + components) |
365 | 372 | ||
366 | for name in repos: | 373 | for name, revision in repos.iteritems(): |
367 | repo = conf.repos[name] | 374 | repo = conf.repos[name] |
368 | ldir = repo['local_repo_dir'] | 375 | ldir = repo['local_repo_dir'] |
369 | dest_dir = repo['dest_dir'] | 376 | dest_dir = repo['dest_dir'] |
@@ -372,18 +379,21 @@ def action_update(conf, args): | |||
372 | 379 | ||
373 | # Step 2: generate the patch list and store to patch dir | 380 | # Step 2: generate the patch list and store to patch dir |
374 | logger.info("Generating patches from %s..." % name) | 381 | logger.info("Generating patches from %s..." % name) |
382 | top_revision = revision or branch | ||
383 | if not check_rev_branch(name, ldir, top_revision, branch): | ||
384 | sys.exit(1) | ||
375 | if dest_dir != ".": | 385 | if dest_dir != ".": |
376 | prefix = "--src-prefix=a/%s/ --dst-prefix=b/%s/" % (dest_dir, dest_dir) | 386 | prefix = "--src-prefix=a/%s/ --dst-prefix=b/%s/" % (dest_dir, dest_dir) |
377 | else: | 387 | else: |
378 | prefix = "" | 388 | prefix = "" |
379 | if repo['last_revision'] == "": | 389 | if repo['last_revision'] == "": |
380 | logger.info("Warning: last_revision of component %s is not set, starting from the first commit" % name) | 390 | logger.info("Warning: last_revision of component %s is not set, starting from the first commit" % name) |
381 | patch_cmd_range = "--root %s" % branch | 391 | patch_cmd_range = "--root %s" % top_revision |
382 | rev_cmd_range = branch | 392 | rev_cmd_range = top_revision |
383 | else: | 393 | else: |
384 | if not check_rev_branch(name, ldir, repo['last_revision'], branch): | 394 | if not check_rev_branch(name, ldir, repo['last_revision'], branch): |
385 | sys.exit(1) | 395 | sys.exit(1) |
386 | patch_cmd_range = "%s..%s" % (repo['last_revision'], branch) | 396 | patch_cmd_range = "%s..%s" % (repo['last_revision'], top_revision) |
387 | rev_cmd_range = patch_cmd_range | 397 | rev_cmd_range = patch_cmd_range |
388 | 398 | ||
389 | file_filter = repo.get('file_filter',"") | 399 | file_filter = repo.get('file_filter',"") |