summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2010-11-10 17:40:45 +0100
committerJulian Andres Klode <jak@debian.org>2010-11-10 17:40:45 +0100
commitc795d88c82f3fc5e0391986704a86835c7130637 (patch)
tree7f74b6647bfc9824dd7ca6ea658a6f221570d0eb
parentf524c86be889810aed2126834dade38badcbcde5 (diff)
downloadpython-apt-c795d88c82f3fc5e0391986704a86835c7130637.tar.gz
* apt/debfile.py:
- Replace (undocumented) use of python-debian debfile.DebFile API with the equivalent apt_inst.DebFile API (Closes: #603043)
-rw-r--r--apt/debfile.py22
-rw-r--r--debian/changelog8
2 files changed, 15 insertions, 15 deletions
diff --git a/apt/debfile.py b/apt/debfile.py
index 25a45e98..0a740c63 100644
--- a/apt/debfile.py
+++ b/apt/debfile.py
@@ -531,7 +531,7 @@ class DebPackage(object):
return s
def _get_content(self, part, name, auto_decompress=True, auto_hex=True):
- data = part.get_content(name)
+ data = part.extractdata(name)
# check for zip content
if name.endswith(".gz") and auto_decompress:
io = StringIO(data)
@@ -550,24 +550,16 @@ class DebPackage(object):
def control_content(self, name):
""" return the content of a specific control.tar.gz file """
try:
- from debian.debfile import DebFile
- except:
- raise Exception(_("Python-debian module not available"))
- control = DebFile(self.filename).control
- if name in control:
- return self._get_content(control, name)
- return ""
+ return self._get_content(self._debfile.control, name)
+ except LookupError:
+ return ""
def data_content(self, name):
""" return the content of a specific control.tar.gz file """
try:
- from debian.debfile import DebFile
- except:
- raise Exception(_("Python-debian module not available"))
- data = DebFile(self.filename).data
- if name in data:
- return self._get_content(data, name)
- return ""
+ return self._get_content(self._debfile.data, name)
+ except LookupError:
+ return ""
def _dbg(self, level, msg):
"""Write debugging output to sys.stderr."""
diff --git a/debian/changelog b/debian/changelog
index 008ff99e..856fd0da 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+python-apt (0.7.98.2) unstable; urgency=low
+
+ * apt/debfile.py:
+ - Replace (undocumented) use of python-debian debfile.DebFile API with
+ the equivalent apt_inst.DebFile API (Closes: #603043)
+
+ -- Julian Andres Klode <jak@debian.org> Wed, 10 Nov 2010 17:38:24 +0100
+
python-apt (0.7.98.1) unstable; urgency=low
[ Piotr Ozarowski ]