[Yum-devel] [PATCH 2/2] Compare repoid nicely in po.__eq__ as well as po.__cmp__.

James Antill james.antill at redhat.com
Fri Sep 10 13:22:26 UTC 2010


On Fri, 2010-09-10 at 09:05 -0400, seth vidal wrote:
> On Thu, 2010-09-09 at 17:19 -0400, James Antill wrote:
> > ---
> >  yum/packages.py |    5 +++--
> >  1 files changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/yum/packages.py b/yum/packages.py
> > index b5a7d40..e83c0d5 100644
> > --- a/yum/packages.py
> > +++ b/yum/packages.py
> > @@ -290,8 +290,9 @@ class PackageObject(object):
> >              return False
> >          if self.pkgtup != other.pkgtup:
> >              return False
> > -        if self.repoid != other.repoid:
> > -            return False
> > +        if hasattr(self, 'repoid') and hasattr(other, 'repoid'):
> > +            if self.repoid != other.repoid:
> > +                return False
> >          return True
> >      def __ne__(self, other):
> >          if not (self == other):
> 
> ACK - but where does this ever break?

 History packages don't have a repoid.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part
URL: <http://lists.baseurl.org/pipermail/yum-devel/attachments/20100910/b5985614/attachment.pgp>


More information about the Yum-devel mailing list