diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2010-12-07 13:40:21 +0100 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2010-12-07 13:40:21 +0100 |
| commit | f93c69c24378aaed08c401b4303b60a6c2eb8260 (patch) | |
| tree | 31a31fe04ec7b231a4fa1a3456c7ed25426a2f64 /apt | |
| parent | f7d22dc2e7964ce33415e53a81dfc62439111491 (diff) | |
| parent | 0454e03e4c58d4ff63538badbf1b17276fe31494 (diff) | |
| download | python-apt-f93c69c24378aaed08c401b4303b60a6c2eb8260.tar.gz | |
merged from debian-sid
Diffstat (limited to 'apt')
| -rw-r--r-- | apt/debfile.py | 22 | ||||
| -rw-r--r-- | apt/package.py | 2 |
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. |
