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

seth vidal skvidal at fedoraproject.org
Fri Sep 10 13:33:57 UTC 2010


On Fri, 2010-09-10 at 09:22 -0400, James Antill wrote:
> 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.
> 

why not? Why not make one.

-sv




More information about the Yum-devel mailing list