From: Markus Lehtonen Date: Tue, 18 Sep 2012 15:16:50 +0000 (+0300) Subject: Change compressor cmdline opts in compressor_opts to a list X-Git-Tag: tizen/0.6.22-20150206~191 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=92920ea579135830eb345ccdeb7864f17831bfaa;p=tools%2Fgit-buildpackage.git Change compressor cmdline opts in compressor_opts to a list Signed-off-by: Markus Lehtonen --- diff --git a/gbp/pkg/__init__.py b/gbp/pkg/__init__.py index 1fa9b05..fbca005 100644 --- a/gbp/pkg/__init__.py +++ b/gbp/pkg/__init__.py @@ -25,10 +25,10 @@ import gbp.command_wrappers as gbpc from gbp.errors import GbpError # compression types, extra options and extensions -compressor_opts = { 'gzip' : [ '-n', 'gz' ], - 'bzip2' : [ '', 'bz2' ], - 'lzma' : [ '', 'lzma' ], - 'xz' : [ '', 'xz' ] } +compressor_opts = { 'gzip' : [ ['-n'], 'gz' ], + 'bzip2' : [ [], 'bz2' ], + 'lzma' : [ [], 'lzma' ], + 'xz' : [ [], 'xz' ] } # Map frequently used names of compression types to the internal ones: compressor_aliases = { 'bz2' : 'bzip2', diff --git a/gbp/scripts/common/buildpackage.py b/gbp/scripts/common/buildpackage.py index e293c33..6e5fa65 100644 --- a/gbp/scripts/common/buildpackage.py +++ b/gbp/scripts/common/buildpackage.py @@ -83,7 +83,9 @@ def git_archive_submodules(repo, treeish, output, prefix, comp_type, comp_level, # compress the output if comp_type: - ret = os.system("%s --stdout -%s %s %s > %s" % (comp_type, comp_level, comp_opts, main_archive, output)) + ret = os.system("%s --stdout -%s %s %s > %s" % \ + (comp_type, comp_level, " ".join(comp_opts), + main_archive, output)) if ret: raise GbpError("Error creating %s: %d" % (output, ret)) else: @@ -102,7 +104,8 @@ def git_archive_single(treeish, output, prefix, comp_type, comp_level, comp_opts pipe = pipes.Template() pipe.prepend("git archive --format=%s --prefix=%s %s" % (format, prefix, treeish), '.-') if comp_type: - pipe.append('%s -c -%s %s' % (comp_type, comp_level, comp_opts), '--') + pipe.append('%s -c -%s %s' % (comp_type, comp_level, + " ".join(comp_opts)), '--') ret = pipe.copy('', output) if ret: raise GbpError("Error creating %s: %d" % (output, ret))