summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Keating <jkeating@redhat.com>2010-12-01 12:04:53 -0800
committerJesse Keating <jkeating@redhat.com>2010-12-01 12:04:53 -0800
commit0ba169c74ed1d8789f44e53c78c4165031c05b06 (patch)
treea22a7de195b2a044c35fe781c0970afa973a97eb
parent67f9f405d24d02dcda67344b2275c6b317a85c44 (diff)
parent4f5adbf1c8ca7c7e4fd15e0c1b23f601c313b392 (diff)
downloadfedora-packager-0ba169c74ed1d8789f44e53c78c4165031c05b06.tar.gz
fedora-packager-0ba169c74ed1d8789f44e53c78c4165031c05b06.tar.xz
fedora-packager-0ba169c74ed1d8789f44e53c78c4165031c05b06.zip
Merge branch 'spaces'
-rw-r--r--src/pyfedpkg/__init__.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py
index 48a4024..28ca295 100644
--- a/src/pyfedpkg/__init__.py
+++ b/src/pyfedpkg/__init__.py
@@ -303,7 +303,8 @@ def _srpmdetails(srpm):
raise FedpkgError(e)
if error:
raise FedpkgError('Error querying srpm:' % error)
- contents = output.split()
+ # Doing a strip and split here as splitting on \n gets me an extra entry
+ contents = output.strip().split('\n')
# Cycle through the stuff and sort correctly by its extension
for file in contents:
if file.rsplit('.')[-1] in UPLOADEXTS:
@@ -599,7 +600,7 @@ def import_srpm(srpm, path=None):
# Need a way to make sure the srpm name matches the repo some how.
# Get a list of files we're currently tracking
- ourfiles = repo.git.ls_files().split()
+ ourfiles = repo.git.ls_files().split('\n')
# Trim out sources and .gitignore
try:
ourfiles.remove('.gitignore')
@@ -744,7 +745,10 @@ def sources(path, outdir=None):
outdir = path
for archive in archives:
try:
- csum, file = archive.split()
+ # This strip / split is kind a ugly, but checksums shouldn't have
+ # two spaces in them. sources file might need more structure in the
+ # future
+ csum, file = archive.strip().split(' ', 1)
except ValueError:
raise FedpkgError('Malformed sources file.')
# See if we already have a valid copy downloaded
@@ -752,8 +756,8 @@ def sources(path, outdir=None):
if os.path.exists(outfile):
if _verify_file(outfile, csum, LOOKASIDEHASH):
continue
- url = '%s/%s/%s/%s/%s' % (LOOKASIDE, module, file, csum,
- file)
+ url = '%s/%s/%s/%s/%s' % (LOOKASIDE, module, file.replace(' ', '%20'),
+ csum, file.replace(' ', '%20'))
# There is some code here for using pycurl, but for now,
# just use subprocess
#output = open(file, 'wb')
@@ -775,7 +779,7 @@ def sources(path, outdir=None):
#output.close()
# These options came from Makefile.common.
# Probably need to support wget too
- command = ['curl', '-H', 'Pragma:', '-O', '-R', '-S', '--fail',
+ command = ['curl', '-H', 'Pragma:', '-o', file, '-R', '-S', '--fail',
'--show-error', url]
_run_command(command)
if not _verify_file(outfile, csum, LOOKASIDEHASH):