From 1b5b026c1013dc20b572a7fd2a690fe451248ab0 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 5 May 2009 11:59:53 +0200 Subject: * apt/progress/__init__.py: - add update_status_full() that takes file_size/partial_size as additional callback arguments - add pulse_items() that takes a addtional "items" tuple that gives the user full access to the individual items that are fetched * python/progress.cc: - low level code for update_status_full and pulse_items() --- debian/changelog | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 83b00150..a3faab79 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,17 @@ +python-apt (0.7.10.4) UNRELEASED; urgency=low + + [ Stephan Peijnik ] + * apt/progress/__init__.py: + - add update_status_full() that takes file_size/partial_size as + additional callback arguments + - add pulse_items() that takes a addtional "items" tuple that + gives the user full access to the individual items that are + fetched + * python/progress.cc: + - low level code for update_status_full and pulse_items() + + -- Michael Vogt Tue, 05 May 2009 11:57:57 +0200 + python-apt (0.7.10.3) unstable; urgency=low * apt/package.py: Handle cases where no candidate is available, by returning -- cgit v1.2.3 From 1928a8fab432b219c6286ff08b142c57c6df5e6b Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 15 Jun 2009 10:56:01 +0200 Subject: * python/progress.cc: - fix crash in RunSimpleCallback() * apt/cache.py: - when the cache is run with a alternative rootdir, create required dirs/files automatically --- apt/cache.py | 25 +++++++++++++++++++++++++ debian/changelog | 5 +++++ python/progress.cc | 5 ++++- 3 files changed, 34 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/apt/cache.py b/apt/cache.py index cc425ccb..94a77fd8 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -60,8 +60,33 @@ class Cache(object): apt_pkg.Config.Set("Dir", rootdir) apt_pkg.Config.Set("Dir::State::status", rootdir + "/var/lib/dpkg/status") + # create required dirs/files when run with special rootdir + # automatically + self._check_and_create_required_dirs(rootdir) self.open(progress) + def _check_and_create_required_dirs(self, rootdir): + """ + check if the required apt directories/files are there and if + not create them + """ + files = ["/var/lib/dpkg/status", + "/etc/apt/sources.list", + ] + dirs = ["/var/lib/dpkg", + "/etc/apt/", + "/var/cache/apt/archives/partial", + "/var/lib/apt/lists/partial", + ] + for d in dirs: + if not os.path.exists(rootdir+d): + print "creating: ",rootdir+d + os.makedirs(rootdir+d) + for f in files: + if not os.path.exists(rootdir+f): + open(rootdir+f,"w") + + def _runCallbacks(self, name): """ internal helper to run a callback """ if name in self._callbacks: diff --git a/debian/changelog b/debian/changelog index a3faab79..0f9463b2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -99,8 +99,13 @@ python-apt (0.7.9) unstable; urgency=low closes: #497049 * apt/package.py: - avoid uneeded interal references in the Package objects + * python/progress.cc: + - fix crash in RunSimpleCallback() * aptsources/sourceslist.py: - fix bug in invalid lines detection (LP: #324614) + * apt/cache.py: + - when the cache is run with a alternative rootdir, create + required dirs/files automatically -- Michael Vogt Thu, 19 Mar 2009 13:39:21 +0100 diff --git a/python/progress.cc b/python/progress.cc index 14948d3c..95cece3b 100644 --- a/python/progress.cc +++ b/python/progress.cc @@ -27,9 +27,12 @@ bool PyCallbackObj::RunSimpleCallback(const char* method_name, PyObject *method = PyObject_GetAttrString(callbackInst,(char*) method_name); if(method == NULL) { - // FIXME: make this silent //std::cerr << "Can't find '" << method_name << "' method" << std::endl; Py_XDECREF(arglist); + if (res) { + Py_INCREF(Py_None); + *res = Py_None; + } return false; } PyObject *result = PyEval_CallObject(method, arglist); -- cgit v1.2.3 From 87f6d28c1555ee70da9dddb9625cea0c4d6ab9a5 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 15 Jun 2009 17:22:49 +0200 Subject: data/templates/Debian.info.in: Squeeze will be 6.0, not 5.1 --- data/templates/Debian.info.in | 2 +- debian/changelog | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/data/templates/Debian.info.in b/data/templates/Debian.info.in index e80f0f6c..e5a1b424 100644 --- a/data/templates/Debian.info.in +++ b/data/templates/Debian.info.in @@ -5,7 +5,7 @@ RepositoryType: deb BaseURI: http://http.us.debian.org/debian/ MatchURI: ftp[0-9]*\.[a-z]\.debian\.org MirrorsFile: /usr/share/python-apt/templates/Debian.mirrors -_Description: Debian 5.1 'Squeeze' +_Description: Debian 6.0 'Squeeze' Component: main _CompDescription: Officially supported Component: contrib diff --git a/debian/changelog b/debian/changelog index 10d40aba..b3b811c2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +python-apt (0.7.10.5) UNRELEASED; urgency=low + + * data/templates/Debian.info.in: Squeeze will be 6.0, not 5.1 + + -- Julian Andres Klode Mon, 15 Jun 2009 17:21:57 +0200 + python-apt (0.7.10.4) unstable; urgency=low [ Michael Vogt ] -- cgit v1.2.3 From d28170024ef4d2f01fd9096a3ec785cf424c0846 Mon Sep 17 00:00:00 2001 From: Stephan Peijnik Date: Tue, 7 Jul 2009 18:44:10 +0200 Subject: Removed separate way of defining Py_ssize_t in progress.h. Now using method present in generic.h in progress.cc. --- debian/changelog | 2 +- python/progress.cc | 1 + python/progress.h | 6 ------ 3 files changed, 2 insertions(+), 7 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index db6204ba..ce96cc9e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -python-apt (0.7.10.4) UNRELEASED; urgency=low +python-apt (0.7.11.0) UNRELEASED; urgency=low [ Stephan Peijnik ] * apt/progress/__init__.py: diff --git a/python/progress.cc b/python/progress.cc index cbb49671..94debe40 100644 --- a/python/progress.cc +++ b/python/progress.cc @@ -13,6 +13,7 @@ #include #include #include +#include "generic.h" #include "progress.h" // generic diff --git a/python/progress.h b/python/progress.h index 659eb113..29243bfc 100644 --- a/python/progress.h +++ b/python/progress.h @@ -15,12 +15,6 @@ #include #include -/* Python 2.4 compatibility */ -#if (PY_VERSION_HEX < 0x02050000) -typedef int Py_ssize_t; -#endif - - /* PyCbObj_BEGIN_ALLOW_THREADS and PyCbObj_END_ALLOW_THREADS are sligthly * modified versions of Py_BEGIN_ALLOW_THREADS and Py_END_ALLOW_THREADS. * Instead of storing the thread state in a function-local variable these -- cgit v1.2.3 From d445714639596ac57d4dfeb44eb6ca69fbea8190 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 13 Jul 2009 14:51:21 +0200 Subject: * aptsources/distro.py: - fix indent error that causes incorrect sources.list additons (LP: #372224) --- aptsources/distro.py | 4 ++-- debian/changelog | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/aptsources/distro.py b/aptsources/distro.py index bbb8ba50..5398d4a3 100644 --- a/aptsources/distro.py +++ b/aptsources/distro.py @@ -319,12 +319,12 @@ class Distribution: if s.type == self.binary_type: if s.dist not in comps_per_dist: comps_per_dist[s.dist] = set() - map(comps_per_dist[s.dist].add, s.comps) + map(comps_per_dist[s.dist].add, s.comps) for s in self.source_code_sources: if s.type == self.source_type: if s.dist not in comps_per_sdist: comps_per_sdist[s.dist] = set() - map(comps_per_sdist[s.dist].add, s.comps) + map(comps_per_sdist[s.dist].add, s.comps) # check if there is a main source at all if len(self.main_sources) < 1: diff --git a/debian/changelog b/debian/changelog index db6204ba..cb1c932e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,11 @@ python-apt (0.7.10.4) UNRELEASED; urgency=low * python/progress.cc: - low level code for update_status_full and pulse_items() - better threading support + + [ Michael Vogt ] + * aptsources/distro.py: + - fix indent error that causes incorrect sources.list additons + (LP: #372224) -- Michael Vogt Tue, 05 May 2009 11:57:57 +0200 -- cgit v1.2.3 From e803243b0ba177176eba83e9037a8bcf3913740d Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 20 Jul 2009 16:42:21 +0200 Subject: releasing version 0.7.11.0 --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 0e4731f6..c7016fc5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -python-apt (0.7.11.0) UNRELEASED; urgency=low +python-apt (0.7.11.0) unstable; urgency=low [ Julian Andres Klode ] * data/templates/Debian.info.in: Squeeze will be 6.0, not 5.1 -- cgit v1.2.3 From d724db2ef374c97e05f19d6e0bedb6a933426147 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 27 Jul 2009 11:17:52 +0200 Subject: * python/tag.cc: - merge patch from John Wright that adds FindRaw method (closes: #538723) --- debian/changelog | 8 +++++++- python/tag.cc | 24 ++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 5a5b7529..e0bc5a6f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,15 @@ python-apt (0.7.11.1) UNRELEASED; urgency=low + [ Stephan Peijnik ] * apt/progress/__init__.py: - Exception handling fixes in InstallProgress class. + + [ Michael Vogt ] + * python/tag.cc: + - merge patch from John Wright that adds FindRaw method + (closes: #538723) - -- Stephan Peijnik Sat, 25 Jul 2009 10:37:11 +0200 + -- Michael Vogt Mon, 27 Jul 2009 11:17:27 +0200 python-apt (0.7.11.0) unstable; urgency=low diff --git a/python/tag.cc b/python/tag.cc index 217be290..6fe97ed5 100644 --- a/python/tag.cc +++ b/python/tag.cc @@ -92,6 +92,29 @@ static PyObject *TagSecFind(PyObject *Self,PyObject *Args) return PyString_FromStringAndSize(Start,Stop-Start); } +static char *doc_FindRaw = "FindRaw(Name) -> String/None"; +static PyObject *TagSecFindRaw(PyObject *Self,PyObject *Args) +{ + char *Name = 0; + char *Default = 0; + if (PyArg_ParseTuple(Args,"s|z",&Name,&Default) == 0) + return 0; + + unsigned Pos; + if (GetCpp(Self).Find(Name,Pos) == false) + { + if (Default == 0) + Py_RETURN_NONE; + return PyString_FromString(Default); + } + + const char *Start; + const char *Stop; + GetCpp(Self).Get(Start,Stop,Pos); + + return PyString_FromStringAndSize(Start,Stop-Start); +} + static char *doc_FindFlag = "FindFlag(Name) -> integer/none"; static PyObject *TagSecFindFlag(PyObject *Self,PyObject *Args) { @@ -355,6 +378,7 @@ static PyMethodDef TagSecMethods[] = { // Query {"Find",TagSecFind,METH_VARARGS,doc_Find}, + {"FindRaw",TagSecFindRaw,METH_VARARGS,doc_FindRaw}, {"FindFlag",TagSecFindFlag,METH_VARARGS,doc_FindFlag}, {"Bytes",TagSecBytes,METH_VARARGS,doc_Bytes}, -- cgit v1.2.3 From 4d211f682d1fb100049898b4f0675eed1faa5c4e Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 29 Jul 2009 22:13:20 +0200 Subject: releasing version 0.7.11.1 --- debian/changelog | 4 +- po/python-apt.pot | 127 ++++++++++++++++++++++++++++++------------------------ 2 files changed, 73 insertions(+), 58 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index e0bc5a6f..a47510c4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -python-apt (0.7.11.1) UNRELEASED; urgency=low +python-apt (0.7.11.1) unstable; urgency=low [ Stephan Peijnik ] * apt/progress/__init__.py: @@ -9,7 +9,7 @@ python-apt (0.7.11.1) UNRELEASED; urgency=low - merge patch from John Wright that adds FindRaw method (closes: #538723) - -- Michael Vogt Mon, 27 Jul 2009 11:17:27 +0200 + -- Michael Vogt Wed, 29 Jul 2009 19:15:56 +0200 python-apt (0.7.11.0) unstable; urgency=low diff --git a/po/python-apt.pot b/po/python-apt.pot index 02120bfa..f904a0c5 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: 2009-07-03 12:55+0200\n" +"POT-Creation-Date: 2009-07-24 13:56+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -24,236 +24,246 @@ msgstr "" #. Description #: ../data/templates/Ubuntu.info.in:13 -msgid "Ubuntu 9.04 'Jaunty Jackalope'" +msgid "Ubuntu 9.10 'Karmic Koala'" msgstr "" #. Description #: ../data/templates/Ubuntu.info.in:31 -msgid "Cdrom with Ubuntu 9.04 'Jaunty Jackalope'" +msgid "Cdrom with Ubuntu 9.10 'Karmic Koala'" msgstr "" #. Description #: ../data/templates/Ubuntu.info.in:74 -msgid "Ubuntu 8.10 'Intrepid Ibex'" +msgid "Ubuntu 9.04 'Jaunty Jackalope'" msgstr "" #. Description #: ../data/templates/Ubuntu.info.in:92 +msgid "Cdrom with Ubuntu 9.04 'Jaunty Jackalope'" +msgstr "" + +#. Description +#: ../data/templates/Ubuntu.info.in:135 +msgid "Ubuntu 8.10 'Intrepid Ibex'" +msgstr "" + +#. Description +#: ../data/templates/Ubuntu.info.in:153 msgid "Cdrom with Ubuntu 8.10 'Intrepid Ibex'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:136 +#: ../data/templates/Ubuntu.info.in:197 msgid "Ubuntu 8.04 'Hardy Heron'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:154 +#: ../data/templates/Ubuntu.info.in:215 msgid "Cdrom with Ubuntu 8.04 'Hardy Heron'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:191 +#: ../data/templates/Ubuntu.info.in:252 msgid "Ubuntu 7.10 'Gutsy Gibbon'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:209 +#: ../data/templates/Ubuntu.info.in:270 msgid "Cdrom with Ubuntu 7.10 'Gutsy Gibbon'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:244 +#: ../data/templates/Ubuntu.info.in:305 msgid "Ubuntu 7.04 'Feisty Fawn'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:262 +#: ../data/templates/Ubuntu.info.in:323 msgid "Cdrom with Ubuntu 7.04 'Feisty Fawn'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:296 +#: ../data/templates/Ubuntu.info.in:357 msgid "Ubuntu 6.10 'Edgy Eft'" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:301 +#: ../data/templates/Ubuntu.info.in:362 msgid "Community-maintained" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:307 +#: ../data/templates/Ubuntu.info.in:368 msgid "Restricted software" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:314 +#: ../data/templates/Ubuntu.info.in:375 msgid "Cdrom with Ubuntu 6.10 'Edgy Eft'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:348 +#: ../data/templates/Ubuntu.info.in:409 msgid "Ubuntu 6.06 LTS 'Dapper Drake'" msgstr "" #. CompDescriptionLong -#: ../data/templates/Ubuntu.info.in:351 +#: ../data/templates/Ubuntu.info.in:412 msgid "Canonical-supported Open Source software" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:353 +#: ../data/templates/Ubuntu.info.in:414 msgid "Community-maintained (universe)" msgstr "" #. CompDescriptionLong -#: ../data/templates/Ubuntu.info.in:354 +#: ../data/templates/Ubuntu.info.in:415 msgid "Community-maintained Open Source software" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:356 +#: ../data/templates/Ubuntu.info.in:417 msgid "Non-free drivers" msgstr "" #. CompDescriptionLong -#: ../data/templates/Ubuntu.info.in:357 +#: ../data/templates/Ubuntu.info.in:418 msgid "Proprietary drivers for devices" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:359 +#: ../data/templates/Ubuntu.info.in:420 msgid "Restricted software (Multiverse)" msgstr "" #. CompDescriptionLong -#: ../data/templates/Ubuntu.info.in:360 +#: ../data/templates/Ubuntu.info.in:421 msgid "Software restricted by copyright or legal issues" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:366 +#: ../data/templates/Ubuntu.info.in:427 msgid "Cdrom with Ubuntu 6.06 LTS 'Dapper Drake'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:378 +#: ../data/templates/Ubuntu.info.in:439 msgid "Important security updates" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:383 +#: ../data/templates/Ubuntu.info.in:444 msgid "Recommended updates" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:388 +#: ../data/templates/Ubuntu.info.in:449 msgid "Pre-released updates" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:393 +#: ../data/templates/Ubuntu.info.in:454 msgid "Unsupported updates" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:400 +#: ../data/templates/Ubuntu.info.in:461 msgid "Ubuntu 5.10 'Breezy Badger'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:414 +#: ../data/templates/Ubuntu.info.in:475 msgid "Cdrom with Ubuntu 5.10 'Breezy Badger'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:426 +#: ../data/templates/Ubuntu.info.in:487 msgid "Ubuntu 5.10 Security Updates" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:431 +#: ../data/templates/Ubuntu.info.in:492 msgid "Ubuntu 5.10 Updates" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:436 +#: ../data/templates/Ubuntu.info.in:497 msgid "Ubuntu 5.10 Backports" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:443 +#: ../data/templates/Ubuntu.info.in:504 msgid "Ubuntu 5.04 'Hoary Hedgehog'" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:457 +#: ../data/templates/Ubuntu.info.in:518 msgid "Cdrom with Ubuntu 5.04 'Hoary Hedgehog'" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:460 ../data/templates/Debian.info.in:123 +#: ../data/templates/Ubuntu.info.in:521 ../data/templates/Debian.info.in:148 msgid "Officially supported" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:469 +#: ../data/templates/Ubuntu.info.in:530 msgid "Ubuntu 5.04 Security Updates" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:474 +#: ../data/templates/Ubuntu.info.in:535 msgid "Ubuntu 5.04 Updates" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:479 +#: ../data/templates/Ubuntu.info.in:540 msgid "Ubuntu 5.04 Backports" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:485 +#: ../data/templates/Ubuntu.info.in:546 msgid "Ubuntu 4.10 'Warty Warthog'" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:491 +#: ../data/templates/Ubuntu.info.in:552 msgid "Community-maintained (Universe)" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:493 +#: ../data/templates/Ubuntu.info.in:554 msgid "Non-free (Multiverse)" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:499 +#: ../data/templates/Ubuntu.info.in:560 msgid "Cdrom with Ubuntu 4.10 'Warty Warthog'" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:502 +#: ../data/templates/Ubuntu.info.in:563 msgid "No longer officially supported" msgstr "" #. CompDescription -#: ../data/templates/Ubuntu.info.in:504 +#: ../data/templates/Ubuntu.info.in:565 msgid "Restricted copyright" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:511 +#: ../data/templates/Ubuntu.info.in:572 msgid "Ubuntu 4.10 Security Updates" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:516 +#: ../data/templates/Ubuntu.info.in:577 msgid "Ubuntu 4.10 Updates" msgstr "" #. Description -#: ../data/templates/Ubuntu.info.in:521 +#: ../data/templates/Ubuntu.info.in:582 msgid "Ubuntu 4.10 Backports" msgstr "" @@ -265,51 +275,56 @@ msgstr "" #. Description #: ../data/templates/Debian.info.in:8 -msgid "Debian 5.0 'Lenny' " +msgid "Debian 6.0 'Squeeze' " msgstr "" #. Description #: ../data/templates/Debian.info.in:33 -msgid "Debian 4.0 'Etch'" +msgid "Debian 5.0 'Lenny' " msgstr "" #. Description #: ../data/templates/Debian.info.in:58 +msgid "Debian 4.0 'Etch'" +msgstr "" + +#. Description +#: ../data/templates/Debian.info.in:83 msgid "Debian 3.1 'Sarge'" msgstr "" #. Description -#: ../data/templates/Debian.info.in:69 +#: ../data/templates/Debian.info.in:94 msgid "Proposed updates" msgstr "" #. Description -#: ../data/templates/Debian.info.in:76 +#: ../data/templates/Debian.info.in:101 msgid "Security updates" msgstr "" #. Description -#: ../data/templates/Debian.info.in:83 +#: ../data/templates/Debian.info.in:108 msgid "Debian current stable release" msgstr "" #. Description -#: ../data/templates/Debian.info.in:96 +#: ../data/templates/Debian.info.in:121 msgid "Debian testing" msgstr "" #. Description -#: ../data/templates/Debian.info.in:121 +#: ../data/templates/Debian.info.in:146 msgid "Debian 'Sid' (unstable)" msgstr "" #. CompDescription -#: ../data/templates/Debian.info.in:125 +#: ../data/templates/Debian.info.in:150 msgid "DFSG-compatible Software with Non-Free Dependencies" msgstr "" #. CompDescription -#: ../data/templates/Debian.info.in:127 +#: ../data/templates/Debian.info.in:152 msgid "Non-DFSG-compatible Software" msgstr "" -- cgit v1.2.3 From 0181690f1cdc4ffbc3192b9b93d13d9a9a1f8f83 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 30 Jul 2009 14:10:35 +0200 Subject: * python/cache.cc: - Support Breaks, Enhances dependency types (Closes: #416247) --- debian/changelog | 7 +++++++ python/cache.cc | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index a47510c4..7fb62a1d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +python-apt (0.7.11.2) unstable; urgency=low + + * python/cache.cc: + - Support Breaks, Enhances dependency types (Closes: #416247) + + -- Julian Andres Klode Thu, 30 Jul 2009 14:08:30 +0200 + python-apt (0.7.11.1) unstable; urgency=low [ Stephan Peijnik ] diff --git a/python/cache.cc b/python/cache.cc index 0c59f561..c7e5e76e 100644 --- a/python/cache.cc +++ b/python/cache.cc @@ -502,7 +502,7 @@ static PyObject *MakeDepends(PyObject *Owner,pkgCache::VerIterator &Ver, { "", "Depends","PreDepends","Suggests", "Recommends","Conflicts","Replaces", - "Obsoletes" + "Obsoletes", "Breaks", "Enhances" }; PyObject *Dep = PyString_FromString(Types[Start->Type]); LastDepType = Start->Type; -- cgit v1.2.3 From 13e0a6ca024397dba39ad66bcb0fd80138b1bd55 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 30 Jul 2009 14:12:24 +0200 Subject: debian/control: Only recommend libjs-jquery (Closes: #527543) --- debian/changelog | 1 + debian/control | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 7fb62a1d..f63ddee2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ python-apt (0.7.11.2) unstable; urgency=low * python/cache.cc: - Support Breaks, Enhances dependency types (Closes: #416247) + * debian/control: Only recommend libjs-jquery (Closes: #527543) -- Julian Andres Klode Thu, 30 Jul 2009 14:08:30 +0200 diff --git a/debian/control b/debian/control index 4c7b542f..17084419 100644 --- a/debian/control +++ b/debian/control @@ -22,9 +22,8 @@ Vcs-Browser: http://bzr.debian.org/loggerhead/apt/python-apt/debian-sid/changes Package: python-apt Architecture: any -Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}, lsb-release, - libjs-jquery -Recommends: iso-codes +Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}, lsb-release +Recommends: iso-codes, libjs-jquery Breaks: debdelta (<< 0.28~) Provides: ${python:Provides} Suggests: python-apt-dbg, python-gtk2, python-vte -- cgit v1.2.3 From d907d8627ab4080cff7ab99dfb2e16970d063990 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 30 Jul 2009 14:14:16 +0200 Subject: debian/python-apt.doc-base: register the documentation with the doc-base system (Closes: #525134) --- debian/changelog | 7 ++++++- debian/python-apt.doc-base | 11 +++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 debian/python-apt.doc-base (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index f63ddee2..74224c32 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,13 @@ python-apt (0.7.11.2) unstable; urgency=low + [ Julian Andres Klode ] * python/cache.cc: - Support Breaks, Enhances dependency types (Closes: #416247) - * debian/control: Only recommend libjs-jquery (Closes: #527543) + * debian/control: Only recommend libjs-jquery (Closes: #527543) + + [ Stefano Zacchiroli ] + * debian/python-apt.doc-base: register the documentation with the + doc-base system (Closes: #525134) -- Julian Andres Klode Thu, 30 Jul 2009 14:08:30 +0200 diff --git a/debian/python-apt.doc-base b/debian/python-apt.doc-base new file mode 100644 index 00000000..d25926b7 --- /dev/null +++ b/debian/python-apt.doc-base @@ -0,0 +1,11 @@ +Document: python-apt-api-reference +Title: Python APT: API reference manual +Abstract: API reference manual for Python bindings to libapt-pkg +Section: Programming/Python + +Format: HTML +Index: /usr/share/doc/python-apt/html/index.html +Files: /usr/share/doc/python-apt/html/* + +Format: Text +Files: /usr/share/doc/python-apt/text/* -- cgit v1.2.3 From a33de8e29160276e3dbd6a11812c7ec7dd532997 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 30 Jul 2009 14:17:31 +0200 Subject: * debian/control: Build-depend on libapt-pkg-dev (>= 0.7.22~) Enhances needs it. --- debian/changelog | 4 +++- debian/control | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 74224c32..b12c156e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,7 +3,9 @@ python-apt (0.7.11.2) unstable; urgency=low [ Julian Andres Klode ] * python/cache.cc: - Support Breaks, Enhances dependency types (Closes: #416247) - * debian/control: Only recommend libjs-jquery (Closes: #527543) + * debian/control: + - Only recommend libjs-jquery (Closes: #527543) + - Build-depend on libapt-pkg-dev (>= 0.7.22~) [ Stefano Zacchiroli ] * debian/python-apt.doc-base: register the documentation with the diff --git a/debian/control b/debian/control index 17084419..234eaaad 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ XS-Python-Version: all Build-Depends: apt-utils, cdbs, debhelper (>= 5.0.37.1), - libapt-pkg-dev (>= 0.7.10), + libapt-pkg-dev (>= 0.7.22~), python-all-dbg, python-all-dev, python-central (>= 0.5), -- cgit v1.2.3 From 85707b8b52eba15c2ed8328e4f55f794bd242a71 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 30 Jul 2009 14:29:15 +0200 Subject: * apt/cache.py: Call InitSystem() if rootdir is not None (LP: #320665). --- apt/cache.py | 3 +++ debian/changelog | 3 +++ 2 files changed, 6 insertions(+) (limited to 'debian') diff --git a/apt/cache.py b/apt/cache.py index 94a77fd8..efa8afb3 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -63,6 +63,9 @@ class Cache(object): # create required dirs/files when run with special rootdir # automatically self._check_and_create_required_dirs(rootdir) + # Call InitSystem so the change to Dir::State::Status is actually + # recognized (LP: #320665) + apt_pkg.InitSystem() self.open(progress) def _check_and_create_required_dirs(self, rootdir): diff --git a/debian/changelog b/debian/changelog index b12c156e..66f2c052 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,9 @@ python-apt (0.7.11.2) unstable; urgency=low * debian/control: - Only recommend libjs-jquery (Closes: #527543) - Build-depend on libapt-pkg-dev (>= 0.7.22~) + * apt/cache.py: + - Correctly handle rootdir on second and later invocations of + open(), by calling InitSystem again. (LP: #320665). [ Stefano Zacchiroli ] * debian/python-apt.doc-base: register the documentation with the -- cgit v1.2.3 From eadd9977838ee990a06d5f5702313f81c824d51d Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 30 Jul 2009 14:31:04 +0200 Subject: debian/control: Update Standards-Version to 3.8.2 --- debian/changelog | 1 + debian/control | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 66f2c052..e95a3fe2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,7 @@ python-apt (0.7.11.2) unstable; urgency=low * debian/control: - Only recommend libjs-jquery (Closes: #527543) - Build-depend on libapt-pkg-dev (>= 0.7.22~) + - Update Standards-Version to 3.8.2 * apt/cache.py: - Correctly handle rootdir on second and later invocations of open(), by calling InitSystem again. (LP: #320665). diff --git a/debian/control b/debian/control index 234eaaad..83b2e421 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: python Priority: optional Maintainer: APT Development Team Uploaders: Michael Vogt , Julian Andres Klode -Standards-Version: 3.8.1 +Standards-Version: 3.8.2 XS-Python-Version: all Build-Depends: apt-utils, cdbs, -- cgit v1.2.3 From 2b64e774ba825789caea80d9424faf1ac3be19d9 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 30 Jul 2009 14:36:35 +0200 Subject: apt/progress.py: Extract the package name from the status message (Closes: #532660) --- apt/progress/__init__.py | 5 +++-- debian/changelog | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/apt/progress/__init__.py b/apt/progress/__init__.py index b582ad22..b9288c2c 100644 --- a/apt/progress/__init__.py +++ b/apt/progress/__init__.py @@ -344,7 +344,7 @@ class DpkgInstallProgress(InstallProgress): if pid == 0: # child res = os.system("/usr/bin/dpkg --status-fd %s -i %s" % \ - (self.writefd, self.debfile)) + (self.writefd, debfile)) os._exit(os.WEXITSTATUS(res)) self.child_pid = pid res = self.waitChild() @@ -370,10 +370,11 @@ class DpkgInstallProgress(InstallProgress): print "got garbage from dpkg: '%s'" % self.read self.read = "" break + pkg_name = statusl[1].strip() status = statusl[2].strip() #print status if status == "error": - self.error(self.debname, status) + self.error(pkg_name, status) elif status == "conffile-prompt": # we get a string like this: # 'current-conffile' 'new-conffile' useredited distedited diff --git a/debian/changelog b/debian/changelog index e95a3fe2..83422b00 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,6 +15,10 @@ python-apt (0.7.11.2) unstable; urgency=low * debian/python-apt.doc-base: register the documentation with the doc-base system (Closes: #525134) + [ Sebastian Heinlein ] + * apt/progress.py: Extract the package name from the status message + (Closes: #532660) + -- Julian Andres Klode Thu, 30 Jul 2009 14:08:30 +0200 python-apt (0.7.11.1) unstable; urgency=low -- cgit v1.2.3 From 4e66ff1d8fea8631af4656d824b7d6f94f9486c4 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 30 Jul 2009 14:39:56 +0200 Subject: apt/cache.py: Provide broken_count, delete_count, install_count, keep_count properties (Closes: #532338) --- apt/cache.py | 20 ++++++++++++++++++++ debian/changelog | 2 ++ 2 files changed, 22 insertions(+) (limited to 'debian') diff --git a/apt/cache.py b/apt/cache.py index efa8afb3..31e14561 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -332,6 +332,26 @@ class Cache(object): self._callbacks[name] = [] self._callbacks[name].append(callback) + @property + def broken_count(self): + """Return the number of packages with broken dependencies.""" + return self._depcache.broken_count + + @property + def delete_count(self): + """Return the number of packages marked for deletion.""" + return self._depcache.del_count + + @property + def install_count(self): + """Return the number of packages marked for installation.""" + return self._depcache.inst_count + + @property + def keep_count(self): + """Return the number of packages marked as keep.""" + return self._depcache.keep_count + # ----------------------------- experimental interface diff --git a/debian/changelog b/debian/changelog index 83422b00..73e9eab7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,8 @@ python-apt (0.7.11.2) unstable; urgency=low * apt/cache.py: - Correctly handle rootdir on second and later invocations of open(), by calling InitSystem again. (LP: #320665). + - Provide broken_count, delete_count, install_count, keep_count + properties (Closes: #532338) [ Stefano Zacchiroli ] * debian/python-apt.doc-base: register the documentation with the -- cgit v1.2.3 From 00ebd1e79986dad66829edaf8dc906a4c9d1ab6c Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 30 Jul 2009 14:47:59 +0200 Subject: apt/package.py: Allow to set the candidate of a package (Closes: #523997) + Support assignments to the 'candidate' property of Package objects. + Initial patch by Sebastian Heinlein --- apt/package.py | 16 +++++++++++++--- debian/changelog | 4 ++++ 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'debian') diff --git a/apt/package.py b/apt/package.py index ec88a456..f5bdc47d 100644 --- a/apt/package.py +++ b/apt/package.py @@ -486,15 +486,25 @@ class Package(object): def __repr__(self): return '' % (self._pkg.Name, self._pkg.ID) - @property def candidate(self): """Return the candidate version of the package. - - :since: 0.7.9""" + + This property is writeable to allow you to set the candidate version + of the package. Just assign a Version() object, and it will be set as + the candidate version. + """ cand = self._pcache._depcache.GetCandidateVer(self._pkg) if cand is not None: return Version(self, cand) + def __set_candidate(self, version): + """Set the candidate version of the package.""" + self._pcache.cachePreChange() + self._pcache._depcache.SetCandidateVer(self._pkg, version._cand) + self._pcache.cachePostChange() + + candidate = property(candidate, __set_candidate) + @property def installed(self): """Return the currently installed version of the package. diff --git a/debian/changelog b/debian/changelog index 73e9eab7..fcc7fd9b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,10 @@ python-apt (0.7.11.2) unstable; urgency=low open(), by calling InitSystem again. (LP: #320665). - Provide broken_count, delete_count, install_count, keep_count properties (Closes: #532338) + * apt/package.py: + - Allow to set the candidate of a package (Closes: #523997) + + Support assignments to the 'candidate' property of Package objects. + + Initial patch by Sebastian Heinlein [ Stefano Zacchiroli ] * debian/python-apt.doc-base: register the documentation with the -- cgit v1.2.3 From 82166c78d6b21754bdad32ed8a94773a874d528f Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 30 Jul 2009 15:00:44 +0200 Subject: Only create Package objects when they are requested, do not keep them in a dict. Saves 10MB for 25,000 packages on my machine. --- apt/cache.py | 42 ++++++++++++++++++++++++++---------------- debian/changelog | 2 ++ 2 files changed, 28 insertions(+), 16 deletions(-) (limited to 'debian') diff --git a/apt/cache.py b/apt/cache.py index 31e14561..c1e2428c 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -20,6 +20,7 @@ # USA import os +import weakref import apt_pkg from apt import Package @@ -47,6 +48,8 @@ class Cache(object): def __init__(self, progress=None, rootdir=None, memonly=False): self._callbacks = {} + self._weakref = weakref.WeakValueDictionary() + self._set = set() if memonly: # force apt to build its caches in memory apt_pkg.Config.Set("Dir::Cache::pkgcache", "") @@ -96,7 +99,7 @@ class Cache(object): for callback in self._callbacks[name]: callback() - def open(self, progress): + def open(self, progress=None): """ Open the package cache, after that it can be used like a dictionary """ @@ -108,7 +111,8 @@ class Cache(object): self._records = apt_pkg.GetPkgRecords(self._cache) self._list = apt_pkg.GetPkgSourceList() self._list.ReadMainList() - self._dict = {} + self._set.clear() + self._weakref.clear() progress.Op = "Building data structures" i=last=0 @@ -119,7 +123,7 @@ class Cache(object): last=i # drop stuff with no versions (cruft) if len(pkg.VersionList) > 0: - self._dict[pkg.Name] = Package(self, pkg) + self._set.add(pkg.Name) i += 1 @@ -128,30 +132,36 @@ class Cache(object): def __getitem__(self, key): """ look like a dictionary (get key) """ - return self._dict[key] + try: + return self._weakref[key] + except KeyError: + if key in self._set: + pkg = self._weakref[key] = Package(self, self._cache[key]) + return pkg + else: + raise KeyError('The cache has no package named %r' % key) def __iter__(self): - for pkgname in self._dict.keys(): - yield self._dict[pkgname] + for pkgname in self._set: + yield self[pkgname] raise StopIteration def has_key(self, key): - return (key in self._dict) + return (key in self._set) def __contains__(self, key): - return (key in self._dict) + return (key in self._set) def __len__(self): - return len(self._dict) + return len(self._set) def keys(self): - return self._dict.keys() + return list(self._set) def getChanges(self): """ Get the marked changes """ changes = [] - for name in self._dict.keys(): - p = self._dict[name] + for p in self: if p.markedUpgrade or p.markedInstall or p.markedDelete or \ p.markedDowngrade or p.markedReinstall: changes.append(p) @@ -396,7 +406,7 @@ class FilteredCache(object): return len(self._filtered) def __getitem__(self, key): - return self.cache._dict[key] + return self.cache[key] def __iter__(self): for pkgname in self._filtered: @@ -414,10 +424,10 @@ class FilteredCache(object): def _reapplyFilter(self): " internal helper to refilter " self._filtered = {} - for pkg in self.cache._dict.keys(): + for pkg in self.cache: for f in self._filters: - if f.apply(self.cache._dict[pkg]): - self._filtered[pkg] = 1 + if f.apply(pkg): + self._filtered[pkg.name] = 1 break def setFilter(self, filter): diff --git a/debian/changelog b/debian/changelog index fcc7fd9b..298c0ac6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,8 @@ python-apt (0.7.11.2) unstable; urgency=low open(), by calling InitSystem again. (LP: #320665). - Provide broken_count, delete_count, install_count, keep_count properties (Closes: #532338) + - Only create Package objects when they are requested, do not keep them in + a dict. Saves 10MB for 25,000 packages on my machine. * apt/package.py: - Allow to set the candidate of a package (Closes: #523997) + Support assignments to the 'candidate' property of Package objects. -- cgit v1.2.3