summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt/package.py7
-rw-r--r--debian/changelog4
2 files changed, 11 insertions, 0 deletions
diff --git a/apt/package.py b/apt/package.py
index 48d14595..0dcc8b74 100644
--- a/apt/package.py
+++ b/apt/package.py
@@ -994,6 +994,13 @@ class Package(object):
"""
return [Version(self, ver) for ver in self._pkg.version_list]
+ def get_version(self, version):
+ """Get the Version instance matching the given version string."""
+ for ver in self.versions:
+ if ver.version == version:
+ return ver
+ return None
+
# depcache actions
def mark_keep(self):
diff --git a/debian/changelog b/debian/changelog
index 6150632c..61ec1527 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -13,6 +13,10 @@ python-apt (0.7.91) UNRELEASED; urgency=low
* debian/python-apt.doc-base: register the documentation with the
doc-base system (Closes: #525134)
+ [ Sebastian Heinlein ]
+ * apt/package.py: Add Package.get_version() which returns a Version instance
+ for the given version string or None (Closes: #523998)
+
-- Julian Andres Klode <jak@debian.org> Fri, 05 Jun 2009 19:36:45 +0200
python-apt (0.7.90) experimental; urgency=low