summaryrefslogtreecommitdiff
path: root/apt
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-12-07 13:40:21 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2010-12-07 13:40:21 +0100
commitf93c69c24378aaed08c401b4303b60a6c2eb8260 (patch)
tree31a31fe04ec7b231a4fa1a3456c7ed25426a2f64 /apt
parentf7d22dc2e7964ce33415e53a81dfc62439111491 (diff)
parent0454e03e4c58d4ff63538badbf1b17276fe31494 (diff)
downloadpython-apt-f93c69c24378aaed08c401b4303b60a6c2eb8260.tar.gz
merged from debian-sid
Diffstat (limited to 'apt')
-rw-r--r--apt/debfile.py22
-rw-r--r--apt/package.py2
2 files changed, 8 insertions, 16 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/apt/package.py b/apt/package.py
index 871c1e16..475edb76 100644
--- a/apt/package.py
+++ b/apt/package.py
@@ -1170,7 +1170,7 @@ class Package(object):
@deprecated_args
def mark_delete(self, auto_fix=True, purge=False):
- """Mark a package for install.
+ """Mark a package for deletion.
If *auto_fix* is ``True``, the resolver will be run, trying to fix
broken packages. This is the default.