diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2010-07-02 16:37:45 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2010-07-02 16:37:45 +0200 |
| commit | dd86db9ddb22b43867b5b4dc211f4440dec7aa6a (patch) | |
| tree | fe7105c64632ccc9dc22520b6d70a18d5342c97b /apt | |
| parent | 945084be45a95fe532a6669e2c85a0ba363ecfd9 (diff) | |
| download | python-apt-dd86db9ddb22b43867b5b4dc211f4440dec7aa6a.tar.gz | |
* tests/test_debs/*.deb, tests/test_debfile.py:
- add automatic test based on the test debs from gdebi
Diffstat (limited to 'apt')
| -rw-r--r-- | apt/debfile.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/apt/debfile.py b/apt/debfile.py index 173521b1..81cd1dd2 100644 --- a/apt/debfile.py +++ b/apt/debfile.py @@ -17,6 +17,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA """Classes for working with locally available Debian packages.""" +import apt import apt_inst import apt_pkg import gzip @@ -44,19 +45,20 @@ class DebPackage(object): debug = 0 def __init__(self, filename=None, cache=None): + if cache is None: + cache = apt.Cache() self._cache = cache - self._need_pkgs = [] self._debfile = None self.pkgname = "" - self.filename = filename self._sections = {} - self._installed_conflicts = set() - self._failure_string = "" if filename: self.open(filename) def open(self, filename): """ open given debfile """ + self._need_pkgs = [] + self._installed_conflicts = set() + self._failure_string = "" self.filename = filename self._debfile = apt_inst.DebFile(open(self.filename)) control = self._debfile.control.extractdata("control") |
