diff options
author | Liam R. Howlett <Liam.Howlett@WindRiver.com> | 2016-08-25 12:34:30 -0400 |
---|---|---|
committer | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-10-18 16:42:15 +1300 |
commit | aaddb1c9a55bfc378f9d189f8707da8546047767 (patch) | |
tree | 22d29132f3f41c7da6e2f2b8891b268a251b2218 | |
parent | 1e2ebe95dab45dfec71e5f3e84705ce4ba973249 (diff) | |
download | openembedded-core-contrib-aaddb1c9a55bfc378f9d189f8707da8546047767.tar.gz |
import_layer: Add --actual-branch option
Allow users to set actual-branch from the command line import of layers.
Signed-off-by: Liam R. Howlett <Liam.Howlett@WindRiver.com>
-rwxr-xr-x | layerindex/tools/import_layer.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/layerindex/tools/import_layer.py b/layerindex/tools/import_layer.py index 0521e1ce75..9b5da22a19 100755 --- a/layerindex/tools/import_layer.py +++ b/layerindex/tools/import_layer.py @@ -200,6 +200,9 @@ def main(): parser.add_option("-q", "--quiet", help = "Hide all output except error messages", action="store_const", const=logging.ERROR, dest="loglevel") + parser.add_option("-a", "--actual-branch", + help = "Set actual branch", + action="store", dest="actual_branch") options, args = parser.parse_args(sys.argv) @@ -273,10 +276,13 @@ def main(): logger.error("Fetch failed: %s" % str(e)) sys.exit(1) - actual_branch = '' + actual_branch = 'master' + if (options.actual_branch): + actual_branch = options.actual_branch try: - out = utils.runcmd("git checkout origin/master", repodir, logger=logger) + out = utils.runcmd("git checkout origin/%s" % actual_branch, repodir, logger=logger) except subprocess.CalledProcessError: + actual_branch = None branches = utils.runcmd("git branch -r", repodir, logger=logger) for line in branches.splitlines(): if 'origin/HEAD ->' in line: |