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(-) 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 80bd612d4006a493541ca8f50b1634ee529cb533 Mon Sep 17 00:00:00 2001 From: Stephan Peijnik Date: Sat, 25 Jul 2009 10:35:21 +0200 Subject: Exception handling fixes in InstallProgress class. --- apt/progress/__init__.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/apt/progress/__init__.py b/apt/progress/__init__.py index 3be197f7..b582ad22 100644 --- a/apt/progress/__init__.py +++ b/apt/progress/__init__.py @@ -286,11 +286,20 @@ class InstallProgress(DumbInstallProgress): def waitChild(self): """Wait for child progress to exit.""" while True: - select.select([self.statusfd], [], [], self.selectTimeout) - self.updateInterface() - (pid, res) = os.waitpid(self.child_pid, os.WNOHANG) - if pid == self.child_pid: + try: + select.select([self.statusfd], [], [], self.selectTimeout) + except select.error, (errno_, errstr): + if errno_ != errno.EINTR: + raise break + self.updateInterface() + try: + (pid, res) = os.waitpid(self.child_pid, os.WNOHANG) + if pid == self.child_pid: + break + except OSError, (errno_, errstr): + if errno_ != errno.EINTR: + raise return res def run(self, pm): -- 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(-) 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(-) 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(-) 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(-) 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 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(-) 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(+) 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(-) 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(-) 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(+) 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(-) 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(-) 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 From 5441b32e4b56bfc79610bd32b4fe3c4c4b5671dc Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 30 Jul 2009 15:55:35 +0200 Subject: Use debhelper 7 instead of CDBS --- debian/changelog | 3 ++- debian/compat | 2 +- debian/control | 7 +++---- debian/python-apt-dbg.install | 1 + debian/python-apt.docs | 2 ++ debian/python-apt.install | 9 +++++--- debian/rules | 48 ++++++++++++------------------------------- 7 files changed, 28 insertions(+), 44 deletions(-) create mode 100644 debian/python-apt-dbg.install diff --git a/debian/changelog b/debian/changelog index 298c0ac6..2c27b23d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -python-apt (0.7.11.2) unstable; urgency=low +python-apt (0.7.12.0) unstable; urgency=low [ Julian Andres Klode ] * python/cache.cc: @@ -18,6 +18,7 @@ python-apt (0.7.11.2) unstable; urgency=low - Allow to set the candidate of a package (Closes: #523997) + Support assignments to the 'candidate' property of Package objects. + Initial patch by Sebastian Heinlein + * Use debhelper 7 instead of CDBS [ Stefano Zacchiroli ] * debian/python-apt.doc-base: register the documentation with the diff --git a/debian/compat b/debian/compat index 7ed6ff82..7f8f011e 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -5 +7 diff --git a/debian/control b/debian/control index 83b2e421..1d3a9dd3 100644 --- a/debian/control +++ b/debian/control @@ -6,11 +6,10 @@ Uploaders: Michael Vogt , Julian Andres Klode Standards-Version: 3.8.2 XS-Python-Version: all Build-Depends: apt-utils, - cdbs, - debhelper (>= 5.0.37.1), + debhelper (>= 7.3.5), libapt-pkg-dev (>= 0.7.22~), - python-all-dbg, - python-all-dev, + python-all-dbg (>= 2.5.4-1), + python-all-dev (>= 2.5.4-1), python-central (>= 0.5), python-debian, python-distutils-extra (>= 1.9.0), diff --git a/debian/python-apt-dbg.install b/debian/python-apt-dbg.install new file mode 100644 index 00000000..1bbba721 --- /dev/null +++ b/debian/python-apt-dbg.install @@ -0,0 +1 @@ +usr/lib/python*/*/*_d.so diff --git a/debian/python-apt.docs b/debian/python-apt.docs index 6ba083f5..177b5837 100644 --- a/debian/python-apt.docs +++ b/debian/python-apt.docs @@ -1,4 +1,6 @@ README +AUTHORS +TODO apt/README.apt data/templates/README.templates build/doc/html/ diff --git a/debian/python-apt.install b/debian/python-apt.install index 4910e8ed..ca86ed11 100644 --- a/debian/python-apt.install +++ b/debian/python-apt.install @@ -1,3 +1,6 @@ -debian/tmp/usr/lib/python* -debian/tmp/usr/share/locale -debian/tmp/usr/share/python-apt +usr/lib/python*/*/apt_pkg.so +usr/lib/python*/*/apt_inst.so +usr/lib/python*/*/*/ +usr/lib/python*/*/*.egg-info +usr/share/locale +usr/share/python-apt diff --git a/debian/rules b/debian/rules index 6d709ecd..6e2204cf 100755 --- a/debian/rules +++ b/debian/rules @@ -1,42 +1,20 @@ #!/usr/bin/make -f - -DEB_AUTO_CLEANUP_RCS := yes -DEB_PYTHON_SYSTEM=pycentral - export DH_PYCENTRAL=nomove +export DEBVER=$(shell dpkg-parsechangelog | sed -n -e 's/^Version: //p') +export CFLAGS=-Wno-write-strings -DEB_PYTHON_PACKAGES_EXCLUDE=python-apt-dbg - -# Add here any variable or target overrides you need -include /usr/share/cdbs/1/rules/debhelper.mk -include /usr/share/cdbs/1/class/python-distutils.mk - -PKG=python-apt -DEBVER=$(shell dpkg-parsechangelog |sed -n -e '/^Version:/s/^Version: //p') -DEB_COMPRESS_EXCLUDE:=.html .js _static/* _sources/* _sources/*/* .inv -DEB_BUILD_PROG:=debuild --preserve-envvar PATH --preserve-envvar CCACHE_DIR -us -uc $(DEB_BUILD_PROG_OPTS) -export DEBVER - -build/python-apt-dbg:: - set -e; \ - for i in $(cdbs_python_build_versions); do \ - python$$i-dbg ./setup.py build; \ - done - -install/python-apt-dbg:: - for i in $(cdbs_python_build_versions); do \ - python$$i-dbg ./setup.py install --root $(CURDIR)/debian/python-apt-dbg; \ - done - find debian/python-apt-dbg \ - ! -type d ! -name '*_d.so' | xargs rm -f - find debian/python-apt-dbg -depth -empty -exec rmdir {} \; - -binary-predeb/python-apt:: - ln -sf ../../../../javascript/jquery/jquery.js debian/python-apt/usr/share/doc/python-apt/html/_static/jquery.js +%: + dh --with python-central $@ -binary-predeb/python-apt-dbg:: +override_dh_installdocs: + dh_installdocs + ln -sf ../../../../javascript/jquery/jquery.js \ + debian/python-apt/usr/share/doc/python-apt/html/_static/jquery.js rm -rf debian/python-apt-dbg/usr/share/doc/python-apt-dbg ln -s python-apt debian/python-apt-dbg/usr/share/doc/python-apt-dbg -clean:: - rm -rf build/lib* build/temp* +override_dh_strip: + dh_strip --dbg-package=python-apt-dbg + +override_dh_compress: + dh_compress -X.js -X_static/* -X _sources/* -X_sources/*/* -X.inv -- cgit v1.2.3 From 0cb44e7c914bf98d92a85d83b0bdc15ebc73525d Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 30 Jul 2009 17:44:49 +0200 Subject: apt/package.py: Make comparisons of Version object more robust. --- apt/package.py | 40 +++++++++++++++++++++++++++++++++++----- debian/changelog | 13 +++++++------ 2 files changed, 42 insertions(+), 11 deletions(-) diff --git a/apt/package.py b/apt/package.py index f5bdc47d..0b8d4bf8 100644 --- a/apt/package.py +++ b/apt/package.py @@ -189,17 +189,47 @@ class Version(object): self.package = package self._cand = cand + def _cmp(self, other): + try: + return apt_pkg.VersionCompare(self._cand.VerStr, other.version) + except AttributeError: + return apt_pkg.VersionCompare(self._cand.VerStr, other) + def __eq__(self, other): - return self._cand.ID == other._cand.ID + try: + return self._cmp(other) == 0 + except TypeError: + return NotImplemented + + def __ge__(self): + try: + return self._cmp(other) >= 0 + except TypeError: + return NotImplemented def __gt__(self, other): - return apt_pkg.VersionCompare(self.version, other.version) > 0 + try: + return self._cmp(other) > 0 + except TypeError: + return NotImplemented + + def __le__(self): + try: + return self._cmp(other) <= 0 + except TypeError: + return NotImplemented def __lt__(self, other): - return apt_pkg.VersionCompare(self.version, other.version) < 0 + try: + return self._cmp(other) < 0 + except TypeError: + return NotImplemented def __ne__(self, other): - return not self.__eq__(other) + try: + return self._cmp(other) != 0 + except TypeError: + return NotImplemented def __hash__(self): return self._cand.Hash @@ -488,7 +518,7 @@ class Package(object): def candidate(self): """Return the candidate version of the package. - + 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. diff --git a/debian/changelog b/debian/changelog index 2c27b23d..122ebe92 100644 --- a/debian/changelog +++ b/debian/changelog @@ -18,6 +18,7 @@ python-apt (0.7.12.0) unstable; urgency=low - Allow to set the candidate of a package (Closes: #523997) + Support assignments to the 'candidate' property of Package objects. + Initial patch by Sebastian Heinlein + - Make comparisons of Version object more robust. * Use debhelper 7 instead of CDBS [ Stefano Zacchiroli ] @@ -26,7 +27,7 @@ python-apt (0.7.12.0) unstable; urgency=low [ Sebastian Heinlein ] * apt/progress.py: Extract the package name from the status message - (Closes: #532660) + (Closes: #532660) -- Julian Andres Klode Thu, 30 Jul 2009 14:08:30 +0200 @@ -35,7 +36,7 @@ python-apt (0.7.11.1) unstable; 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 @@ -50,15 +51,15 @@ python-apt (0.7.11.0) unstable; urgency=low [ Stephan Peijnik ] * apt/progress/__init__.py: - - add update_status_full() that takes file_size/partial_size as + - add update_status_full() that takes file_size/partial_size as additional callback arguments - - add pulse_items() that takes a addtional "items" tuple that + - 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() - better threading support - + [ Michael Vogt ] * aptsources/distro.py: - fix indent error that causes incorrect sources.list additons @@ -70,7 +71,7 @@ python-apt (0.7.11.0) unstable; urgency=low required dirs/files automatically -- Michael Vogt Mon, 20 Jul 2009 15:35:27 +0200 - + python-apt (0.7.10.4) unstable; urgency=low [ Michael Vogt ] -- cgit v1.2.3 From e1fe8a0fdc56452f820c837a323729d93f57f581 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 30 Jul 2009 17:49:35 +0200 Subject: Return VersionList objects in Package.versions, which are sequences and also provide features of mappings. (partial API BREAK) --- apt/package.py | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- debian/changelog | 2 ++ 2 files changed, 85 insertions(+), 3 deletions(-) diff --git a/apt/package.py b/apt/package.py index 0b8d4bf8..73ca5da0 100644 --- a/apt/package.py +++ b/apt/package.py @@ -29,11 +29,16 @@ import subprocess import urllib2 import warnings +try: + from collections import Sequence +except ImportError: + Sequence = object + import apt_pkg import apt.progress __all__ = ('BaseDependency', 'Dependency', 'Origin', 'Package', 'Record', - 'Version') + 'Version', 'VersionList') def _(string): @@ -499,6 +504,81 @@ class Version(object): return os.path.abspath(dsc) +class VersionList(Sequence): + """Provide a mapping & sequence interface to all versions of a package. + + This class can be used like a dictionary, where version strings are the + keys. It can also be used as a sequence, where integers are the keys. + + You can also convert this to a dictionary or a list, using the usual way + of dict(version_list) or list(version_list). This is useful if you need + to access the version objects multiple times, because they do not have to + be recreated this way. + + Examples ('package.versions' being a version list): + '0.7.92' in package.versions # Check whether 0.7.92 is a valid version. + package.versions[0] # Return first version or raise IndexError + package.versions[0:2] # Return a new VersionList for objects 0-2 + package.versions['0.7.92'] # Return version 0.7.92 or raise KeyError + package.versions.keys() # All keys, as strings. + max(package.versions) + """ + + def __init__(self, package, slice=None): + self._package = package # apt.package.Package() + self._versions = package._pkg.VersionList # [apt_pkg.Version(), ...] + if slice: + self._versions = self._versions[slice] + + def __getitem__(self, item): + if isinstance(item, slice): + return self.__class__(self._package, item) + try: + # Sequence interface, item is an integer + return Version(self._package, self._versions[item]) + except TypeError: + # Dictionary interface item is a string. + for ver in self._versions: + if ver.ver_str == item: + return Version(self._package, ver) + raise KeyError("Version: %r not found." % (item)) + + def __repr__(self): + return '' % self.keys() + + def __iter__(self): + """Return an iterator over all value objects.""" + return (Version(self._package, ver) for ver in self._versions) + + def __contains__(self, item): + if isinstance(item, Version): # Sequence interface + item = item.version + # Dictionary interface. + for ver in self._versions: + if ver.ver_str == item: + return True + return False + + def __eq__(self, other): + return list(self) == list(other) + + def __len__(self): + return len(self._versions) + + # Mapping interface + + def keys(self): + """Return a list of all versions, as strings.""" + return [ver.VerStr for ver in self._versions] + + def get(self, key, default=None): + """Return the key or the default.""" + try: + return self[key] + except LookupError: + return default + + class Package(object): """Representation of a package in a cache. @@ -911,11 +991,11 @@ class Package(object): @property def versions(self): - """Return a list of versions. + """Return a VersionList() object for all available versions. :since: 0.7.9 """ - return [Version(self, ver) for ver in self._pkg.VersionList] + return VersionList(self) # depcache actions diff --git a/debian/changelog b/debian/changelog index 122ebe92..c4ba63fc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,6 +19,8 @@ python-apt (0.7.12.0) unstable; urgency=low + Support assignments to the 'candidate' property of Package objects. + Initial patch by Sebastian Heinlein - Make comparisons of Version object more robust. + - Return VersionList objects in Package.versions, which are sequences + and also provide features of mappings. (partial API BREAK) * Use debhelper 7 instead of CDBS [ Stefano Zacchiroli ] -- cgit v1.2.3 From d5465906199b5c866db900b99b59c107cb46055d Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 30 Jul 2009 17:53:34 +0200 Subject: debian/changelog: Close #523998 as well --- debian/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/changelog b/debian/changelog index c4ba63fc..c2d30cf9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -21,6 +21,7 @@ python-apt (0.7.12.0) unstable; urgency=low - Make comparisons of Version object more robust. - Return VersionList objects in Package.versions, which are sequences and also provide features of mappings. (partial API BREAK) + + Allows to get a specific version (Closes: #523998) * Use debhelper 7 instead of CDBS [ Stefano Zacchiroli ] -- cgit v1.2.3 From bb517c1da9e82d36b2c599f308d5451be68fadcb Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 30 Jul 2009 18:29:13 +0200 Subject: apt/progress/__init__.py: Fix InstallProgress.waitChild() - Do not break out of InstallProgress.waitChild()'s loop just because it is hitting EINTR, but only on child exit or on ECHILD. --- apt/progress/__init__.py | 5 +++-- debian/changelog | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apt/progress/__init__.py b/apt/progress/__init__.py index b9288c2c..337bd161 100644 --- a/apt/progress/__init__.py +++ b/apt/progress/__init__.py @@ -112,7 +112,7 @@ class FetchProgress(object): This happens eg. when the downloads fails or is completed. """ - def update_status_full(self, uri, descr, short_descr, status, file_size, + def update_status_full(self, uri, descr, short_descr, status, file_size, partial_size): """Called when the status of an item changes. @@ -291,7 +291,6 @@ class InstallProgress(DumbInstallProgress): except select.error, (errno_, errstr): if errno_ != errno.EINTR: raise - break self.updateInterface() try: (pid, res) = os.waitpid(self.child_pid, os.WNOHANG) @@ -300,6 +299,8 @@ class InstallProgress(DumbInstallProgress): except OSError, (errno_, errstr): if errno_ != errno.EINTR: raise + if errno_ == errno.ECHILD: + break return res def run(self, pm): diff --git a/debian/changelog b/debian/changelog index c2d30cf9..49c74106 100644 --- a/debian/changelog +++ b/debian/changelog @@ -22,6 +22,9 @@ python-apt (0.7.12.0) unstable; urgency=low - Return VersionList objects in Package.versions, which are sequences and also provide features of mappings. (partial API BREAK) + Allows to get a specific version (Closes: #523998) + * apt/progress/__init__.py: + - Do not break out of InstallProgress.waitChild()'s loop just because it + is hitting EINTR, but only on child exit or on ECHILD. * Use debhelper 7 instead of CDBS [ Stefano Zacchiroli ] -- cgit v1.2.3 From 1d67c8142d295004c894473df5457b8ce9ed6197 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 30 Jul 2009 19:07:33 +0200 Subject: debian/control: Do not use versioned build-deps on python-all-{dev,dbg}. Debhelper should conflict against older versions, as it uses --install-layout. But we should'nt do debhelper's work here. --- debian/control | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index 1d3a9dd3..6d27549a 100644 --- a/debian/control +++ b/debian/control @@ -8,8 +8,8 @@ XS-Python-Version: all Build-Depends: apt-utils, debhelper (>= 7.3.5), libapt-pkg-dev (>= 0.7.22~), - python-all-dbg (>= 2.5.4-1), - python-all-dev (>= 2.5.4-1), + python-all-dbg, + python-all-dev, python-central (>= 0.5), python-debian, python-distutils-extra (>= 1.9.0), -- cgit v1.2.3