summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-03-11 03:31:39 +0000
committerZac Medico <zmedico@gentoo.org>2009-03-11 03:31:39 +0000
commit9c5756fd0ea81a29545b94822e50ed4d24aab93e (patch)
tree2baad59487b03cad14fc08aebb5151d7c2c50009 /pym
parent0d482074f71a8baf2cc585b1c78e5b4b010a0982 (diff)
downloadportage-9c5756fd0ea81a29545b94822e50ed4d24aab93e.tar.gz
portage-9c5756fd0ea81a29545b94822e50ed4d24aab93e.tar.bz2
portage-9c5756fd0ea81a29545b94822e50ed4d24aab93e.zip
Implement Manifest2Entry.__ne__() so that comparisons inside Manifest.write()
work properly (to avoid rewriting an identical manifest when possible). (trunk r12567) svn path=/main/branches/2.1.6/; revision=12848
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/manifest.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/pym/portage/manifest.py b/pym/portage/manifest.py
index 0fc0a6b4a..9329c889b 100644
--- a/pym/portage/manifest.py
+++ b/pym/portage/manifest.py
@@ -66,6 +66,17 @@ class Manifest2Entry(ManifestEntry):
myline += " " + h + " " + str(self.hashes[h])
return myline
+ def __eq__(self, other):
+ if not isinstance(other, Manifest2Entry) or \
+ self.type != other.type or \
+ self.name != other.name or \
+ self.hashes != other.hashes:
+ return False
+ return True
+
+ def __ne__(self, other):
+ return not self.__eq__(other)
+
class Manifest(object):
parsers = (parseManifest2,)
def __init__(self, pkgdir, distdir, fetchlist_dict=None,