summaryrefslogtreecommitdiffstats
path: root/pym/portage/cache/sqlite.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-03-01 06:25:07 +0000
committerZac Medico <zmedico@gentoo.org>2009-03-01 06:25:07 +0000
commit90766d70c76c562af20cb4554bb0dab38a1b0abf (patch)
tree53f8ac70473f85d58ccd60542d7a528b97d67991 /pym/portage/cache/sqlite.py
parente45e8cd48d195269883b90a30c2fd1724b7fddf0 (diff)
downloadportage-90766d70c76c562af20cb4554bb0dab38a1b0abf.tar.gz
portage-90766d70c76c562af20cb4554bb0dab38a1b0abf.tar.bz2
portage-90766d70c76c562af20cb4554bb0dab38a1b0abf.zip
* Fix portage.cache.template.database.__getitem__() to validate the _mtime_
field and raise a CacheCorruption exception if necessary. * Make _mtime_ and _eclasses_ validation code in portdbapi and mirror_cache() assume that these fields are the correct type (otherwise a CacheCorruption exeception should be raised earlier). * Fix the sqlite module to implement _getitem() so that it properly inherits __getitem__() _mtime_ and _eclasses_ handling. svn path=/main/trunk/; revision=12735
Diffstat (limited to 'pym/portage/cache/sqlite.py')
-rw-r--r--pym/portage/cache/sqlite.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/pym/portage/cache/sqlite.py b/pym/portage/cache/sqlite.py
index f6e8c103c..5a7bcf1f5 100644
--- a/pym/portage/cache/sqlite.py
+++ b/pym/portage/cache/sqlite.py
@@ -143,7 +143,7 @@ class database(fs_template.FsBased):
if actual_synchronous!=synchronous:
raise cache_errors.InitializationError(self.__class__,"actual synchronous = "+actual_synchronous+" does does not match requested value of "+synchronous)
- def __getitem__(self, cpv):
+ def _getitem(self, cpv):
cursor = self._db_cursor
cursor.execute("select * from %s where %s=%s" % \
(self._db_table["packages"]["table_name"],
@@ -169,10 +169,6 @@ class database(fs_template.FsBased):
d[k]=str(d[k]) # convert unicode strings to normal
except UnicodeEncodeError, e:
pass #writemsg("%s: %s\n" % (cpv, str(e)))
- if "_eclasses_" in d:
- d["_eclasses_"] = reconstruct_eclasses(cpv, d["_eclasses_"])
- else:
- d["_eclasses_"] = {}
for x in self._known_keys:
d.setdefault(x,'')
return d