From 1fc5fddddd6041eb17331d9943f7f489bd53314a Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 4 Jan 2012 14:20:55 +0100 Subject: * doc/examples/build-deps.py: - update the build-deps.py example to use the apt API more --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index df486b60..7f582bff 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +python-apt (0.8.4) UNRELEASED; urgency=low + + * doc/examples/build-deps.py: + - update the build-deps.py example to use the apt API more + + -- Michael Vogt Wed, 04 Jan 2012 12:07:48 +0100 + python-apt (0.8.3) unstable; urgency=low [ Alexey Feldgendler ] -- cgit v1.2.3 From 055dc32f4025f081293cee32cde935100532c651 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 30 Jan 2012 15:40:50 +0100 Subject: RED: apt.Version should have "policy_priority" property --- debian/changelog | 1 + po/python-apt.pot | 2 +- tests/test_policy.py | 10 ++++++++-- 3 files changed, 10 insertions(+), 3 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 7f582bff..1e400dfb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ python-apt (0.8.4) UNRELEASED; urgency=low * doc/examples/build-deps.py: - update the build-deps.py example to use the apt API more + * add support for apt_pkg.Policy.get_priority(PkgFileIterator) -- Michael Vogt Wed, 04 Jan 2012 12:07:48 +0100 diff --git a/po/python-apt.pot b/po/python-apt.pot index b99c36e1..58877b55 100644 --- a/po/python-apt.pot +++ b/po/python-apt.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-01-30 15:32+0100\n" +"POT-Creation-Date: 2012-01-30 15:40+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/tests/test_policy.py b/tests/test_policy.py index 2aab6722..449c3961 100644 --- a/tests/test_policy.py +++ b/tests/test_policy.py @@ -11,7 +11,7 @@ import unittest class TestAptPolicy(unittest.TestCase): - def test_apt_policy(self): + def test_apt_policy_lowlevel(self): # get a policy cache = apt.Cache() policy = cache._depcache.policy @@ -23,10 +23,16 @@ class TestAptPolicy(unittest.TestCase): for ver in pkg.versions: lowlevel_ver = ver._cand for pkgfile, i in lowlevel_ver.file_list: - #print verfile, i, policy.get_priority(pkgfile) + print pkgfile, i, policy.get_priority(pkgfile) self.assertTrue(policy.get_priority(pkgfile) > 1) self.assertTrue(policy.get_priority(pkgfile) < 1001) + def test_apt_policy_highlevel(self): + cache = apt.Cache() + pkg = cache["apt"] + self.assertTrue(pkg.candidate.policy_priority > 1 and + pkg.candidate.policy_priority < 1001) + if __name__ == "__main__": unittest.main() -- cgit v1.2.3 From accf60bda95e6a1bad53f26412b12a32f136d54d Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 31 Jan 2012 14:52:42 +0100 Subject: * apt/debfile.py: - use apt_inst for reading the control_filelist * debian/control: - remove no longer needed dependency on python-debian --- apt/debfile.py | 37 ++++++++++++++++++++----------------- debian/changelog | 4 ++++ debian/control | 1 - 3 files changed, 24 insertions(+), 18 deletions(-) (limited to 'debian') 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 = "" diff --git a/debian/changelog b/debian/changelog index 1e400dfb..17fe379e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,10 @@ python-apt (0.8.4) UNRELEASED; urgency=low * doc/examples/build-deps.py: - update the build-deps.py example to use the apt API more * add support for apt_pkg.Policy.get_priority(PkgFileIterator) + * apt/debfile.py: + - use apt_inst for reading the control_filelist + * debian/control: + - remove no longer needed dependency on python-debian -- Michael Vogt Wed, 04 Jan 2012 12:07:48 +0100 diff --git a/debian/control b/debian/control index 541e4c36..29392858 100644 --- a/debian/control +++ b/debian/control @@ -27,7 +27,6 @@ Breaks: packagekit-backend-apt (<= 0.4.8-0ubuntu4), computer-janitor (<< 1.14.1-1+), debdelta (<< 0.41+), python-dogtail (<< 0.6.1-3.1+), - python-debian (<< 0.1.18+), python-software-properties (<< 0.70.debian-1+), aptdaemon (<< 0.11+bzr343-1~), apt-forktracer (<< 0.3), -- cgit v1.2.3