diff options
Diffstat (limited to 'src/pyfedpkg/__init__.py')
-rw-r--r-- | src/pyfedpkg/__init__.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py index 237eb58..08ae1b9 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 @@ -753,8 +757,8 @@ def sources(path, outdir=None): if _verify_file(outfile, csum, LOOKASIDEHASH): continue log.info("Downloading %s" % (file)) - 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') @@ -776,7 +780,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): @@ -1285,10 +1289,6 @@ class PackageModule: # Get just the output, then split it by space, grab the first return output[0].split()[0] - def getnvr(self): - """Return Name-Version-Release of a package""" - return self.nvr - def getrel(self): """Return the version-release of a package module.""" |