summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-01-31 20:43:26 +0000
committerZac Medico <zmedico@gentoo.org>2009-01-31 20:43:26 +0000
commit351668a24882416c86293e700a826bad6c3070a4 (patch)
tree354f4a53f1fb22393ce7331a5e0c19a7f270e51f
parent9dd3f5839dcf2910ced109860b4ef94626f2fbda (diff)
downloadportage-351668a24882416c86293e700a826bad6c3070a4.tar.gz
portage-351668a24882416c86293e700a826bad6c3070a4.tar.bz2
portage-351668a24882416c86293e700a826bad6c3070a4.zip
Implement Manifest2Entry.__ne__() so that comparisons inside Manifest.write()
work properly (to avoid rewriting an identical manifest when possible). svn path=/main/trunk/; revision=12567
-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,