[python-debian/master] Support installation together with older versions of python-apt
John Wright
jsw at debian.org
Sun Aug 1 08:06:42 UTC 2010
The deb822 module only uses apt_pkg for its TagFile interface, which is
only supported in later versions of python-apt. But it's simple enough
to detect whether TagFile is available and fall back to the native
parser, rather than conflicting with earlier versions of python-apt.
Original patch by Jelmer Vernooij.
Closes: #590805
---
debian/changelog | 7 +++++++
debian/control | 4 ++--
lib/debian/deb822.py | 4 +++-
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 7e1188a..5d164a5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+python-debian (0.1.18) UNRELEASED; urgency=low
+
+ * Support installation together with older versions of python-apt.
+ Original patch by Jelmer Vernooij. (Closes: #590805)
+
+ -- John Wright <jsw at debian.org> Sun, 01 Aug 2010 01:01:41 -0700
+
python-debian (0.1.17) unstable; urgency=low
[ James Westby ]
diff --git a/debian/control b/debian/control
index d52ab3e..e8ad071 100644
--- a/debian/control
+++ b/debian/control
@@ -20,10 +20,10 @@ Depends: ${python:Depends}, ${misc:Depends}, python-chardet
Recommends: python-apt
Suggests: gpgv
Provides: python-deb822
-Conflicts: python-deb822, python-apt (<< 0.7.94~)
+Conflicts: python-deb822
Replaces: python-deb822
Description: Python modules to work with Debian-related data formats
- This package provides Python modules that abstract many formats of Debian
+ This package provides Python modules that abstract many formats of Debian
related files. Currently handled are:
* Debtags information (debian.debtags module)
* debian/changelog (debian.changelog module)
diff --git a/lib/debian/deb822.py b/lib/debian/deb822.py
index 1a21e62..a0cad69 100644
--- a/lib/debian/deb822.py
+++ b/lib/debian/deb822.py
@@ -26,8 +26,10 @@ from deprecation import function_deprecated_by
try:
import apt_pkg
+ # This module uses apt_pkg only for its TagFile interface.
+ apt_pkg.TagFile
_have_apt_pkg = True
-except ImportError:
+except (ImportError, AttributeError):
_have_apt_pkg = False
import chardet
--
1.7.1
More information about the pkg-python-debian-commits
mailing list