diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2012-01-31 14:52:42 +0100 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2012-01-31 14:52:42 +0100 |
| commit | accf60bda95e6a1bad53f26412b12a32f136d54d (patch) | |
| tree | 6b2a24a05816e11a1782b0e239c8aee6f2d0d2cd /apt | |
| parent | 5cc2cc92346239274953f3795f9b3d0ec5534246 (diff) | |
| download | python-apt-accf60bda95e6a1bad53f26412b12a32f136d54d.tar.gz | |
* apt/debfile.py:
- use apt_inst for reading the control_filelist
* debian/control:
- remove no longer needed dependency on python-debian
Diffstat (limited to 'apt')
| -rw-r--r-- | apt/debfile.py | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/apt/debfile.py b/apt/debfile.py index ab24c50b..6a189502 100644 --- a/apt/debfile.py +++ b/apt/debfile.py @@ -40,8 +40,12 @@ class DebPackage(object): VERSION_SAME, VERSION_NEWER) = range(4) - _supported_data_members = ("data.tar.gz", "data.tar.bz2", "data.tar.lzma", - "data.tar.xz") + _supported_data_members = ( + "data.tar.gz", + "data.tar.bz2", + "data.tar.lzma", + "data.tar.xz", + ) debug = 0 @@ -82,10 +86,22 @@ class DebPackage(object): try: self._debfile.data.go(lambda item, data: files.append(item.name)) except SystemError: - return [_("List of files for '%s' could not be read" % - self.filename)] + return [_("List of files for '%s' could not be read") % + self.filename] return files + @property + def control_filelist(self): + """ return the list of files in control.tar.gt """ + control = [] + try: + self._debfile.control.go(lambda item, data: control.append(item.name)) + except SystemError: + return [_("List of control files for '%s' could not be read") % + self.filename] + return sorted(control) + + # helper that will return a pkgname with a multiarch suffix if needed def _maybe_append_multiarch_suffix(self, pkgname, in_conflict_checking=False): @@ -545,19 +561,6 @@ class DebPackage(object): remove.append(pkg.name) return (install, remove, unauthenticated) - @property - def control_filelist(self): - """ return the list of files in control.tar.gt """ - try: - from debian.debfile import DebFile - except: - raise Exception(_("Python-debian module not available")) - content = [] - for name in DebFile(self.filename).control: - if name and name != ".": - content.append(name) - return sorted(content) - @staticmethod def to_hex(in_data): hex = "" |
