diff options
Diffstat (limited to 'scripts/combo-layer')
| -rwxr-xr-x | scripts/combo-layer | 31 |
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 | |||
| 26 | import subprocess | 26 | import subprocess |
| 27 | import ConfigParser | 27 | import ConfigParser |
| 28 | 28 | ||
| 29 | __version__ = "0.2.0" | 29 | __version__ = "0.2.1" |
| 30 | 30 | ||
| 31 | def logger_create(): | 31 | def 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 | ||
| 246 | def action_apply_patch(conf, args): | 261 | def 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(): | |||
| 327 | Create and update a combination layer repository from multiple component repositories. | 342 | Create and update a combination layer repository from multiple component repositories. |
| 328 | 343 | ||
| 329 | Action: | 344 | Action: |
| 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") |
