[python-debian/master] make debian_support.Version hashable
Stefano Zacchiroli
zack at upsilon.cc
Tue Aug 25 15:14:20 UTC 2009
patch from Piotr Ożarowski
Closes: #543223
---
debian/changelog | 5 +++++
debian_bundle/debian_support.py | 5 ++++-
2 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 748ec97..eaf743a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,6 @@
python-debian (0.1.15) UNRELEASED; urgency=low
+ [ John Wright ]
* deb822: Don't ignore leading newlines on field data with apt_pkg
(Closes: #466753)
* changelog: Consistently parse different types of inputs. The
@@ -9,6 +10,10 @@ python-debian (0.1.15) UNRELEASED; urgency=low
* deb822: Faster non-shared storage by keeping a TagFile object
around for each Deb822 object yielded
+ [ Stefano Zacchiroli ]
+ * make debian_support.Version hashable, patch from Piotr Ożarowski
+ (Closes: #543223)
+
-- John Wright <jsw at debian.org> Thu, 30 Jul 2009 01:03:49 +0200
python-debian (0.1.14) unstable; urgency=low
diff --git a/debian_bundle/debian_support.py b/debian_bundle/debian_support.py
index 4561a4b..6543206 100644
--- a/debian_bundle/debian_support.py
+++ b/debian_bundle/debian_support.py
@@ -78,7 +78,10 @@ class Version:
return 'Version(%s)' % `self.__asString`
def __cmp__(self, other):
- return apt_pkg.VersionCompare(self.__asString, other.__asString)
+ return apt_pkg.VersionCompare(str(self), str(other))
+
+ def __hash__(self):
+ return hash(str(self))
version_compare = apt_pkg.VersionCompare
--
1.5.6.5
More information about the pkg-python-debian-commits
mailing list