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.
This commit is contained in:
Brian Stinson 2014-06-15 20:27:46 -05:00
parent f3349a9df7
commit cfdeed2808
2 changed files with 2 additions and 2 deletions

View file

@ -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",

View file

@ -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