Commit 20b0946e authored by Guido Günther's avatar Guido Günther

Revert "Turn on several threads when creating xz/lzma tarballs"

This changes the tarballs and therefore the checksums.

This reverts commit fd81e454.
parent c159d0ba
......@@ -26,21 +26,14 @@ class Compressor(object):
'lzma': '',
'xz': ''}
ParallelOpts = {'lzma': '-T0',
'xz': '-T0'}
Exts = {'gzip': 'gz',
'bzip2': 'bz2',
'lzma': 'lzma',
'xz': 'xz'}
def __init__(self, type_, level=None, parallel=False):
def __init__(self, type_, level=None):
self._type = type_
self._level = int(level) if level not in [None, ''] else None
self._more_opts = self.Opts.get(self._type, '')
self._parallel = parallel
if parallel:
self._more_opts += self.ParallelOpts.get(self._type, '')
def is_known(self):
return self.type in self.Opts.keys()
......@@ -53,14 +46,14 @@ class Compressor(object):
def level(self):
return self._level
@property
def parallel(self):
return self._parallel
@property
def _level_opt(self):
return '-%d' % self.level if self.level is not None else ''
@property
def _more_opts(self):
return self.Opts.get(self._type, '')
def cmdline(self, stdout=True):
"""
>>> Compressor('gzip', level=9).cmdline()
......@@ -74,12 +67,9 @@ class Compressor(object):
def __repr__(self):
"""
>>> Compressor('gzip').__repr__()
"<compressor type='gzip'>"
"<compressor type='gzip' >"
>>> Compressor('gzip', 9).__repr__()
"<compressor type='gzip' level=9>"
>>> Compressor('xz', 9, True).__repr__()
"<compressor type='xz' level=9 parallel=True>"
"""
opts_str = " level=%s" % self.level if self.level is not None else ""
opts_str += " parallel=True" if self.parallel else ""
return "<compressor type='%s'%s>" % (self.type, opts_str)
level_str = "level=%s" % self.level if self.level is not None else ''
return "<compressor type='%s' %s>" % (self.type, level_str)
......@@ -202,8 +202,7 @@ def git_archive_build_origs(repo, source, output_dir, options):
@param options: the parsed options
@type options: C{dict} of options
"""
parallel = not options.pristine_tar
comp = Compressor(options.comp_type, options.comp_level, parallel)
comp = Compressor(options.comp_type, options.comp_level)
upstream_tree = git_archive_get_upstream_tree(repo, source, options)
gbp.log.info("Creating %s from '%s'" % (source.upstream_tarball_name(comp.type),
upstream_tree))
......
......@@ -44,19 +44,16 @@ class TestExportOrig(ComponentTestBase):
tarballs = ["../%s_2.8.orig-foo.tar.gz" % pkg,
"../%s_2.8.orig.tar.gz" % pkg]
assert import_dsc(['arg0', '--no-pristine-tar', '--verbose', dsc]) == 0
assert import_dsc(['arg0', '--no-pristine-tar', dsc]) == 0
repo = ComponentTestGitRepository(pkg)
os.chdir(pkg)
assert_false(repo.has_branch('pristine-tar'), "Pristine-tar branch must not exist")
for t in tarballs:
self.assertFalse(os.path.exists(t), "Tarball %s must not exist" % t)
ret = export_orig(['arg0',
'--verbose',
'--component=foo',
'--no-pristine-tar'])
ok_(ret == 0, "Exporting tarballs failed")
self._check_in_info_log(".*Building upstream tarball with compression "
"<compressor type='gzip' parallel=True>")
for t in tarballs:
self.assertTrue(os.path.exists(t), "Tarball %s not found" % t)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment