mirror of
https://github.com/rpm-software-management/tito.git
synced 2025-02-23 20:22:46 +00:00
Merge pull request #269 from stevekuznetsov/skuznets/python-26-compat
Iron out Python 2.6 incompatibilities for CentOS 6
This commit is contained in:
commit
26219abfde
4 changed files with 15 additions and 10 deletions
|
@ -232,8 +232,13 @@ class BuilderBase(object):
|
|||
# Assume that if tito's --no-cleanup option is set, also disable %clean in rpmbuild:
|
||||
def _get_clean_option(self):
|
||||
if self.no_cleanup:
|
||||
return "--noclean"
|
||||
return "--clean"
|
||||
output = run_command('rpmbuild --help')
|
||||
if '--noclean' in output:
|
||||
return "--noclean"
|
||||
else:
|
||||
return ""
|
||||
else:
|
||||
return "--clean"
|
||||
|
||||
def _get_verbosity_option(self):
|
||||
if self.verbose:
|
||||
|
@ -247,17 +252,17 @@ class BuilderBase(object):
|
|||
if not self.ran_tgz:
|
||||
self.tgz()
|
||||
|
||||
cmd = 'rpmbuild {}'.format(
|
||||
cmd = 'rpmbuild {0}'.format(
|
||||
" ".join([
|
||||
'--define "_source_filedigest_algorithm md5"',
|
||||
'--define "_binary_filedigest_algorithm md5"',
|
||||
self.rpmbuild_options,
|
||||
self._scl_to_rpmbuild_option(),
|
||||
self._get_rpmbuild_dir_options(),
|
||||
"--define 'dist {}'".format(self.dist) if self.dist else "",
|
||||
"--define 'dist {0}'".format(self.dist) if self.dist else "",
|
||||
self._get_clean_option(),
|
||||
self._get_verbosity_option(),
|
||||
'-ba {}'.format(self.spec_file),
|
||||
'-ba {0}'.format(self.spec_file),
|
||||
])
|
||||
)
|
||||
try:
|
||||
|
@ -468,7 +473,7 @@ class Builder(ConfigObject, BuilderBase):
|
|||
Can be overridden when custom taggers override counterpart,
|
||||
tito.VersionTagger._get_tag_for_version().
|
||||
"""
|
||||
return "{}-{}".format(self.project_name, version)
|
||||
return "{0}-{1}".format(self.project_name, version)
|
||||
|
||||
def tgz(self):
|
||||
"""
|
||||
|
|
|
@ -718,7 +718,7 @@ def munge_setup_macro(fullname, line):
|
|||
if "%autosetup" in macro:
|
||||
args_match = re.search(r'(.+?)\s+-p[01]\s+\S+(.*)', args)
|
||||
if not args_match:
|
||||
macro = "{} -p1".format(macro)
|
||||
macro = "{0} -p1".format(macro)
|
||||
|
||||
return macro
|
||||
return None
|
||||
|
|
|
@ -556,7 +556,7 @@ class VersionTagger(ConfigObject):
|
|||
suffix = ""
|
||||
if self.config.has_option(BUILDCONFIG_SECTION, "tag_suffix"):
|
||||
suffix = self.config.get(BUILDCONFIG_SECTION, "tag_suffix")
|
||||
return "{}{}".format(version, suffix)
|
||||
return "{0}{1}".format(version, suffix)
|
||||
|
||||
def _get_tag_for_version(self, version):
|
||||
"""
|
||||
|
@ -564,7 +564,7 @@ class VersionTagger(ConfigObject):
|
|||
Can be overridden when custom taggers override counterpart,
|
||||
tito.Builder._get_tag_for_version().
|
||||
"""
|
||||
return "{}-{}".format(self.project_name, version)
|
||||
return "{0}-{1}".format(self.project_name, version)
|
||||
|
||||
def _update_version_file(self, new_version):
|
||||
"""
|
||||
|
|
|
@ -126,7 +126,7 @@ class SingleProjectTests(TitoGitTestFixture):
|
|||
|
||||
with Capture(silent=True) as capture:
|
||||
self.assertRaises(SystemExit, tito, "tag --accept-auto-changelog")
|
||||
self.assertIn("Unknown placeholder 'ultimate_answer' in tag_commit_message_format",
|
||||
self.assertTrue("Unknown placeholder 'ultimate_answer' in tag_commit_message_format" in
|
||||
capture.err)
|
||||
|
||||
def test_tag_with_custom_message_containing_quotes(self):
|
||||
|
|
Loading…
Add table
Reference in a new issue