summaryrefslogtreecommitdiffstats
path: root/scripts/combo-layer
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/combo-layer
parent7f880ca20d00ebd20264b588269b98a7c7cec6d6 (diff)
downloadpoky-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/combo-layer')
-rwxr-xr-xscripts/combo-layer31
1 files changed, 23 insertions, 8 deletions
diff --git a/scripts/combo-layer b/scripts/combo-layer
index 0f28cfa375..7457ba2c5d 100755
--- a/scripts/combo-layer
+++ b/scripts/combo-layer
@@ -26,7 +26,7 @@ import logging
26import subprocess 26import subprocess
27import ConfigParser 27import ConfigParser
28 28
29__version__ = "0.2.0" 29__version__ = "0.2.1"
30 30
31def logger_create(): 31def logger_create():
32 logger = logging.getLogger("") 32 logger = logging.getLogger("")
@@ -159,7 +159,22 @@ def action_update(conf, args):
159 patch_dir = "patch-%s" % uuid.uuid4() 159 patch_dir = "patch-%s" % uuid.uuid4()
160 os.mkdir(patch_dir) 160 os.mkdir(patch_dir)
161 161
162 for name in conf.repos: 162 repos = []
163 if len(args) > 1:
164 for arg in args[1:]:
165 if arg.startswith('-'):
166 break
167 else:
168 repos.append(arg)
169 for repo in repos:
170 if not repo in conf.repos:
171 logger.error("Specified component '%s' not found in configuration" % repo)
172 sys.exit(0)
173
174 if not repos:
175 repos = conf.repos
176
177 for name in repos:
163 repo = conf.repos[name] 178 repo = conf.repos[name]
164 ldir = repo['local_repo_dir'] 179 ldir = repo['local_repo_dir']
165 dest_dir = repo['dest_dir'] 180 dest_dir = repo['dest_dir']
@@ -228,7 +243,7 @@ def action_update(conf, args):
228 sys.exit(0) 243 sys.exit(0)
229 244
230 # Step 6: apply the generated and revised patch 245 # Step 6: apply the generated and revised patch
231 action_apply_patch(conf, args) 246 apply_patchlist(conf, repos)
232 runcmd("rm -rf %s" % patch_dir) 247 runcmd("rm -rf %s" % patch_dir)
233 248
234 # Step 7: commit the updated config file if it's being tracked 249 # Step 7: commit the updated config file if it's being tracked
@@ -243,11 +258,11 @@ def action_update(conf, args):
243 if output.lstrip().startswith("M"): 258 if output.lstrip().startswith("M"):
244 runcmd('git commit -m "Automatic commit to update last_revision" %s' % relpath) 259 runcmd('git commit -m "Automatic commit to update last_revision" %s' % relpath)
245 260
246def action_apply_patch(conf, args): 261def apply_patchlist(conf, repos):
247 """ 262 """
248 apply the generated patch list to combo repo 263 apply the generated patch list to combo repo
249 """ 264 """
250 for name in conf.repos: 265 for name in repos:
251 repo = conf.repos[name] 266 repo = conf.repos[name]
252 lastrev = repo["last_revision"] 267 lastrev = repo["last_revision"]
253 for line in open(repo['patchlist']): 268 for line in open(repo['patchlist']):
@@ -327,9 +342,9 @@ def main():
327Create and update a combination layer repository from multiple component repositories. 342Create and update a combination layer repository from multiple component repositories.
328 343
329Action: 344Action:
330 init initialise the combo layer repo 345 init initialise the combo layer repo
331 update get patches from component repos and apply them to the combo repo 346 update [components] get patches from component repos and apply them to the combo repo
332 splitpatch [commit] generate commit patch and split per component, default commit is HEAD""") 347 splitpatch [commit] generate commit patch and split per component, default commit is HEAD""")
333 348
334 parser.add_option("-c", "--conf", help = "specify the config file (conf/combo-layer.conf is the default).", 349 parser.add_option("-c", "--conf", help = "specify the config file (conf/combo-layer.conf is the default).",
335 action = "store", dest = "conffile", default = "conf/combo-layer.conf") 350 action = "store", dest = "conffile", default = "conf/combo-layer.conf")