aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp/scripts/buildpackage_rpm.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2017-01-17 20:10:00 +0100
committerGuido Günther <agx@sigxcpu.org>2017-01-17 20:11:01 +0100
commit1140886c80d5ef029bfd7b37b9ff8a24f07e6a69 (patch)
tree50907fe22435da93a1c1c55a96637f58cafa9020 /gbp/scripts/buildpackage_rpm.py
parent4eb8c383ad862cbf1fc6c3f7b86400869079035b (diff)
buildpackage: Don't set a compression level if unset and make this the default
This allows compressors to use the their default compression level. Only applies when not using pristine-tar. Thanks: Antoine Beaupré for investigating Closes: #820846
Diffstat (limited to 'gbp/scripts/buildpackage_rpm.py')
-rw-r--r--gbp/scripts/buildpackage_rpm.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/gbp/scripts/buildpackage_rpm.py b/gbp/scripts/buildpackage_rpm.py
index b34617df..889a863e 100644
--- a/gbp/scripts/buildpackage_rpm.py
+++ b/gbp/scripts/buildpackage_rpm.py
@@ -1,6 +1,6 @@
# vim: set fileencoding=utf-8 :
#
-# (C) 2006-2011,2015,2016 Guido Günther <agx@sigxcpu.org>
+# (C) 2006-2011,2015-2017 Guido Günther <agx@sigxcpu.org>
# (C) 2012-2015 Intel Corporation <markus.lehtonen@linux.intel.com>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -207,11 +207,13 @@ def git_archive_build_orig(repo, spec, output_dir, options):
gbp.log.info("%s does not exist, creating from '%s'" %
(spec.orig_src['filename'], upstream_tree))
if spec.orig_src['compression']:
+ comp_level = int(options.comp_level) if options.comp_level != '' else None
+ comp_level_msg = "' -%s'" % comp_level if comp_level is not None else ''
gbp.log.debug("Building upstream source archive with compression "
"'%s -%s'" % (spec.orig_src['compression'],
- options.comp_level))
+ comp_level_msg))
if not git_archive(repo, spec, output_dir, upstream_tree,
- orig_prefix, options.comp_level,
+ orig_prefix, comp_level,
options.with_submodules):
raise GbpError("Cannot create upstream tarball at '%s'" %
output_dir)
@@ -546,14 +548,16 @@ def main(argv):
# Just build source archive from the exported tree
gbp.log.info("Creating (native) source archive %s from '%s'"
% (spec.orig_src['filename'], tree))
+ comp_level = int(options.comp_level) if options.comp_level != '' else None
if spec.orig_src['compression']:
+ comp_level_msg = "' -%s'" % comp_level if comp_level is not None else ''
gbp.log.debug("Building source archive with "
- "compression '%s -%s'" %
+ "compression '%s%s'" %
(spec.orig_src['compression'],
- options.comp_level))
+ comp_level_msg))
orig_prefix = spec.orig_src['prefix']
if not git_archive(repo, spec, source_dir, tree,
- orig_prefix, options.comp_level,
+ orig_prefix, comp_level,
options.with_submodules):
raise GbpError("Cannot create source tarball at '%s'" %
source_dir)