From 62a7342edb16c38e3d646cc731a4a50ad6657b4f Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 9 Mar 2010 14:15:47 +0100 Subject: python/generic.cc: use std::string instead of string --- python/generic.cc | 4 ++-- python/progress.cc | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/python/generic.cc b/python/generic.cc index 640f0862..b0770e02 100644 --- a/python/generic.cc +++ b/python/generic.cc @@ -31,11 +31,11 @@ PyObject *HandleErrors(PyObject *Res) Py_DECREF(Res); } - string Err; + std::string Err; int errcnt = 0; while (_error->empty() == false) { - string Msg; + std::string Msg; bool Type = _error->PopMessage(Msg); if (errcnt > 0) Err.append(", "); diff --git a/python/progress.cc b/python/progress.cc index 18081690..097f06cf 100644 --- a/python/progress.cc +++ b/python/progress.cc @@ -491,7 +491,6 @@ pkgPackageManager::OrderResult PyInstallProgress::Run(pkgPackageManager *pm) StartUpdate(); - PyCbObj_END_ALLOW_THREADS if(PyObject_HasAttrString(callbackInst, "waitChild") || PyObject_HasAttrString(callbackInst, "wait_child")) { -- cgit v1.2.3 From 3a08cfb10590d5cf5df1f45d94a424ef6a0f674b Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 23 Mar 2010 13:32:21 +0100 Subject: * apt/cache.py: - make cache open silent by default (use apt.progress.base.OpProgress) --- apt/cache.py | 2 +- debian/changelog | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apt/cache.py b/apt/cache.py index 2e6d24e5..cfe6bedc 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -117,7 +117,7 @@ class Cache(object): a dictionary """ if progress is None: - progress = apt.progress.text.OpProgress() + progress = apt.progress.base.OpProgress() self._run_callbacks("cache_pre_open") self._cache = apt_pkg.Cache(progress) diff --git a/debian/changelog b/debian/changelog index b7617f90..2137aa69 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,15 @@ python-apt (0.7.94.3) UNRELEASED; urgency=low + [ Julian Andres Klode ] * python/generic.cc: - Fix a memory leak when using old attribute names. * debian/control: - Change priority to standard, keep -doc and -dev on optional. + [ Michael Vogt ] + * apt/cache.py: + - make cache open silent by default (use apt.progress.base.OpProgress) + -- Julian Andres Klode Mon, 15 Mar 2010 17:04:49 +0100 python-apt (0.7.94.2) unstable; urgency=low -- cgit v1.2.3 From 8b7f77302ccf3d71e66ac5cadea658e3dcdd8958 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 23 Mar 2010 14:34:37 +0100 Subject: * tests/data/aptsources_ports/sources.list: - fix ports test-data --- debian/changelog | 2 ++ tests/data/aptsources_ports/sources.list | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2137aa69..cd216e3e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,8 @@ python-apt (0.7.94.3) UNRELEASED; urgency=low [ Michael Vogt ] * apt/cache.py: - make cache open silent by default (use apt.progress.base.OpProgress) + * tests/data/aptsources_ports/sources.list: + - fix ports test-data -- Julian Andres Klode Mon, 15 Mar 2010 17:04:49 +0100 diff --git a/tests/data/aptsources_ports/sources.list b/tests/data/aptsources_ports/sources.list index a6b2f6ed..54f048b2 100644 --- a/tests/data/aptsources_ports/sources.list +++ b/tests/data/aptsources_ports/sources.list @@ -6,12 +6,12 @@ # newer versions of the distribution. deb http://ports.ubuntu.com/ubuntu-ports/ hardy main restricted -deb-src http://archive.ubuntu.com/ubuntu hardy main restricted +deb-src http://ports.ubuntu.com/ubuntu-ports/ hardy main restricted ## Major bug fix updates produced after the final release of the ## distribution. deb http://ports.ubuntu.com/ubuntu-ports/ hardy-updates main restricted -deb-src http://archive.ubuntu.com/ubuntu hardy-updates main restricted +deb-src http://ports.ubuntu.com/ubuntu-ports/ hardy-updates main restricted ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to @@ -19,9 +19,9 @@ deb-src http://archive.ubuntu.com/ubuntu hardy-updates main restricted ## universe WILL NOT receive any review or updates from the Ubuntu security ## team. deb http://ports.ubuntu.com/ubuntu-ports/ hardy universe -deb-src http://archive.ubuntu.com/ubuntu hardy universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ hardy universe deb http://ports.ubuntu.com/ubuntu-ports/ hardy-updates universe -deb-src http://archive.ubuntu.com/ubuntu hardy-updates universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ hardy-updates universe ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to @@ -29,9 +29,9 @@ deb-src http://archive.ubuntu.com/ubuntu hardy-updates universe ## multiverse WILL NOT receive any review or updates from the Ubuntu ## security team. deb http://ports.ubuntu.com/ubuntu-ports/ hardy multiverse -deb-src http://archive.ubuntu.com/ubuntu hardy multiverse +deb-src http://ports.ubuntu.com/ubuntu-ports/ hardy multiverse deb http://ports.ubuntu.com/ubuntu-ports/ hardy-updates multiverse -deb-src http://archive.ubuntu.com/ubuntu hardy-updates multiverse +deb-src http://ports.ubuntu.com/ubuntu-ports/ hardy-updates multiverse ## Uncomment the following two lines to add software from the 'backports' ## repository. @@ -41,7 +41,7 @@ deb-src http://archive.ubuntu.com/ubuntu hardy-updates multiverse ## Also, please note that software in backports WILL NOT receive any review ## or updates from the Ubuntu security team. # deb http://ports.ubuntu.com/ubuntu-ports/ hardy-backports main restricted universe multiverse -# deb-src http://archive.ubuntu.com/ubuntu hardy-backports main restricted universe multiverse +# deb-src http://ports.ubuntu.com/ubuntu-ports/ hardy-backports main restricted universe multiverse ## Uncomment the following two lines to add software from Canonical's ## 'partner' repository. This software is not part of Ubuntu, but is @@ -56,4 +56,4 @@ deb http://ports.ubuntu.com/ubuntu-ports/ hardy-security universe deb-src http://ports.ubuntu.com/ubuntu-ports/ hardy-security universe deb http://ports.ubuntu.com/ubuntu-ports/ hardy-security multiverse deb-src http://ports.ubuntu.com/ubuntu-ports/ hardy-security multiverse -deb-src http://archive.ubuntu.com/ubuntu/ hardy-proposed restricted main multiverse universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ hardy-proposed restricted main multiverse universe -- cgit v1.2.3 From 05b659d926b999015db3c47c7e5335093d9cbfff Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 23 Mar 2010 15:19:14 +0100 Subject: * tests/test_apt_cache.py: - add simple test for basic cache/dependency iteration --- debian/changelog | 2 ++ tests/test_apt_cache.py | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 tests/test_apt_cache.py diff --git a/debian/changelog b/debian/changelog index cd216e3e..e780727e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,8 @@ python-apt (0.7.94.3) UNRELEASED; urgency=low - make cache open silent by default (use apt.progress.base.OpProgress) * tests/data/aptsources_ports/sources.list: - fix ports test-data + * tests/test_apt_cache.py: + - add simple test for basic cache/dependency iteration -- Julian Andres Klode Mon, 15 Mar 2010 17:04:49 +0100 diff --git a/tests/test_apt_cache.py b/tests/test_apt_cache.py new file mode 100644 index 00000000..3c2961e1 --- /dev/null +++ b/tests/test_apt_cache.py @@ -0,0 +1,34 @@ +#!/usr/bin/python +# +# Copyright (C) 2010 Julian Andres Klode +# +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved. +"""Unit tests for verifying the correctness of check_dep, etc in apt_pkg.""" +import unittest + +import apt + + +class TestAptCache(unittest.TestCase): + """ test the apt cache """ + + def testAptCache(self): + """ simple test that iterates all packages and all dependencies """ + cache = apt.Cache() + # number is not meaningful and just need to be "big enough", + # the important bit is the test against __len__ + self.assertTrue(len(cache) > 100) + # go over the cache and all dependencies, just to see if + # that is possible and does not crash + for pkg in cache: + if pkg.candidate: + for or_dep in pkg.candidate.dependencies: + for dep in or_dep.or_dependencies: + name = dep.name + relation = dep.relation + preDepends = dep.pre_depend + +if __name__ == "__main__": + unittest.main() -- cgit v1.2.3 From 57624b5df523c0b3a3ebc1741680f283ee1fbbcd Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 25 Mar 2010 10:04:02 +0100 Subject: * apt/__init__.py: - only show deprecation warnings if PYTHON_APT_DEPRECATION_WARNINGS is set in the environment * python/indexfile.cc: - add missing 0.7 compat indexfile.ArchiveURI method --- debian/changelog | 7 +++- po/python-apt.pot | 110 ++++++++++++++++++++++++++-------------------------- python/indexfile.cc | 3 ++ 3 files changed, 64 insertions(+), 56 deletions(-) diff --git a/debian/changelog b/debian/changelog index e780727e..30b5abc2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,8 +13,13 @@ python-apt (0.7.94.3) UNRELEASED; urgency=low - fix ports test-data * tests/test_apt_cache.py: - add simple test for basic cache/dependency iteration + * apt/__init__.py: + - only show deprecation warnings if PYTHON_APT_DEPRECATION_WARNINGS + is set in the environment + * python/indexfile.cc: + - add missing 0.7 compat indexfile.ArchiveURI method - -- Julian Andres Klode Mon, 15 Mar 2010 17:04:49 +0100 + -- Michael Vogt Tue, 23 Mar 2010 16:03:50 +0100 python-apt (0.7.94.2) unstable; urgency=low diff --git a/po/python-apt.pot b/po/python-apt.pot index b67d7988..0b34e01b 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: 2010-03-03 19:34+0100\n" +"POT-Creation-Date: 2010-03-25 10:03+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -23,257 +23,257 @@ msgid "http://changelogs.ubuntu.com/changelogs/pool/%s/%s/%s/%s_%s/changelog" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:12 +#: ../data/templates/Ubuntu.info.in:13 msgid "Ubuntu 10.04 'Lucid Lynx'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:30 +#: ../data/templates/Ubuntu.info.in:31 msgid "Cdrom with Ubuntu 10.04 'Lucid Lynx'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:72 +#: ../data/templates/Ubuntu.info.in:74 msgid "Ubuntu 9.10 'Karmic Koala'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:90 +#: ../data/templates/Ubuntu.info.in:92 msgid "Cdrom with Ubuntu 9.10 'Karmic Koala'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:132 +#: ../data/templates/Ubuntu.info.in:135 msgid "Ubuntu 9.04 'Jaunty Jackalope'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:150 +#: ../data/templates/Ubuntu.info.in:153 msgid "Cdrom with Ubuntu 9.04 'Jaunty Jackalope'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:192 +#: ../data/templates/Ubuntu.info.in:196 msgid "Ubuntu 8.10 'Intrepid Ibex'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:210 +#: ../data/templates/Ubuntu.info.in:214 msgid "Cdrom with Ubuntu 8.10 'Intrepid Ibex'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:253 +#: ../data/templates/Ubuntu.info.in:258 msgid "Ubuntu 8.04 'Hardy Heron'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:271 +#: ../data/templates/Ubuntu.info.in:276 msgid "Cdrom with Ubuntu 8.04 'Hardy Heron'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:308 +#: ../data/templates/Ubuntu.info.in:313 msgid "Ubuntu 7.10 'Gutsy Gibbon'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:326 +#: ../data/templates/Ubuntu.info.in:331 msgid "Cdrom with Ubuntu 7.10 'Gutsy Gibbon'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:361 +#: ../data/templates/Ubuntu.info.in:366 msgid "Ubuntu 7.04 'Feisty Fawn'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:379 +#: ../data/templates/Ubuntu.info.in:384 msgid "Cdrom with Ubuntu 7.04 'Feisty Fawn'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:413 +#: ../data/templates/Ubuntu.info.in:418 msgid "Ubuntu 6.10 'Edgy Eft'" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:418 +#: ../data/templates/Ubuntu.info.in:423 msgid "Community-maintained" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:424 +#: ../data/templates/Ubuntu.info.in:429 msgid "Restricted software" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:431 +#: ../data/templates/Ubuntu.info.in:436 msgid "Cdrom with Ubuntu 6.10 'Edgy Eft'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:465 +#: ../data/templates/Ubuntu.info.in:470 msgid "Ubuntu 6.06 LTS 'Dapper Drake'" msgstr "" #. CompDescriptionLong -#: ../data/templates/Ubuntu.info.in:468 +#: ../data/templates/Ubuntu.info.in:473 msgid "Canonical-supported Open Source software" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:470 +#: ../data/templates/Ubuntu.info.in:475 msgid "Community-maintained (universe)" msgstr "" #. CompDescriptionLong -#: ../data/templates/Ubuntu.info.in:471 +#: ../data/templates/Ubuntu.info.in:476 msgid "Community-maintained Open Source software" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:473 +#: ../data/templates/Ubuntu.info.in:478 msgid "Non-free drivers" msgstr "" #. CompDescriptionLong -#: ../data/templates/Ubuntu.info.in:474 +#: ../data/templates/Ubuntu.info.in:479 msgid "Proprietary drivers for devices" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:476 +#: ../data/templates/Ubuntu.info.in:481 msgid "Restricted software (Multiverse)" msgstr "" #. CompDescriptionLong -#: ../data/templates/Ubuntu.info.in:477 +#: ../data/templates/Ubuntu.info.in:482 msgid "Software restricted by copyright or legal issues" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:483 +#: ../data/templates/Ubuntu.info.in:488 msgid "Cdrom with Ubuntu 6.06 LTS 'Dapper Drake'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:495 +#: ../data/templates/Ubuntu.info.in:500 msgid "Important security updates" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:500 +#: ../data/templates/Ubuntu.info.in:505 msgid "Recommended updates" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:505 +#: ../data/templates/Ubuntu.info.in:510 msgid "Pre-released updates" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:510 +#: ../data/templates/Ubuntu.info.in:515 msgid "Unsupported updates" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:517 +#: ../data/templates/Ubuntu.info.in:522 msgid "Ubuntu 5.10 'Breezy Badger'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:531 +#: ../data/templates/Ubuntu.info.in:536 msgid "Cdrom with Ubuntu 5.10 'Breezy Badger'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:543 +#: ../data/templates/Ubuntu.info.in:548 msgid "Ubuntu 5.10 Security Updates" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:548 +#: ../data/templates/Ubuntu.info.in:553 msgid "Ubuntu 5.10 Updates" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:553 +#: ../data/templates/Ubuntu.info.in:558 msgid "Ubuntu 5.10 Backports" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:560 +#: ../data/templates/Ubuntu.info.in:565 msgid "Ubuntu 5.04 'Hoary Hedgehog'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:574 +#: ../data/templates/Ubuntu.info.in:579 msgid "Cdrom with Ubuntu 5.04 'Hoary Hedgehog'" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:577 ../data/templates/Debian.info.in:149 +#: ../data/templates/Ubuntu.info.in:582 ../data/templates/Debian.info.in:149 msgid "Officially supported" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:586 +#: ../data/templates/Ubuntu.info.in:591 msgid "Ubuntu 5.04 Security Updates" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:591 +#: ../data/templates/Ubuntu.info.in:596 msgid "Ubuntu 5.04 Updates" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:596 +#: ../data/templates/Ubuntu.info.in:601 msgid "Ubuntu 5.04 Backports" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:602 +#: ../data/templates/Ubuntu.info.in:607 msgid "Ubuntu 4.10 'Warty Warthog'" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:608 +#: ../data/templates/Ubuntu.info.in:613 msgid "Community-maintained (Universe)" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:610 +#: ../data/templates/Ubuntu.info.in:615 msgid "Non-free (Multiverse)" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:616 +#: ../data/templates/Ubuntu.info.in:621 msgid "Cdrom with Ubuntu 4.10 'Warty Warthog'" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:619 +#: ../data/templates/Ubuntu.info.in:624 msgid "No longer officially supported" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:621 +#: ../data/templates/Ubuntu.info.in:626 msgid "Restricted copyright" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:628 +#: ../data/templates/Ubuntu.info.in:633 msgid "Ubuntu 4.10 Security Updates" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:633 +#: ../data/templates/Ubuntu.info.in:638 msgid "Ubuntu 4.10 Updates" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:638 +#: ../data/templates/Ubuntu.info.in:643 msgid "Ubuntu 4.10 Backports" msgstr "" @@ -384,11 +384,11 @@ msgstr "" msgid "Invalid unicode in description for '%s' (%s). Please report." msgstr "" -#: ../apt/package.py:999 ../apt/package.py:1105 +#: ../apt/package.py:999 ../apt/package.py:1107 msgid "The list of changes is not available" msgstr "" -#: ../apt/package.py:1109 +#: ../apt/package.py:1113 #, python-format msgid "" "The list of changes is not available yet.\n" @@ -397,7 +397,7 @@ msgid "" "until the changes become available or try again later." msgstr "" -#: ../apt/package.py:1115 +#: ../apt/package.py:1120 msgid "" "Failed to download the list of changes. \n" "Please check your Internet connection." diff --git a/python/indexfile.cc b/python/indexfile.cc index c6d0b1cc..5e66b06a 100644 --- a/python/indexfile.cc +++ b/python/indexfile.cc @@ -28,6 +28,9 @@ static PyObject *IndexFileArchiveURI(PyObject *Self,PyObject *Args) static PyMethodDef IndexFileMethods[] = { {"archive_uri",IndexFileArchiveURI,METH_VARARGS,"Returns the ArchiveURI"}, +#ifdef COMPAT_0_7 + {"ArchiveURI",IndexFileArchiveURI,METH_VARARGS,"Returns the ArchiveURI"}, +#endif {} }; -- cgit v1.2.3