aboutsummaryrefslogtreecommitdiff
path: root/gbp/scripts/buildpackage_rpm.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2017-01-11 11:57:37 +0100
committerGuido Günther <agx@sigxcpu.org>2017-01-11 15:23:50 +0100
commit80a1c39abf60d09bb6b8e033350b06ac789726cf (patch)
treee52e6d2c779ba167bdbef3b01209c9e49cdaafb0 /gbp/scripts/buildpackage_rpm.py
parent67d8b9f44b089eb04ae4ce54c03a0e06d751de30 (diff)
Quote arguments passed to builder
Closes: #850869 Thanks: Simon McVittie
Diffstat (limited to 'gbp/scripts/buildpackage_rpm.py')
-rw-r--r--gbp/scripts/buildpackage_rpm.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/gbp/scripts/buildpackage_rpm.py b/gbp/scripts/buildpackage_rpm.py
index 5dde23b..b34617d 100644
--- a/gbp/scripts/buildpackage_rpm.py
+++ b/gbp/scripts/buildpackage_rpm.py
@@ -19,6 +19,7 @@
"""Build an RPM package out of a Git repository"""
import os
+import pipes
import shutil
import sys
@@ -242,9 +243,9 @@ def setup_builder(options, builder_args):
if len(builder_args) == 0:
builder_args.append('-ba')
builder_args.extend([
- '--define "_topdir %s"' % os.path.abspath(options.export_dir),
- '--define "_specdir %%_topdir/%s"' % options.export_specdir,
- '--define "_sourcedir %%_topdir/%s"' % options.export_sourcedir])
+ '--define', "_topdir %s" % os.path.abspath(options.export_dir),
+ '--define', "_specdir %%_topdir/%s" % options.export_specdir,
+ '--define', "_sourcedir %%_topdir/%s" % options.export_sourcedir])
def packaging_tag_data(repo, commit, name, version, options):
@@ -580,7 +581,9 @@ def main(argv):
spec.specfile))
else:
builder_args.append(spec.specfile)
- RunAtCommand(options.builder, builder_args, shell=True,
+ RunAtCommand(options.builder,
+ [pipes.quote(arg) for arg in builder_args],
+ shell=True,
extra_env={'GBP_BUILD_DIR': export_dir}
)(dir=export_dir)
if options.postbuild: