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,
|
def __init__(self, name=None, version=None, tag=None, build_dir=None,
|
||||||
pkg_config=None, global_config=None, user_config=None, dist=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.git_root = find_git_root()
|
||||||
self.rel_eng_dir = os.path.join(self.git_root, "rel-eng")
|
self.rel_eng_dir = os.path.join(self.git_root, "rel-eng")
|
||||||
|
@ -58,6 +59,9 @@ class Builder(object):
|
||||||
self.offline=offline
|
self.offline=offline
|
||||||
self.no_cleanup = False
|
self.no_cleanup = False
|
||||||
self.auto_install = auto_install
|
self.auto_install = auto_install
|
||||||
|
self.rpmbuild_options = rpmbuild_options
|
||||||
|
if not self.rpmbuild_options:
|
||||||
|
self.rpmbuild_options = ''
|
||||||
|
|
||||||
# Override global configurations using local configurations
|
# Override global configurations using local configurations
|
||||||
for section in pkg_config.sections():
|
for section in pkg_config.sections():
|
||||||
|
@ -200,8 +204,9 @@ class Builder(object):
|
||||||
define_dist = "--define 'dist %s'" % dist
|
define_dist = "--define 'dist %s'" % dist
|
||||||
|
|
||||||
cmd = ('rpmbuild --define "_source_filedigest_algorithm md5" --define'
|
cmd = ('rpmbuild --define "_source_filedigest_algorithm md5" --define'
|
||||||
' "_binary_filedigest_algorithm md5" %s %s --nodeps -bs %s' % (
|
' "_binary_filedigest_algorithm md5" %s %s %s --nodeps -bs %s' % (
|
||||||
self._get_rpmbuild_dir_options(), define_dist, self.spec_file))
|
self.rpmbuild_options, self._get_rpmbuild_dir_options(),
|
||||||
|
define_dist, self.spec_file))
|
||||||
output = run_command(cmd)
|
output = run_command(cmd)
|
||||||
print(output)
|
print(output)
|
||||||
self.srpm_location = self._find_wrote_in_rpmbuild_output(output)[0]
|
self.srpm_location = self._find_wrote_in_rpmbuild_output(output)[0]
|
||||||
|
@ -220,9 +225,9 @@ class Builder(object):
|
||||||
if self.dist:
|
if self.dist:
|
||||||
define_dist = "--define 'dist %s'" % self.dist
|
define_dist = "--define 'dist %s'" % self.dist
|
||||||
cmd = ('rpmbuild --define "_source_filedigest_algorithm md5" '
|
cmd = ('rpmbuild --define "_source_filedigest_algorithm md5" '
|
||||||
'--define "_binary_filedigest_algorithm md5" %s %s --clean '
|
'--define "_binary_filedigest_algorithm md5" %s %s %s --clean '
|
||||||
'-ba %s' % (
|
'-ba %s' % (self.rpmbuild_options,
|
||||||
self._get_rpmbuild_dir_options(), define_dist, self.spec_file))
|
self._get_rpmbuild_dir_options(), define_dist, self.spec_file))
|
||||||
output = run_command(cmd)
|
output = run_command(cmd)
|
||||||
print(output)
|
print(output)
|
||||||
files_written = self._find_wrote_in_rpmbuild_output(output)
|
files_written = self._find_wrote_in_rpmbuild_output(output)
|
||||||
|
@ -666,13 +671,15 @@ class NoTgzBuilder(Builder):
|
||||||
|
|
||||||
def __init__(self, name=None, version=None, tag=None, build_dir=None,
|
def __init__(self, name=None, version=None, tag=None, build_dir=None,
|
||||||
pkg_config=None, global_config=None, user_config=None, dist=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,
|
Builder.__init__(self, name=name, version=version, tag=tag,
|
||||||
build_dir=build_dir, pkg_config=pkg_config,
|
build_dir=build_dir, pkg_config=pkg_config,
|
||||||
global_config=global_config, user_config=user_config,
|
global_config=global_config, user_config=user_config,
|
||||||
dist=dist, test=test, offline=offline,
|
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:
|
# When syncing files with CVS, copy everything from git:
|
||||||
self.cvs_copy_extensions = ("", )
|
self.cvs_copy_extensions = ("", )
|
||||||
|
@ -734,13 +741,14 @@ class CvsBuilder(NoTgzBuilder):
|
||||||
|
|
||||||
def __init__(self, name=None, version=None, tag=None, build_dir=None,
|
def __init__(self, name=None, version=None, tag=None, build_dir=None,
|
||||||
pkg_config=None, global_config=None, user_config=None, dist=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,
|
NoTgzBuilder.__init__(self, name=name, version=version, tag=tag,
|
||||||
build_dir=build_dir, pkg_config=pkg_config,
|
build_dir=build_dir, pkg_config=pkg_config,
|
||||||
global_config=global_config, user_config=user_config,
|
global_config=global_config, user_config=user_config,
|
||||||
dist=dist, test=test, offline=offline,
|
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
|
# TODO: Hack to override here, patches are in a weird place with this
|
||||||
# builder.
|
# builder.
|
||||||
|
@ -842,13 +850,14 @@ class UpstreamBuilder(NoTgzBuilder):
|
||||||
|
|
||||||
def __init__(self, name=None, version=None, tag=None, build_dir=None,
|
def __init__(self, name=None, version=None, tag=None, build_dir=None,
|
||||||
pkg_config=None, global_config=None, user_config=None, dist=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,
|
NoTgzBuilder.__init__(self, name=name, version=version, tag=tag,
|
||||||
build_dir=build_dir, pkg_config=pkg_config,
|
build_dir=build_dir, pkg_config=pkg_config,
|
||||||
global_config=global_config, user_config=user_config,
|
global_config=global_config, user_config=user_config,
|
||||||
dist=dist, test=test, offline=offline,
|
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",
|
if not pkg_config or not pkg_config.has_option("buildconfig",
|
||||||
"upstream_name"):
|
"upstream_name"):
|
||||||
|
|
|
@ -351,6 +351,10 @@ class BuildModule(BaseCliModule):
|
||||||
"(i.e. runs 'make new-sources') Must be "
|
"(i.e. runs 'make new-sources') Must be "
|
||||||
"used until 'sources' file is committed to CVS."))
|
"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):
|
def main(self, argv):
|
||||||
BaseCliModule.main(self, argv)
|
BaseCliModule.main(self, argv)
|
||||||
|
|
||||||
|
@ -409,7 +413,8 @@ class BuildModule(BaseCliModule):
|
||||||
dist=options.dist,
|
dist=options.dist,
|
||||||
test=options.test,
|
test=options.test,
|
||||||
offline=options.offline,
|
offline=options.offline,
|
||||||
auto_install=options.auto_install)
|
auto_install=options.auto_install,
|
||||||
|
rpmbuild_options=options.rpmbuild_options)
|
||||||
return builder
|
return builder
|
||||||
|
|
||||||
def _validate_options(self):
|
def _validate_options(self):
|
||||||
|
|
Loading…
Add table
Reference in a new issue