From 30505be641ba127ef66b84619fc8a7dc9d7350f2 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 10 Aug 2010 11:07:06 +0200 Subject: * python/acquire.cc: - return long long when calling TotalNeeded(), FetchNeeded() and PartialPresent() from pkgAcquire(). This follows the change in libapt. --- debian/changelog | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'debian/changelog') diff --git a/debian/changelog b/debian/changelog index 3906c485..761742ca 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,6 +17,10 @@ python-apt (0.7.97) UNRELEASED; urgency=low - add binding for the "dump()" method to configruation objects * apt/debfile.py: - fix crash in DscFile handling and add regression test + * python/acquire.cc: + - return long long when calling TotalNeeded(), FetchNeeded() and + PartialPresent() from pkgAcquire(). This follows the change + in libapt. -- Julian Andres Klode Fri, 23 Jul 2010 16:14:39 +0200 -- cgit v1.2.3 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 +++++ debian/changelog | 1 + tests/test_apt_cache.py | 3 +++ 3 files changed, 9 insertions(+) (limited to 'debian/changelog') 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.""" diff --git a/debian/changelog b/debian/changelog index 761742ca..9478bf89 100644 --- a/debian/changelog +++ b/debian/changelog @@ -21,6 +21,7 @@ python-apt (0.7.97) UNRELEASED; urgency=low - return long long when calling TotalNeeded(), FetchNeeded() and PartialPresent() from pkgAcquire(). This follows the change in libapt. + * add "provides" property to the apt.Version objects -- Julian Andres Klode Fri, 23 Jul 2010 16:14:39 +0200 diff --git a/tests/test_apt_cache.py b/tests/test_apt_cache.py index a43e92d2..2ace0201 100644 --- a/tests/test_apt_cache.py +++ b/tests/test_apt_cache.py @@ -1,6 +1,7 @@ #!/usr/bin/python # # Copyright (C) 2010 Julian Andres Klode +# 2010 Michael Vogt # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright @@ -50,6 +51,7 @@ class TestAptCache(unittest.TestCase): # a true virtual pkg l = cache.get_providing_packages("mail-transport-agent") self.assertTrue(len(l) > 0) + self.assertTrue("postfix" in [p.name for p in l]) # this is a not virtual (transitional) package provided by another l = cache.get_providing_packages("scrollkeeper") self.assertEqual(l, []) @@ -58,6 +60,7 @@ class TestAptCache(unittest.TestCase): l = cache.get_providing_packages("scrollkeeper", include_nonvirtual=True) self.assertTrue(len(l), 1) + self.assertTrue("mail-transport-agent" in cache["postfix"].candidate.provides) def test_dpkg_journal_dirty(self): -- 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 'debian/changelog') 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