All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Liam R. Howlett" <Liam.Howlett@windriver.com>
To: <yocto@yoctoproject.org>
Cc: paul.eggleton@linux.intel.com
Subject: [layerindex-web][PATCH 01/10] import_layer: Add --actual-branch option
Date: Mon, 26 Sep 2016 14:25:29 -0400	[thread overview]
Message-ID: <1474914338-26310-2-git-send-email-Liam.Howlett@WindRiver.com> (raw)
In-Reply-To: <1474914338-26310-1-git-send-email-Liam.Howlett@WindRiver.com>

Allow users to set actual-branch from the command line import of layers.

Signed-off-by: Liam R. Howlett <Liam.Howlett@WindRiver.com>
---
 layerindex/tools/import_layer.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/layerindex/tools/import_layer.py b/layerindex/tools/import_layer.py
index 0521e1c..9b5da22 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:
-- 
1.9.1



  reply	other threads:[~2016-09-26 18:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-26 18:25 [layerindex-web][PATCH 00/10] Add Distribution, dependency and recommends detection, and import_project Liam R. Howlett
2016-09-26 18:25 ` Liam R. Howlett [this message]
2016-09-26 18:25 ` [layerindex-web][PATCH 02/10] layerindex/tools/import_layer.py: Sanitize layer name Liam R. Howlett
2016-10-03 22:47   ` Paul Eggleton
2016-09-26 18:25 ` [layerindex-web][PATCH 03/10] layerindex/tools/import_layer.py: Avoid failing if there is any layer to add Liam R. Howlett
2016-10-03 22:53   ` Paul Eggleton
2016-09-26 18:25 ` [layerindex-web][PATCH 04/10] layerindex/utils: Update runcmd to decode binary strings to strings Liam R. Howlett
2016-09-26 18:25 ` [layerindex-web][PATCH 05/10] layerindex: Add distribution to web interface and model Liam R. Howlett
2016-10-03 22:59   ` Paul Eggleton
2016-09-26 18:25 ` [layerindex-web][PATCH 06/10] layerindex/tools/import_project: Add import_project Liam R. Howlett
2016-10-03 22:46   ` Paul Eggleton
2016-09-26 18:25 ` [layerindex-web][PATCH 07/10] layerindex: Detect dependencies from layer.conf files Liam R. Howlett
2016-10-03 22:54   ` Paul Eggleton
2016-09-26 18:25 ` [layerindex-web][PATCH 08/10] layerindex: Add collection and version to layerbranch Liam R. Howlett
2016-09-27 20:53   ` Mark Hatle
2016-10-03 22:54   ` Paul Eggleton
2016-10-04 13:51     ` Liam R. Howlett
2016-09-26 18:25 ` [layerindex-web][PATCH 09/10] layerindexer: Add layer recommends support Liam R. Howlett
2016-09-26 18:25 ` [layerindex-web][PATCH 10/10] recipeparse: remove unnecessary else statement Liam R. Howlett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1474914338-26310-2-git-send-email-Liam.Howlett@WindRiver.com \
    --to=liam.howlett@windriver.com \
    --cc=paul.eggleton@linux.intel.com \
    --cc=yocto@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.