summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDennis Gilmore <dennis@ausil.us>2011-01-05 23:14:33 -0600
committerDennis Gilmore <dennis@ausil.us>2011-01-05 23:14:33 -0600
commit071b8d99ab4cbdd6cfaff6f73a89a6892f18dd13 (patch)
tree19651164ea800742ff5066dcd4c96275d637c8db
parente04146557c91df8986de1a7f391dab86622cb59f (diff)
downloadfedora-packager-071b8d99ab4cbdd6cfaff6f73a89a6892f18dd13.tar.gz
fedora-packager-071b8d99ab4cbdd6cfaff6f73a89a6892f18dd13.tar.xz
fedora-packager-071b8d99ab4cbdd6cfaff6f73a89a6892f18dd13.zip
switch away from list2cmdline()
Patch from Toshio https://bugzilla.redhat.com/show_bug.cgi?id=667433#c7
-rw-r--r--src/pyfedpkg/__init__.py20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py
index 17f5df8..a1edb35 100644
--- a/src/pyfedpkg/__init__.py
+++ b/src/pyfedpkg/__init__.py
@@ -133,11 +133,10 @@ def _run_command(cmd, shell=False, env=None, pipe=[], cwd=None):
if sys.stdout.isatty():
if pipe:
log.debug('Running %s | %s directly on the tty' %
- (subprocess.list2cmdline(cmd),
- subprocess.list2cmdline(pipe)))
+ (' '.join(cmd), ' '.join(pipe)))
else:
log.debug('Running %s directly on the tty' %
- subprocess.list2cmdline(cmd))
+ ' '.join(cmd))
try:
if pipe:
# We're piping the stderr over too, which is probably a
@@ -166,11 +165,10 @@ def _run_command(cmd, shell=False, env=None, pipe=[], cwd=None):
# Ok, we're not on a live tty, so pipe and log.
if pipe:
log.debug('Running %s | %s and logging output' %
- (subprocess.list2cmdline(cmd),
- subprocess.list2cmdline(pipe)))
+ (' '.join(cmd), ' '.join(pipe)))
else:
log.debug('Running %s and logging output' %
- subprocess.list2cmdline(cmd))
+ ' '.join(cmd))
try:
if pipe:
proc1 = subprocess.Popen(command, env=environ,
@@ -195,7 +193,7 @@ def _run_command(cmd, shell=False, env=None, pipe=[], cwd=None):
log.info(output)
if proc.returncode:
raise FedpkgError('Command %s returned code %s with error: %s' %
- (subprocess.list2cmdline(cmd),
+ (' '.join(cmd),
proc.returncode,
error))
return
@@ -280,7 +278,7 @@ def _srpmdetails(srpm):
# get the name
cmd = ['rpm', '-qp', '--qf', '%{NAME}', srpm]
# Run the command
- log.debug('Running: %s' % subprocess.list2cmdline(cmd))
+ log.debug('Running: %s' % ' '.join(cmd))
try:
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
@@ -295,7 +293,7 @@ def _srpmdetails(srpm):
files = []
uploadfiles = []
cmd = ['rpm', '-qpl', srpm]
- log.debug('Running: %s' % subprocess.list2cmdline(cmd))
+ log.debug('Running: %s' % ' '.join(cmd))
try:
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
@@ -1206,7 +1204,7 @@ class PackageModule:
log.debug('Building chain %s for %s with options %s and a ' \
'priority of %s' %
(chain, self.target, opts, priority))
- log.debug(subprocess.list2cmdline(cmd))
+ log.debug(' '.join(cmd))
task_id = self.kojisession.chainBuild(chain, self.target, opts,
priority=priority)
# Now handle the normal build
@@ -1215,7 +1213,7 @@ class PackageModule:
log.info('Building %s for %s' % (self.nvr, self.target))
log.debug('Building %s for %s with options %s and a priority of %s' %
(url, self.target, opts, priority))
- log.debug(subprocess.list2cmdline(cmd))
+ log.debug(' '.join(cmd))
task_id = self.kojisession.build(url, self.target, opts,
priority=priority)
log.info('Created task: %s' % task_id)