diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-09-24 22:15:48 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-09-24 22:15:48 +0000 |
commit | 3df9061abdeba371dabcab9754be90866ff1d0ad (patch) | |
tree | be50552e8e9a384d545c37184f9e23124b48c4b4 | |
parent | 7f16514a8aef6f0ac046afd895bc9294b30ab038 (diff) | |
download | portage-3df9061abdeba371dabcab9754be90866ff1d0ad.tar.gz portage-3df9061abdeba371dabcab9754be90866ff1d0ad.tar.bz2 portage-3df9061abdeba371dabcab9754be90866ff1d0ad.zip |
Fix regression in _getitem() from r14398, since myf.read().split("\n")
yields an empty string at the end which is causes _parse_data() to
catch a ValueError and raise CacheCorruption.
svn path=/main/trunk/; revision=14416
-rw-r--r-- | pym/portage/cache/flat_hash.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pym/portage/cache/flat_hash.py b/pym/portage/cache/flat_hash.py index 983055a4b..49d7ce6a0 100644 --- a/pym/portage/cache/flat_hash.py +++ b/pym/portage/cache/flat_hash.py @@ -41,7 +41,10 @@ class database(fs_template.FsBased): mode='r', encoding=_encodings['repo.content'], errors='replace') try: - d = self._parse_data(myf.read().split("\n"), cpv) + lines = myf.read().split("\n") + if not lines[-1]: + lines.pop() + d = self._parse_data(lines, cpv) if '_mtime_' not in d: # Backward compatibility with old cache # that uses mtime mangling. |