From 0a6e7dc1aac196e640bda1160c9561a398d76044 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 17 May 2006 18:11:55 +0200 Subject: * apt/package.py: - check if _lookupRecords() succeeded when checking description/maintainer --- apt/package.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/apt/package.py b/apt/package.py index 4fceb904..55e1cd01 100644 --- a/apt/package.py +++ b/apt/package.py @@ -49,7 +49,7 @@ class Package(object): # check if we found a version if ver == None: - #print "No version for: %s (Candidate: %s)" % (self._pkg.Name, UseCandidate) + print "No version for: %s (Candidate: %s)" % (self._pkg.Name, UseCandidate) return False if ver.FileList == None: @@ -149,13 +149,15 @@ class Package(object): def summary(self): """ Return the short description (one line summary) """ - self._lookupRecord() + if not self._lookupRecord(): + return "" return self._records.ShortDesc summary = property(summary) def description(self, format=True): """ Return the formated long description """ - self._lookupRecord() + if not self._lookupRecord(): + return "" desc = "" for line in string.split(self._records.LongDesc, "\n"): tmp = string.strip(line) @@ -168,7 +170,8 @@ class Package(object): def rawDescription(self): """ return the long description (raw)""" - self._lookupRecord() + if not self._lookupRecord(): + return "" return self._records.LongDesc rawDescription = property(rawDescription) -- cgit v1.2.3 From 9835bc4332eba7c3a7ab27290cf103d10a8d090f Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 17 May 2006 18:12:04 +0200 Subject: * changelog updates --- debian/changelog | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index e1dfd27a..896e4a0d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,8 +9,12 @@ python-apt (0.6.17) unstable; urgency=low - fix various pychecker warnings * apt/cache.py: - return useful values on Cache.update() - * apt/cache.py, apt/package.py: fix various pychecker warnings - * apt/cache.py: Release locks on failure (thanks to Colin Watson) + - Release locks on failure (thanks to Colin Watson) + - fix various pychecker warnings + * apt/package.py: + - fix various pychecker warnings + - check if looupRecords succeeded + * apt/cache.py: * python/srcrecords.cc: - add "Restart" method - don't run auto "Restart" before performing a Lookup -- cgit v1.2.3 From 5042fb1f6160381c18a4add7076e8da175cba2d0 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 17 May 2006 18:14:20 +0200 Subject: * remove debug string --- apt/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apt/package.py b/apt/package.py index 55e1cd01..53f6c1f5 100644 --- a/apt/package.py +++ b/apt/package.py @@ -49,7 +49,7 @@ class Package(object): # check if we found a version if ver == None: - print "No version for: %s (Candidate: %s)" % (self._pkg.Name, UseCandidate) + #print "No version for: %s (Candidate: %s)" % (self._pkg.Name, UseCandidate) return False if ver.FileList == None: -- cgit v1.2.3 From 52ae9a181314398e4dc4996d1409e99b9bdbbf7e Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 17 May 2006 18:41:09 +0200 Subject: * apt/package.py: - actually return values in {candiate,installed}Downloadable() --- apt/package.py | 4 ++-- debian/changelog | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apt/package.py b/apt/package.py index 53f6c1f5..7297a1bb 100644 --- a/apt/package.py +++ b/apt/package.py @@ -105,12 +105,12 @@ class Package(object): return ver.Downloadable def candidateDownloadable(self): " returns if the canidate is downloadable " - self._downloadable(useCandidate=True) + return self._downloadable(useCandidate=True) candidateDownloadable = property(candidateDownloadable) def installedDownloadable(self): " returns if the installed version is downloadable " - self._downloadable(useCandidate=False) + return self._downloadable(useCandidate=False) installedDownloadable = property(installedDownloadable) def sourcePackageName(self): diff --git a/debian/changelog b/debian/changelog index 896e4a0d..5eac06d1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,7 @@ python-apt (0.6.17) unstable; urgency=low * apt/package.py: - fix various pychecker warnings - check if looupRecords succeeded + - fix bug in the return statement of _downloadable() * apt/cache.py: * python/srcrecords.cc: - add "Restart" method -- cgit v1.2.3 From 0bb531dbcf27b40861467b831b120fc8b257e8ff Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 9 Jun 2006 17:38:18 +0200 Subject: * changelog updated * prints_uris.py example added --- debian/changelog | 10 +++++++++- doc/examples/print_uris.py | 22 ++++++++++++++++++++++ doc/examples/sources.py | 2 +- 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100755 doc/examples/print_uris.py diff --git a/debian/changelog b/debian/changelog index 5eac06d1..a1a9858e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +python-apt (0.6.18) unstable; urgency=low + + * doc/examples/print_uris.py: + - added a example to show how the indexfile.ArchiveURI() can be used + with binary packages + + -- + python-apt (0.6.17) unstable; urgency=low * apt/progress.py: @@ -24,7 +32,7 @@ python-apt (0.6.17) unstable; urgency=low * python/indexfile.cc: - added ArchiveURI() method - -- + -- Michael Vogt Mon, 8 May 2006 22:34:58 +0200 python-apt (0.6.16.2) unstable; urgency=low diff --git a/doc/examples/print_uris.py b/doc/examples/print_uris.py new file mode 100755 index 00000000..c8a64223 --- /dev/null +++ b/doc/examples/print_uris.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +# +# a example that prints the URIs of all upgradable packages +# + +import apt +import apt_pkg + + +cache = apt.Cache() +upgradable = filter(lambda p: p.isUpgradable, cache) + + +for pkg in upgradable: + pkg._lookupRecord(True) + path = apt_pkg.ParseSection(pkg._records.Record)["Filename"] + cand = pkg._depcache.GetCandidateVer(pkg._pkg) + for (packagefile,i) in cand.FileList: + indexfile = cache._list.FindIndex(packagefile) + if indexfile: + uri = indexfile.ArchiveURI(path) + print uri diff --git a/doc/examples/sources.py b/doc/examples/sources.py index 78913523..c12c6f15 100644 --- a/doc/examples/sources.py +++ b/doc/examples/sources.py @@ -11,5 +11,5 @@ sources = apt_pkg.GetPkgSrcRecords() sources.Restart() while sources.Lookup('hello'): print sources.Package, sources.Version, sources.Maintainer, sources.Section, `sources.Binaries` - #print sources.Files + print sources.Files print sources.Index.ArchiveURI("") -- cgit v1.2.3 From 22e59d0dc92c45ea63d75d73474b5be610e57a58 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Mon, 12 Jun 2006 18:48:16 -0300 Subject: * apt/cache.py: - fix commit doc string to also cite the open related callbacks --- 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 01034cf9..8410fc56 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -218,7 +218,7 @@ class Cache(object): def connect(self, name, callback): """ connect to a signal, currently only used for - cache_{post,pre}_changed """ + cache_{post,pre}_{changed,open} """ if not self._callbacks.has_key(name): self._callbacks[name] = [] self._callbacks[name].append(callback) diff --git a/debian/changelog b/debian/changelog index a1a9858e..ff62eac6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,14 @@ python-apt (0.6.18) unstable; urgency=low + [ Michael Vogt ] * doc/examples/print_uris.py: - added a example to show how the indexfile.ArchiveURI() can be used with binary packages + [ Otavio Salvador ] + * apt/cache.py: + - fix commit doc string to also cite the open related callbacks + -- python-apt (0.6.17) unstable; urgency=low -- cgit v1.2.3 From 473031d5c8273643592d2f269fd532afb560303c Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Wed, 14 Jun 2006 00:31:49 -0300 Subject: - allow change of rootdir for APT database loading --- apt/cache.py | 6 +++++- debian/changelog | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apt/cache.py b/apt/cache.py index 8410fc56..690510e3 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -31,10 +31,14 @@ class Cache(object): dictionary """ - def __init__(self, progress=None): + def __init__(self, progress=None, rootdir=None): self._callbacks = {} self.open(progress) + if rootdir: + apt_pkg.Config.Set("Dir", rootdir) + apt_pkg.Config.Set("Dir::State::status", rootdir + "/var/lib/dpkg/status") + def _runCallbacks(self, name): """ internal helper to run a callback """ if self._callbacks.has_key(name): diff --git a/debian/changelog b/debian/changelog index ff62eac6..287605e0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,7 @@ python-apt (0.6.18) unstable; urgency=low [ Otavio Salvador ] * apt/cache.py: - fix commit doc string to also cite the open related callbacks + - allow change of rootdir for APT database loading -- -- cgit v1.2.3 From 3b12e19d8a19ae319646cc2a97c36e92cf65a1d5 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 15 Jun 2006 08:59:04 +0200 Subject: * apt/packages.py: - add autoInst option --- apt/package.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apt/package.py b/apt/package.py index 7297a1bb..0d1145ea 100644 --- a/apt/package.py +++ b/apt/package.py @@ -290,10 +290,12 @@ class Package(object): Fix.InstallProtect() Fix.Resolve() self._pcache.cachePostChange() - def markInstall(self, autoFix=True): - """ mark a package for install. Run the resolver if autoFix is set """ + def markInstall(self, autoFix=True, autoInst=True): + """ mark a package for install. Run the resolver if autoFix is set, + automatically install required dependencies if autoInst is set + """ self._pcache.cachePreChange() - self._depcache.MarkInstall(self._pkg) + self._depcache.MarkInstall(self._pkg, autoInst) # try to fix broken stuff if autoFix and self._depcache.BrokenCount > 0: fixer = apt_pkg.GetPkgProblemResolver(self._depcache) -- cgit v1.2.3 From 76fb1f457228cc5efa5f45a7a875ec5bc0e17b3a Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 26 Jun 2006 06:08:07 +0200 Subject: * merging the NMU changes --- debian/changelog | 9 ++++++++- debian/control | 39 +++++++-------------------------------- debian/rules | 21 +++++---------------- 3 files changed, 20 insertions(+), 49 deletions(-) diff --git a/debian/changelog b/debian/changelog index 287605e0..d9b428bd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -python-apt (0.6.18) unstable; urgency=low +python-apt (0.6.19) unstable; urgency=low [ Michael Vogt ] * doc/examples/print_uris.py: @@ -12,6 +12,13 @@ python-apt (0.6.18) unstable; urgency=low -- +python-apt (0.6.18) unstable; urgency=low + + * Non-maintainer upload. + * Update for the new Python policy. Closes: #373512 + + -- Raphael Hertzog Sat, 17 Jun 2006 15:09:28 +0200 + python-apt (0.6.17) unstable; urgency=low * apt/progress.py: diff --git a/debian/control b/debian/control index 6966077f..f313dff5 100644 --- a/debian/control +++ b/debian/control @@ -4,42 +4,17 @@ Priority: optional Maintainer: APT Development Team Uploaders: Matt Zimmerman , Michael Vogt Standards-Version: 3.6.2.0 -Build-Depends: debhelper (>= 5.0), libapt-pkg-dev (>= 0.6.40), apt-utils, python-dev, python2.4-dev, python2.3-dev +XS-Python-Version: all +Build-Depends: debhelper (>= 5.0.37.1), libapt-pkg-dev (>= 0.6.40), apt-utils, python-all-dev, python-central Package: python-apt -Architecture: all -Depends: ${python:Depends} -Priority: optional -Description: Python interface to libapt-pkg - The apt-pkg Python interface will provide full access to the internal - libapt-pkg structures allowing Python programs to easily perform a - variety of functions, such as: - . - - Access to the APT configuration system - - Access to the APT package information database - - Parsing of Debian package control files, and other files with a - similar structure - -Package: python2.3-apt Architecture: any -Depends: python2.3, ${shlibs:Depends} -Replaces: python-apt (<< 0.6.11) -Priority: optional -Description: Python interface to libapt-pkg - The apt-pkg Python interface will provide full access to the internal - libapt-pkg structures allowing Python programs to easily perform a - variety of functions, such as: - . - - Access to the APT configuration system - - Access to the APT package information database - - Parsing of Debian package control files, and other files with a - similar structure - -Package: python2.4-apt -Architecture: any -Depends: python2.4, ${shlibs:Depends} -Replaces: python-apt (<< 0.6.11) +Depends: ${python:Depends} Priority: optional +Replaces: python2.3-apt (<< 0.6.18), python2.4-apt (<< 0.6.18) +Conflicts: python2.3-apt (<< 0.6.18), python2.4-apt (<< 0.6.18) +Provides: ${python:Provides} +XB-Python-Version: ${python:Versions} Description: Python interface to libapt-pkg The apt-pkg Python interface will provide full access to the internal libapt-pkg structures allowing Python programs to easily perform a diff --git a/debian/rules b/debian/rules index 584abdf5..ffd39a6f 100755 --- a/debian/rules +++ b/debian/rules @@ -12,7 +12,7 @@ DEB_BUILD_PROG:=debuild --preserve-envvar PATH --preserve-envvar CCACHE_DIR -us # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -PYTHON=python2.3 python2.4 +PYTHON=$(shell pyversions -r debian/control) build: build-stamp build-stamp: @@ -38,18 +38,6 @@ clean: # Build architecture-independent files here. binary-indep: DH_OPTIONS=-i binary-indep: build - dh_testdir - dh_testroot - dh_installdocs - dh_installexamples doc/examples/*.py - dh_installchangelogs - dh_compress - dh_fixperms - dh_installdeb - dh_python - dh_gencontrol - dh_md5sums - dh_builddeb # Build architecture-dependent files here. binary-arch: DH_OPTIONS=-a @@ -57,11 +45,11 @@ binary-arch: build dh_testdir dh_testroot dh_clean -k - + for PY in $(PYTHON); do \ - /usr/bin/$$PY setup.py install --prefix=`pwd`/debian/$${PY}-apt/usr; \ + /usr/bin/$$PY setup.py install --prefix=`pwd`/debian/python-apt/usr; \ done - + dh_installdocs dh_installchangelogs dh_strip @@ -69,6 +57,7 @@ binary-arch: build dh_fixperms dh_installdeb dh_shlibdeps + dh_pycentral dh_python dh_gencontrol dh_md5sums -- cgit v1.2.3 From 7d1a38d1ce6f2f6de7e3fe096eeb0c0f88ab04a1 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Fri, 30 Jun 2006 23:23:10 -0300 Subject: - add dh_installexamples in package building --- debian/changelog | 1 + debian/rules | 1 + 2 files changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index d9b428bd..9f681950 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,7 @@ python-apt (0.6.19) unstable; urgency=low * apt/cache.py: - fix commit doc string to also cite the open related callbacks - allow change of rootdir for APT database loading + - add dh_installexamples in package building -- diff --git a/debian/rules b/debian/rules index ffd39a6f..6a187e7f 100755 --- a/debian/rules +++ b/debian/rules @@ -52,6 +52,7 @@ binary-arch: build dh_installdocs dh_installchangelogs + dh_installexamples dh_strip dh_compress dh_fixperms -- cgit v1.2.3 From 316789f0e803bd5266f3868743f30f10245a6261 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 24 Jul 2006 22:35:28 +0200 Subject: * merged the NMUs from debian --- debian/changelog | 23 +++++++++++++++++++---- debian/control | 2 +- debian/rules | 4 ++-- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9f681950..456fb544 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,8 +10,24 @@ python-apt (0.6.19) unstable; urgency=low - fix commit doc string to also cite the open related callbacks - allow change of rootdir for APT database loading - add dh_installexamples in package building - - -- + + -- + +python-apt (0.6.18-0.2) unstable; urgency=low + + * Non-maintainer upload. + * Add ${shlibs:Depends} and ${misc:Depends} (Closes: #377615). + + -- Christoph Berg Tue, 18 Jul 2006 11:39:52 +0200 + +python-apt (0.6.18-0.1) unstable; urgency=high + + * Non-maintainer upload. + * Call dh_pycentral and dh_python before dh_installdeb, to make sure + the dh_pycentral snippets are put into the maintainer scripts; patch from + Sam Morris. (Closes: #376416) + + -- Steinar H. Gunderson Wed, 12 Jul 2006 23:26:50 +0200 python-apt (0.6.18) unstable; urgency=low @@ -37,7 +53,6 @@ python-apt (0.6.17) unstable; urgency=low - fix various pychecker warnings - check if looupRecords succeeded - fix bug in the return statement of _downloadable() - * apt/cache.py: * python/srcrecords.cc: - add "Restart" method - don't run auto "Restart" before performing a Lookup @@ -46,7 +61,7 @@ python-apt (0.6.17) unstable; urgency=low * python/indexfile.cc: - added ArchiveURI() method - -- Michael Vogt Mon, 8 May 2006 22:34:58 +0200 + -- Michael Vogt Mon, 8 May 2006 22:34:58 +0200 python-apt (0.6.16.2) unstable; urgency=low diff --git a/debian/control b/debian/control index f313dff5..5fa1bc83 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,7 @@ Build-Depends: debhelper (>= 5.0.37.1), libapt-pkg-dev (>= 0.6.40), apt-utils, p Package: python-apt Architecture: any -Depends: ${python:Depends} +Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends} Priority: optional Replaces: python2.3-apt (<< 0.6.18), python2.4-apt (<< 0.6.18) Conflicts: python2.3-apt (<< 0.6.18), python2.4-apt (<< 0.6.18) diff --git a/debian/rules b/debian/rules index 6a187e7f..ee159b89 100755 --- a/debian/rules +++ b/debian/rules @@ -53,13 +53,13 @@ binary-arch: build dh_installdocs dh_installchangelogs dh_installexamples + dh_pycentral + dh_python dh_strip dh_compress dh_fixperms dh_installdeb dh_shlibdeps - dh_pycentral - dh_python dh_gencontrol dh_md5sums dh_builddeb -- cgit v1.2.3 From 481e8bd432099e38aa176a990a7d4b2187e58039 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 25 Jul 2006 11:22:44 +0200 Subject: * debian/changelog: - updated --- debian/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/changelog b/debian/changelog index 456fb544..f556704a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,7 @@ python-apt (0.6.19) unstable; urgency=low * doc/examples/print_uris.py: - added a example to show how the indexfile.ArchiveURI() can be used with binary packages + * re-added dh_installexamples (NMU breakage). Closes: #376014 [ Otavio Salvador ] * apt/cache.py: -- cgit v1.2.3 From 71022104cf64547ba54029555799d72e6fb8027f Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 25 Jul 2006 11:49:10 +0200 Subject: * added debian/examples --- debian/changelog | 3 +-- debian/examples | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 debian/examples diff --git a/debian/changelog b/debian/changelog index f556704a..a086ded0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,13 +4,12 @@ python-apt (0.6.19) unstable; urgency=low * doc/examples/print_uris.py: - added a example to show how the indexfile.ArchiveURI() can be used with binary packages - * re-added dh_installexamples (NMU breakage). Closes: #376014 [ Otavio Salvador ] * apt/cache.py: - fix commit doc string to also cite the open related callbacks - allow change of rootdir for APT database loading - - add dh_installexamples in package building + - add dh_installexamples in package building Closes: #376014 -- diff --git a/debian/examples b/debian/examples new file mode 100644 index 00000000..80a386c8 --- /dev/null +++ b/debian/examples @@ -0,0 +1 @@ +doc/examples/*.py -- cgit v1.2.3