From cfdeed2808a769b1545bfed63547046e5a9d9263 Mon Sep 17 00:00:00 2001 From: Brian Stinson Date: Jun 16 2014 01:27:46 +0000 Subject: Don't choke on multiple spaces in metadata files There are some package metadata files with one space separating the hash and the source filename and some are separated by more than one space. Mapping str.strip() across the resulting list will remove any errant spaces left over. --- diff --git a/setup.py b/setup.py index 8fd1917..24456a6 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup setup( name = "centpkg", - version = "0.0.1", + version = "0.0.2", author = "Brian Stinson", author_email = "bstinson@ksu.edu", description = "CentOS Plugin to rpkg for managing RPM package sources", diff --git a/src/centpkg/__init__.py b/src/centpkg/__init__.py index 7332b45..595d66b 100644 --- a/src/centpkg/__init__.py +++ b/src/centpkg/__init__.py @@ -126,7 +126,7 @@ class Commands(pyrpkg.Commands): # 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) + csum, file = map(str.strip, archive.strip().split(' ', 1)) except ValueError: raise pyrpkg.rpkgError('Malformed sources file.') # See if we already have a valid copy downloaded