From 980c1cbd0d883c9e429aaa64633680456a0a776d Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 27 Aug 2010 15:06:54 +0200 Subject: add "provides" property to the apt.Version objects --- apt/package.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'apt') diff --git a/apt/package.py b/apt/package.py index 228a3385..871c1e16 100644 --- a/apt/package.py +++ b/apt/package.py @@ -414,6 +414,11 @@ class Version(object): pass return depends_list + @property + def provides(self): + """ Return a list of names that this version provides.""" + return [p[0] for p in self._cand.provides_list] + @property def enhances(self): """Return the list of enhances for the package version.""" -- cgit v1.2.3 From 96476d01e881f52d53a70f1ae700594a0f321056 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 31 Aug 2010 15:18:42 +0200 Subject: * apt/debfile.py: - fix error when reading binary content and add regresion test --- apt/debfile.py | 4 ++-- debian/changelog | 2 ++ tests/test_debfile.py | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) (limited to 'apt') diff --git a/apt/debfile.py b/apt/debfile.py index 33f0f04d..73f7d88e 100644 --- a/apt/debfile.py +++ b/apt/debfile.py @@ -512,7 +512,7 @@ class DebPackage(object): return sorted(content) @staticmethod - def to_hex(self, in_data): + def to_hex(in_data): hex = "" for (i, c) in enumerate(in_data): if i%80 == 0: @@ -521,7 +521,7 @@ class DebPackage(object): return hex @staticmethod - def to_strish(self, in_data): + def to_strish(in_data): s = "" for c in in_data: if ord(c) < 10 or ord(c) > 127: diff --git a/debian/changelog b/debian/changelog index 9478bf89..7fd04b41 100644 --- a/debian/changelog +++ b/debian/changelog @@ -22,6 +22,8 @@ python-apt (0.7.97) UNRELEASED; urgency=low PartialPresent() from pkgAcquire(). This follows the change in libapt. * add "provides" property to the apt.Version objects + * apt/debfile.py: + - fix error when reading binary content and add regresion test -- Julian Andres Klode Fri, 23 Jul 2010 16:14:39 +0200 diff --git a/tests/test_debfile.py b/tests/test_debfile.py index 72b9100c..42cda6f6 100644 --- a/tests/test_debfile.py +++ b/tests/test_debfile.py @@ -86,8 +86,9 @@ class TestDebfilee(unittest.TestCase): # binary deb = apt.debfile.DebPackage(cache=self.cache) deb.open(os.path.join("data", "test_debs", "gdebi-test12.deb")) - self.assertEqual('#!/bin/sh\necho "test"\n', - deb.data_content("usr/bin/binary")) + content = deb.data_content("usr/bin/binary") + self.assertTrue(content.startswith("Automatically converted to printable ascii:\n\x7fELF ")) + if __name__ == "__main__": #logging.basicConfig(level=logging.DEBUG) -- cgit v1.2.3