[yum-commits] Branch 'yum-3_2_X' - yum/rpmsack.py
James Antill
james at osuosl.org
Thu May 20 19:52:23 UTC 2010
yum/rpmsack.py | 6 ++++++
1 file changed, 6 insertions(+)
New commits:
commit e20d1b713d2261419705b01b28c5b5d24af01276
Author: James Antill <james at and.org>
Date: Wed May 19 15:02:35 2010 -0400
Make "blah in ipkg.yumdb_info" be quicker, and fail in more useful ways
diff --git a/yum/rpmsack.py b/yum/rpmsack.py
index ef3343a..a0c65c8 100644
--- a/yum/rpmsack.py
+++ b/yum/rpmsack.py
@@ -1538,6 +1538,12 @@ class RPMDBAdditionalDataPackage(object):
else:
object.__delattr__(self, attr)
+ def __contains__(self, attr):
+ # This is faster than __iter__ and it makes things fail in a much more
+ # obvious way in weird FS corruption cases like: BZ 593436
+ x = self.get(attr)
+ return x is not None
+
def __iter__(self, show_hidden=False):
for item in self._read_cached_data:
yield item
More information about the Yum-commits
mailing list