diff options
author | Sebastian Pipping <sebastian@pipping.org> | 2010-01-15 18:50:19 +0100 |
---|---|---|
committer | Sebastian Pipping <sebastian@pipping.org> | 2010-01-15 18:50:19 +0100 |
commit | 7ba4169637a767bfcf2c99e167c78df97c940a8f (patch) | |
tree | 996022264cf33d37778c19ea46cb0079cac58497 | |
parent | Display related directory when deleting overlays (diff) | |
download | layman-7ba4169637a767bfcf2c99e167c78df97c940a8f.tar.gz layman-7ba4169637a767bfcf2c99e167c78df97c940a8f.tar.bz2 layman-7ba4169637a767bfcf2c99e167c78df97c940a8f.zip |
Fix Overlay and OverlaySource equality check
-rw-r--r-- | layman/overlays/overlay.py | 7 | ||||
-rw-r--r-- | layman/overlays/source.py | 6 |
2 files changed, 11 insertions, 2 deletions
diff --git a/layman/overlays/overlay.py b/layman/overlays/overlay.py index ddb118e..30d0966 100644 --- a/layman/overlays/overlay.py +++ b/layman/overlays/overlay.py @@ -207,8 +207,11 @@ class Overlay(object): 'owner_name', 'priority', 'status'): if getattr(self, i) != getattr(other, i): return False - if set(self.source_uris()) != set(other.source_uris()): - return False + for i in self.sources + other.sources: + if not i in self.sources: + return False + if not i in other.sources: + return False return True def __ne__(self, other): diff --git a/layman/overlays/source.py b/layman/overlays/source.py index e21319f..0dc1ba2 100644 --- a/layman/overlays/source.py +++ b/layman/overlays/source.py @@ -29,6 +29,12 @@ class OverlaySource(object): self.ignore = ignore self.quiet = quiet + def __eq__(self, other): + return self.src == other.src + + def __ne__(self, other): + return not self.__eq__(other) + def add(self, base, quiet = False): '''Add the overlay.''' |