diff options
author | Tristan Maat <tristan.maat@codethink.com> | 2017-06-21 14:43:43 +0100 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-06-28 14:40:04 +0900 |
commit | a54fcb7ad8c090f45c36f167fe7e09027273e333 (patch) | |
tree | d3349465d51c33ab9002181acf0d1ef261279320 | |
parent | 5dad79d79a6e63e551b8c8c6edb56e6f67607ed9 (diff) | |
download | buildstream-a54fcb7ad8c090f45c36f167fe7e09027273e333.tar.gz |
main.py: Add source-bundle command
-rwxr-xr-x | buildstream/_frontend/main.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/buildstream/_frontend/main.py b/buildstream/_frontend/main.py index dfcc13bec..e41f21bac 100755 --- a/buildstream/_frontend/main.py +++ b/buildstream/_frontend/main.py @@ -364,6 +364,45 @@ def checkout(app, target, arch, variant, directory, force): ################################################################## +# Source Bundle Command # +################################################################## +@cli.command(name="source-bundle", short_help="Produce a build bundle to be manually executed") +@click.option('--except', 'except_', multiple=True, + help="Elements to except from the tarball") +@click.option('--compression', default='gz', + type=click.Choice(['none', 'gz', 'bz2', 'xz']), + help="Compress the tar file using the given algorithm.") +@click.option('--deps', '-d', default='build', + type=click.Choice(['none', 'plan', 'run', 'build'])) +@click.option('--track', default=False, is_flag=True, + help="Track new source references before building") +@click.option('--arch', '-a', default=host_machine, + help="The target architecture (default: %s)" % host_machine) +@click.option('--variant', + help='A variant of the specified target') +@click.option('--force', '-f', default=False, is_flag=True, + help="Overwrite files existing in checkout directory") +@click.argument('target') +@click.argument('name') +@click.pass_obj +def source_bundle(app, name, target, arch, variant, force, + track, deps, compression, except_): + """Produce a build bundle to be manually executed + """ + app.initialize(target, arch, variant, rewritable=track, inconsistent=track) + try: + dependencies = app.pipeline.deps_elements(deps, except_) + app.print_heading(dependencies) + app.pipeline.source_bundle(app.scheduler, dependencies, force, track, + name, compression, except_) + click.echo("") + except _BstError as e: + click.echo("") + click.echo("ERROR: {}".format(e)) + sys.exit(-1) + + +################################################################## # Main Application State # ################################################################## |