Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r12567 - main/trunk/pym/portage
Date: Sat, 31 Jan 2009 20:43:28
Message-Id: E1LTMgY-0004OQ-J9@stork.gentoo.org
1 Author: zmedico
2 Date: 2009-01-31 20:43:26 +0000 (Sat, 31 Jan 2009)
3 New Revision: 12567
4
5 Modified:
6 main/trunk/pym/portage/manifest.py
7 Log:
8 Implement Manifest2Entry.__ne__() so that comparisons inside Manifest.write()
9 work properly (to avoid rewriting an identical manifest when possible).
10
11
12 Modified: main/trunk/pym/portage/manifest.py
13 ===================================================================
14 --- main/trunk/pym/portage/manifest.py 2009-01-31 20:29:17 UTC (rev 12566)
15 +++ main/trunk/pym/portage/manifest.py 2009-01-31 20:43:26 UTC (rev 12567)
16 @@ -66,6 +66,17 @@
17 myline += " " + h + " " + str(self.hashes[h])
18 return myline
19
20 + def __eq__(self, other):
21 + if not isinstance(other, Manifest2Entry) or \
22 + self.type != other.type or \
23 + self.name != other.name or \
24 + self.hashes != other.hashes:
25 + return False
26 + return True
27 +
28 + def __ne__(self, other):
29 + return not self.__eq__(other)
30 +
31 class Manifest(object):
32 parsers = (parseManifest2,)
33 def __init__(self, pkgdir, distdir, fetchlist_dict=None,