diff --git a/pym/portage/cache/flat_hash.py b/pym/portage/cache/flat_hash.py index 71ddf60..3f126c3 100644 --- a/pym/portage/cache/flat_hash.py +++ b/pym/portage/cache/flat_hash.py @@ -29,7 +29,7 @@ class database(fs_template.FsBased): try: myf = codecs.open(fp, mode='r', encoding='utf_8', errors='replace') try: - d = self._parse_data(myf, cpv) + d = self._parse_data(myf.readlines(), cpv) if '_mtime_' not in d: # Backward compatibility with old cache # that uses mtime mangling. @@ -87,7 +87,6 @@ class database(fs_template.FsBased): os.remove(fp) raise cache_errors.CacheCorruption(cpv, e) - def _delitem(self, cpv): # import pdb;pdb.set_trace() try: @@ -98,11 +97,9 @@ class database(fs_template.FsBased): else: raise cache_errors.CacheCorruption(cpv, e) - def __contains__(self, cpv): return os.path.exists(os.path.join(self.location, cpv)) - def __iter__(self): """generator for walking the dir struct""" dirs = [self.location] diff --git a/pym/portage/cache/metadata.py b/pym/portage/cache/metadata.py index 724dce3..b51bf98 100644 --- a/pym/portage/cache/metadata.py +++ b/pym/portage/cache/metadata.py @@ -34,7 +34,6 @@ class database(flat_hash.database): def _parse_data(self, data, cpv): _hashed_re_match = self._hashed_re.match - data = list(data) d = {} for line in data: