Rename --builder-arg to just --arg in build command.

This commit is contained in:
Devan Goodwin 2014-01-16 14:52:55 -04:00
parent e1a0017144
commit 922c0f2850
4 changed files with 12 additions and 16 deletions

View file

@ -119,8 +119,8 @@ class KeywordArgSourceStrategy(SourceStrategy):
# Assuming we're still in the start directory, get the absolute path
# to all sources specified:
manual_sources = [os.path.abspath(s) for s in \
self.builder.kwargs['sources']]
# TODO: support passing of multiple sources here.
manual_sources = [self.builder.args['source']]
debug("Got sources: %s" % manual_sources)
# Copy the live spec from our starting location. Unlike most builders,

View file

@ -351,7 +351,7 @@ class BuildModule(BaseCliModule):
help="Override the normal builder by specifying a full class "
"path or one of the pre-configured shortcuts.")
self.parser.add_option("--builder-arg", dest="builder_args",
self.parser.add_option("--arg", dest="builder_args",
action="append",
help="Custom arguments specific to a particular builder."
" (key=value)")
@ -373,12 +373,6 @@ class BuildModule(BaseCliModule):
default='',
metavar="COLLECTION", help="Build package for software collection.")
# TODO: this is specific to the external source builder, implement a way for builders
# to inject additional cli options if they are configured.
self.parser.add_option("--source", dest="sources",
action="append", metavar="SOURCE_FILE",
help="Manually specified source file to be replaced in spec during build.")
def main(self, argv):
BaseCliModule.main(self, argv)
@ -401,7 +395,6 @@ class BuildModule(BaseCliModule):
'auto_install': self.options.auto_install,
'rpmbuild_options': self.options.rpmbuild_options,
'scl': self.options.scl,
'sources': self.options.sources,
}
builder = create_builder(package_name, build_tag,
@ -423,9 +416,9 @@ class BuildModule(BaseCliModule):
On the CLI this is specified with multiple uses of:
--builder-arg key=value
--arg key=value
This method parses any --builder-arg's given and splits the key/value
This method parses any --arg's given and splits the key/value
pairs out into a dict.
"""
args = {}
@ -484,6 +477,10 @@ class ReleaseModule(BaseCliModule):
self.parser.add_option("-s", "--scratch", dest="scratch",
action="store_true",
help="Perform a scratch build in Koji")
self.parser.add_option("--arg", dest="builder_args",
action="append",
help="Custom arguments to pass to the builder."
" (key=value)")
# self.parser.add_option("--list-tags", dest="list_tags",
# action="store_true",

View file

@ -10,8 +10,6 @@
# Red Hat trademarks are not licensed under GPLv2. No permission is
# granted to use or replicate Red Hat trademarks that are incorporated
# in this software or its documentation.
from ConfigParser import NoOptionError
"""
Code for submitting builds for release.
"""

View file

@ -60,7 +60,8 @@ class FetchBuilderTests(TitoGitTestFixture):
# We have not tagged here. Build --rpm should just work:
self.assertFalse(os.path.exists(
os.path.join(self.pkg_dir, 'rel-eng/packages/extsrc')))
tito('build --rpm --output=%s --no-cleanup --source=%s --debug' %
tito('build --rpm --output=%s --no-cleanup --debug --arg=source=%s ' %
(self.output_dir, self.source_filename))
self.assertTrue(os.path.exists(
os.path.join(self.output_dir, 'extsrc-0.0.2-1.fc20.src.rpm')))
@ -69,7 +70,7 @@ class FetchBuilderTests(TitoGitTestFixture):
def test_tag_rejected(self):
self.assertRaises(SystemExit, tito,
'build --tag=extsrc-0.0.1-1 --rpm --output=%s --source=%s' %
'build --tag=extsrc-0.0.1-1 --rpm --output=%s --arg=source=%s ' %
(self.output_dir, self.source_filename))