Compression level for lzma. (#2832)
This commit is contained in:
+7
-1
@@ -143,7 +143,13 @@ class ArchiveTar(ArchiveBase):
|
||||
self.tar.close()
|
||||
|
||||
if self.tar.mode == 'wb' and self.type == 'tarlzma':
|
||||
ret, out, err = util.run_batch("lzma e -a2 -d26 -fb64 %s %s" % (self.file_path, self.file_path + '.lzma'))
|
||||
batch = None
|
||||
if ctx.get_option('compression_level'):
|
||||
batch = "lzmash -k -%s %s" % (ctx.get_option('compression_level'), self.file_path)
|
||||
else:
|
||||
batch = "lzmash -k %s" % self.file_path
|
||||
|
||||
ret, out, err = util.run_batch(batch)
|
||||
if ret != 0:
|
||||
raise LZMAError(err)
|
||||
|
||||
|
||||
+11
-1
@@ -401,7 +401,17 @@ unpack, setup, build, install, package
|
||||
self.init()
|
||||
|
||||
if ctx.get_option('package_format') not in Build.package_formats:
|
||||
raise Error(_('package_format must be one of %s ') % pisi.util.strlist(Build.package_formats))
|
||||
raise Error(_('package_format must be one of %s ') % pisi.util.strlist(Build.package_formats))
|
||||
|
||||
if ctx.get_option('compression_level'):
|
||||
if ctx.get_option('package_format') != "1.1":
|
||||
raise Error(_('compression level is for lzma compression'))
|
||||
|
||||
try:
|
||||
if int(ctx.get_option('compression_level')) not in range(1, 10):
|
||||
raise Error(_('compression level must be between 1 and 9'))
|
||||
except ValueError:
|
||||
raise Error(_('compression level must be an integer'))
|
||||
|
||||
if ctx.get_option('output_dir'):
|
||||
ctx.ui.info(_('Output directory: %s') % ctx.config.options.output_dir)
|
||||
|
||||
Reference in New Issue
Block a user