mirror of
https://github.com/rpm-software-management/tito.git
synced 2025-02-23 20:22:46 +00:00
Merge branch 'master' into gitpy
This commit is contained in:
commit
c34b53cbb0
2 changed files with 27 additions and 13 deletions
|
@ -43,7 +43,8 @@ class Builder(object):
|
|||
|
||||
def __init__(self, name=None, version=None, tag=None, build_dir=None,
|
||||
pkg_config=None, global_config=None, user_config=None, dist=None,
|
||||
test=False, offline=False, auto_install=False):
|
||||
test=False, offline=False, auto_install=False,
|
||||
rpmbuild_options=None):
|
||||
|
||||
self.git_root = find_git_root()
|
||||
self.rel_eng_dir = os.path.join(self.git_root, "rel-eng")
|
||||
|
@ -58,6 +59,9 @@ class Builder(object):
|
|||
self.offline=offline
|
||||
self.no_cleanup = False
|
||||
self.auto_install = auto_install
|
||||
self.rpmbuild_options = rpmbuild_options
|
||||
if not self.rpmbuild_options:
|
||||
self.rpmbuild_options = ''
|
||||
|
||||
# Override global configurations using local configurations
|
||||
for section in pkg_config.sections():
|
||||
|
@ -200,8 +204,9 @@ class Builder(object):
|
|||
define_dist = "--define 'dist %s'" % dist
|
||||
|
||||
cmd = ('rpmbuild --define "_source_filedigest_algorithm md5" --define'
|
||||
' "_binary_filedigest_algorithm md5" %s %s --nodeps -bs %s' % (
|
||||
self._get_rpmbuild_dir_options(), define_dist, self.spec_file))
|
||||
' "_binary_filedigest_algorithm md5" %s %s %s --nodeps -bs %s' % (
|
||||
self.rpmbuild_options, self._get_rpmbuild_dir_options(),
|
||||
define_dist, self.spec_file))
|
||||
output = run_command(cmd)
|
||||
print(output)
|
||||
self.srpm_location = self._find_wrote_in_rpmbuild_output(output)[0]
|
||||
|
@ -220,8 +225,8 @@ class Builder(object):
|
|||
if self.dist:
|
||||
define_dist = "--define 'dist %s'" % self.dist
|
||||
cmd = ('rpmbuild --define "_source_filedigest_algorithm md5" '
|
||||
'--define "_binary_filedigest_algorithm md5" %s %s --clean '
|
||||
'-ba %s' % (
|
||||
'--define "_binary_filedigest_algorithm md5" %s %s %s --clean '
|
||||
'-ba %s' % (self.rpmbuild_options,
|
||||
self._get_rpmbuild_dir_options(), define_dist, self.spec_file))
|
||||
output = run_command(cmd)
|
||||
print(output)
|
||||
|
@ -666,13 +671,15 @@ class NoTgzBuilder(Builder):
|
|||
|
||||
def __init__(self, name=None, version=None, tag=None, build_dir=None,
|
||||
pkg_config=None, global_config=None, user_config=None, dist=None,
|
||||
test=False, offline=False, auto_install=False):
|
||||
test=False, offline=False, auto_install=False,
|
||||
rpmbuild_options=None):
|
||||
|
||||
Builder.__init__(self, name=name, version=version, tag=tag,
|
||||
build_dir=build_dir, pkg_config=pkg_config,
|
||||
global_config=global_config, user_config=user_config,
|
||||
dist=dist, test=test, offline=offline,
|
||||
auto_install=auto_install)
|
||||
auto_install=auto_install,
|
||||
rpmbuild_options=rpmbuild_options)
|
||||
|
||||
# When syncing files with CVS, copy everything from git:
|
||||
self.cvs_copy_extensions = ("", )
|
||||
|
@ -734,13 +741,14 @@ class CvsBuilder(NoTgzBuilder):
|
|||
|
||||
def __init__(self, name=None, version=None, tag=None, build_dir=None,
|
||||
pkg_config=None, global_config=None, user_config=None, dist=None,
|
||||
test=False, offline=False, auto_install=False):
|
||||
test=False, offline=False, auto_install=False,
|
||||
rpmbuild_options=None):
|
||||
|
||||
NoTgzBuilder.__init__(self, name=name, version=version, tag=tag,
|
||||
build_dir=build_dir, pkg_config=pkg_config,
|
||||
global_config=global_config, user_config=user_config,
|
||||
dist=dist, test=test, offline=offline,
|
||||
auto_install=auto_install)
|
||||
auto_install=auto_install, rpmbuild_options=rpmbuild_options)
|
||||
|
||||
# TODO: Hack to override here, patches are in a weird place with this
|
||||
# builder.
|
||||
|
@ -842,13 +850,14 @@ class UpstreamBuilder(NoTgzBuilder):
|
|||
|
||||
def __init__(self, name=None, version=None, tag=None, build_dir=None,
|
||||
pkg_config=None, global_config=None, user_config=None, dist=None,
|
||||
test=False, offline=False, auto_install=False):
|
||||
test=False, offline=False, auto_install=False,
|
||||
rpmbuild_options=None):
|
||||
|
||||
NoTgzBuilder.__init__(self, name=name, version=version, tag=tag,
|
||||
build_dir=build_dir, pkg_config=pkg_config,
|
||||
global_config=global_config, user_config=user_config,
|
||||
dist=dist, test=test, offline=offline,
|
||||
auto_install=auto_install)
|
||||
auto_install=auto_install, rpmbuild_options=rpmbuild_options)
|
||||
|
||||
if not pkg_config or not pkg_config.has_option("buildconfig",
|
||||
"upstream_name"):
|
||||
|
|
|
@ -351,6 +351,10 @@ class BuildModule(BaseCliModule):
|
|||
"(i.e. runs 'make new-sources') Must be "
|
||||
"used until 'sources' file is committed to CVS."))
|
||||
|
||||
self.parser.add_option("--rpmbuild-options", dest='rpmbuild_options',
|
||||
default='',
|
||||
metavar="OPTIONS", help="Options to pass to rpmbuild.")
|
||||
|
||||
def main(self, argv):
|
||||
BaseCliModule.main(self, argv)
|
||||
|
||||
|
@ -409,7 +413,8 @@ class BuildModule(BaseCliModule):
|
|||
dist=options.dist,
|
||||
test=options.test,
|
||||
offline=options.offline,
|
||||
auto_install=options.auto_install)
|
||||
auto_install=options.auto_install,
|
||||
rpmbuild_options=options.rpmbuild_options)
|
||||
return builder
|
||||
|
||||
def _validate_options(self):
|
||||
|
|
Loading…
Add table
Reference in a new issue