summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2012-02-14 13:44:03 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-02-21 17:00:47 +0000
commitc3b3a681f7cc50f02294c6e6a07100c75fbca124 (patch)
treecafa8299f06e94d79ef5efd742c45874263294e9 /scripts
parent7f880ca20d00ebd20264b588269b98a7c7cec6d6 (diff)
downloadast2050-yocto-poky-c3b3a681f7cc50f02294c6e6a07100c75fbca124.zip
ast2050-yocto-poky-c3b3a681f7cc50f02294c6e6a07100c75fbca124.tar.gz
scripts/combo-layer: allow updating a specific component(s) only
If you specify one or more components to update immediately following the "update" command, only these components will be updated as opposed to the default behaviour of updating all of them. (From OE-Core rev: 1779afce024b31edcf846329da705ed5aa9fe63e) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/combo-layer31
1 files changed, 23 insertions, 8 deletions
diff --git a/scripts/combo-layer b/scripts/combo-layer
index 0f28cfa..7457ba2 100755
--- a/scripts/combo-layer
+++ b/scripts/combo-layer
@@ -26,7 +26,7 @@ import logging
import subprocess
import ConfigParser
-__version__ = "0.2.0"
+__version__ = "0.2.1"
def logger_create():
logger = logging.getLogger("")
@@ -159,7 +159,22 @@ def action_update(conf, args):
patch_dir = "patch-%s" % uuid.uuid4()
os.mkdir(patch_dir)
- for name in conf.repos:
+ repos = []
+ if len(args) > 1:
+ for arg in args[1:]:
+ if arg.startswith('-'):
+ break
+ else:
+ repos.append(arg)
+ for repo in repos:
+ if not repo in conf.repos:
+ logger.error("Specified component '%s' not found in configuration" % repo)
+ sys.exit(0)
+
+ if not repos:
+ repos = conf.repos
+
+ for name in repos:
repo = conf.repos[name]
ldir = repo['local_repo_dir']
dest_dir = repo['dest_dir']
@@ -228,7 +243,7 @@ def action_update(conf, args):
sys.exit(0)
# Step 6: apply the generated and revised patch
- action_apply_patch(conf, args)
+ apply_patchlist(conf, repos)
runcmd("rm -rf %s" % patch_dir)
# Step 7: commit the updated config file if it's being tracked
@@ -243,11 +258,11 @@ def action_update(conf, args):
if output.lstrip().startswith("M"):
runcmd('git commit -m "Automatic commit to update last_revision" %s' % relpath)
-def action_apply_patch(conf, args):
+def apply_patchlist(conf, repos):
"""
apply the generated patch list to combo repo
"""
- for name in conf.repos:
+ for name in repos:
repo = conf.repos[name]
lastrev = repo["last_revision"]
for line in open(repo['patchlist']):
@@ -327,9 +342,9 @@ def main():
Create and update a combination layer repository from multiple component repositories.
Action:
- init initialise the combo layer repo
- update get patches from component repos and apply them to the combo repo
- splitpatch [commit] generate commit patch and split per component, default commit is HEAD""")
+ init initialise the combo layer repo
+ update [components] get patches from component repos and apply them to the combo repo
+ splitpatch [commit] generate commit patch and split per component, default commit is HEAD""")
parser.add_option("-c", "--conf", help = "specify the config file (conf/combo-layer.conf is the default).",
action = "store", dest = "conffile", default = "conf/combo-layer.conf")
OpenPOWER on IntegriCloud