From eef094d6218739bc0147910bfdd478ac10f18ec1 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 22 Mar 2006 15:07:21 +0100 Subject: * added indexFile.ArchiveURI(string) --- doc/examples/indexfile.py | 1 + python/indexfile.cc | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/doc/examples/indexfile.py b/doc/examples/indexfile.py index 5eaab517..d383fd61 100644 --- a/doc/examples/indexfile.py +++ b/doc/examples/indexfile.py @@ -18,3 +18,4 @@ for (f,i) in cand.FileList: print index.IsTrusted print index.Exists print index.HasPackages + print index.ArchiveURI("some/path") diff --git a/python/indexfile.cc b/python/indexfile.cc index 4e106e25..ef6ffc8a 100644 --- a/python/indexfile.cc +++ b/python/indexfile.cc @@ -15,6 +15,22 @@ #include +static PyObject *PackageIndexFileArchiveURI(PyObject *Self,PyObject *Args) +{ + pkgIndexFile *File = GetCpp(Self); + char *path; + + if (PyArg_ParseTuple(Args, "s",&path) == 0) + return 0; + + return HandleErrors(Safe_FromString(File->ArchiveURI(path).c_str())); +} + +static PyMethodDef PackageIndexFileMethods[] = +{ + {"ArchiveURI",PackageIndexFileArchiveURI,METH_VARARGS,"Returns the ArchiveURI"}, + {} +}; static PyObject *PackageIndexFileAttr(PyObject *Self,char *Name) @@ -33,8 +49,7 @@ static PyObject *PackageIndexFileAttr(PyObject *Self,char *Name) else if (strcmp("IsTrusted",Name) == 0) return Py_BuildValue("i",(File->IsTrusted())); - PyErr_SetString(PyExc_AttributeError,Name); - return 0; + return Py_FindMethod(PackageIndexFileMethods,Self,Name); } static PyObject *PackageIndexFileRepr(PyObject *Self) @@ -51,6 +66,7 @@ static PyObject *PackageIndexFileRepr(PyObject *Self) File->IsTrusted(), File->ArchiveURI("").c_str()); return PyString_FromString(S); } + PyTypeObject PackageIndexFileType = { PyObject_HEAD_INIT(&PyType_Type) -- cgit v1.2.3 From 4399788cb0202968a7fe5098050cec8a851bd58f Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 22 Mar 2006 15:23:18 +0100 Subject: * add PkgSrcRecords.Index to the code --- doc/examples/sources.py | 2 +- python/pkgsrcrecords.cc | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/examples/sources.py b/doc/examples/sources.py index 0a90bae9..78913523 100644 --- a/doc/examples/sources.py +++ b/doc/examples/sources.py @@ -12,4 +12,4 @@ sources.Restart() while sources.Lookup('hello'): print sources.Package, sources.Version, sources.Maintainer, sources.Section, `sources.Binaries` #print sources.Files - + print sources.Index.ArchiveURI("") diff --git a/python/pkgsrcrecords.cc b/python/pkgsrcrecords.cc index abb29c74..5e04f5fc 100644 --- a/python/pkgsrcrecords.cc +++ b/python/pkgsrcrecords.cc @@ -96,8 +96,10 @@ static PyObject *PkgSrcRecordsAttr(PyObject *Self,char *Name) *b != 0; ++b) PyList_Append(List, CppPyString(*b)); - return List; // todo + } else if (strcmp("Index",Name) == 0) { + const pkgIndexFile &tmp = Struct.Last->Index(); + return CppOwnedPyObject_NEW(Self,&PackageIndexFileType, (pkgIndexFile*)&tmp); } else if (strcmp("Files",Name) == 0) { PyObject *List = PyList_New(0); -- cgit v1.2.3 From de94cc6cd97201a9cd3fc845b06b97e46251403d Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 22 Mar 2006 15:25:48 +0100 Subject: * updated changelog --- debian/changelog | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 4b677c2e..976e078f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,8 +15,11 @@ python-apt (0.6.16.2) unstable; urgency=low - add "Restart" method - don't run auto "Restart" before performing a Lookup - fix the initalization (no need to pass a PkgCacheType to the records) + - added "Index" attribute + * python/indexfile.cc: + - added ArchiveURI() method - -- Michael Vogt Wed, 22 Mar 2006 11:19:34 +0100 + -- python-apt (0.6.16.1) unstable; urgency=low -- cgit v1.2.3 From 8cc9bc319a5ed5237e4c4a40da241ee1159d9233 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Tue, 28 Mar 2006 08:31:14 -0300 Subject: Fix documentation format. --- python/tar.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/tar.cc b/python/tar.cc index 20fb1f5f..22c0327e 100644 --- a/python/tar.cc +++ b/python/tar.cc @@ -88,7 +88,7 @@ bool ProcessTar::DoItem(Item &Itm,int &Fd) // --------------------------------------------------------------------- /* */ char *doc_tarExtract = -"tarExtract(File,Func,Comp) -> None" +"tarExtract(File,Func,Comp) -> None\n" "The tar file referenced by the file object File, Func called for each\n" "Tar member. Comp must be the string \"gzip\" (gzip is automatically invoked) \n"; PyObject *tarExtract(PyObject *Self,PyObject *Args) @@ -128,7 +128,7 @@ PyObject *tarExtract(PyObject *Self,PyObject *Args) // --------------------------------------------------------------------- /* */ char *doc_debExtract = -"debExtract(File,Func,Chunk) -> None" +"debExtract(File,Func,Chunk) -> None\n" "The deb referenced by the file object File is examined. The AR member\n" "given by Chunk is treated as a tar.gz and fed through Func like\n" "tarExtract\n"; -- cgit v1.2.3 From 1f1cc6179cd9c7f15231a4d082fdbf374ad7cace Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 26 Apr 2006 09:42:54 +0200 Subject: * added a simple "all_deps" recursive example --- doc/examples/all_deps.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 doc/examples/all_deps.py diff --git a/doc/examples/all_deps.py b/doc/examples/all_deps.py new file mode 100644 index 00000000..f4f1741c --- /dev/null +++ b/doc/examples/all_deps.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python + +import sys +import apt + + +def dependencies(cache, pkg, deps, key="Depends"): + #print "pkg: %s (%s)" % (pkg.name, deps) + candver = cache._depcache.GetCandidateVer(pkg._pkg) + if candver == None: + return deps + dependslist = candver.DependsList + if dependslist.has_key(key): + for depVerList in dependslist[key]: + for dep in depVerList: + if cache.has_key(dep.TargetPkg.Name): + if pkg.name != dep.TargetPkg.Name and not dep.TargetPkg.Name in deps: + deps.add(dep.TargetPkg.Name) + dependencies(cache, cache[dep.TargetPkg.Name], deps, key) + return deps + + +pkgname = sys.argv[1] +c = apt.Cache() +pkg = c[pkgname] + +deps = set() + +deps = dependencies(c,pkg, deps, "Depends") +print " ".join(deps) + +preDeps = set() +preDeps = dependencies(c,pkg, preDeps, "PreDepends") +print " ".join(preDeps) -- cgit v1.2.3 From 0e8fd33b1b741cc65c284a08faa50b3a2995ac3c Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 26 Apr 2006 10:17:09 +0200 Subject: * debian/compat: - debhelper compat level set to 5 * debian/changelog: - merged the changelog from the NMU * debian/control: - merged the changes from the NMU - set standards version to 3.6.2.0 * debian/rules: - fix arch-build target * setup.py: - simplify the patch magling by using map() instead of "for i in range()" --- debian/changelog | 13 +++++++++++-- debian/compat | 1 + debian/control | 8 ++++---- debian/rules | 5 +---- setup.py | 18 +++++++----------- 5 files changed, 24 insertions(+), 21 deletions(-) create mode 100644 debian/compat diff --git a/debian/changelog b/debian/changelog index 976e078f..e1dfd27a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -python-apt (0.6.16.2) unstable; urgency=low +python-apt (0.6.17) unstable; urgency=low * apt/progress.py: - initialize FetchProgress.eta with the correct type @@ -19,8 +19,17 @@ python-apt (0.6.16.2) unstable; urgency=low * python/indexfile.cc: - added ArchiveURI() method - -- + -- +python-apt (0.6.16.2) unstable; urgency=low + + * Non-maintainer upload. + * debian/control: + + Replaces: python-apt (<< 0.6.11), instead of Conflicts which is not + correct here. (closes: #308586). + + -- Pierre Habouzit Fri, 14 Apr 2006 19:30:51 +0200 + python-apt (0.6.16.1) unstable; urgency=low * memleak fixed when pkgCache objects are deallocated diff --git a/debian/compat b/debian/compat new file mode 100644 index 00000000..7813681f --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +5 \ No newline at end of file diff --git a/debian/control b/debian/control index bfa67c67..6966077f 100644 --- a/debian/control +++ b/debian/control @@ -3,8 +3,8 @@ Section: python Priority: optional Maintainer: APT Development Team Uploaders: Matt Zimmerman , Michael Vogt -Standards-Version: 3.6.1.1 -Build-Depends: debhelper (>= 4.2.28), libapt-pkg-dev (>= 0.6.40), apt-utils, python-dev, python2.4-dev, python2.3-dev +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 Package: python-apt Architecture: all @@ -23,7 +23,7 @@ Description: Python interface to libapt-pkg Package: python2.3-apt Architecture: any Depends: python2.3, ${shlibs:Depends} -Conflicts: python-apt (<< 0.6.11) +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 @@ -38,7 +38,7 @@ Description: Python interface to libapt-pkg Package: python2.4-apt Architecture: any Depends: python2.4, ${shlibs:Depends} -Conflicts: python-apt (<< 0.6.11) +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 diff --git a/debian/rules b/debian/rules index 0ab6fa27..584abdf5 100755 --- a/debian/rules +++ b/debian/rules @@ -6,9 +6,6 @@ # This has to be exported to make some magic below work. export DH_OPTIONS -# This is the debhelper compatibility version to use. -export DH_COMPAT=3 - DEBVER=$(shell dpkg-parsechangelog |sed -n -e '/^Version:/s/^Version: //p') DEB_BUILD_PROG:=debuild --preserve-envvar PATH --preserve-envvar CCACHE_DIR -us -uc $(DEB_BUILD_PROG_OPTS) @@ -83,7 +80,7 @@ source diff: arch-build: rm -rf debian/arch-build mkdir -p debian/arch-build/python-apt-$(DEBVER) - baz inventory -s | xargs cp -a --parents --target=debian/arch-build/python-apt-$(DEBVER) + tar -c --exclude=arch-build --no-recursion -f - `bzr inventory` | (cd debian/arch-build/python-apt-$(DEBVER);tar xf -) (cd debian/arch-build/python-apt-$(DEBVER); $(DEB_BUILD_PROG)) binary: binary-indep binary-arch diff --git a/setup.py b/setup.py index f9255607..5adb0376 100644 --- a/setup.py +++ b/setup.py @@ -7,22 +7,18 @@ import string, glob # The apt_pkg module -files = string.split(parse_makefile("python/makefile")["APT_PKG_SRC"]); -for i in range(0,len(files)): - files[i] = "python/"+ files[i]; -apt_pkg = Extension("apt_pkg", files, - libraries=["apt-pkg"]); +files = map(lambda source: "python/"+source, + string.split(parse_makefile("python/makefile")["APT_PKG_SRC"])) +apt_pkg = Extension("apt_pkg", files, libraries=["apt-pkg"]); # The apt_inst module -files = string.split(parse_makefile("python/makefile")["APT_INST_SRC"]); -for i in range(0,len(files)): - files[i] = "python/"+ files[i]; -apt_inst = Extension("apt_inst", files, - libraries=["apt-pkg","apt-inst"]); +files = map(lambda source: "python/"+source, + string.split(parse_makefile("python/makefile")["APT_INST_SRC"])) +apt_inst = Extension("apt_inst", files, libraries=["apt-pkg","apt-inst"]); setup(name="python-apt", - version="0.6.13", + version="0.6.17", description="Python bindings for APT", author="APT Development Team", author_email="deity@lists.debian.org", -- cgit v1.2.3 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 From e7fde76bef8ba317cd6cc681c21c27d4aad13199 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 26 Jul 2006 18:46:03 +0200 Subject: * support sha256 as well --- debian/changelog | 4 +++- python/apt_pkgmodule.cc | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index a086ded0..ba6c47f6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ 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 + * python/apt_pkgmodule.cc: + - export sha256 generation [ Otavio Salvador ] * apt/cache.py: @@ -11,7 +13,7 @@ python-apt (0.6.19) unstable; urgency=low - allow change of rootdir for APT database loading - add dh_installexamples in package building Closes: #376014 - -- + -- python-apt (0.6.18-0.2) unstable; urgency=low diff --git a/python/apt_pkgmodule.cc b/python/apt_pkgmodule.cc index e73628c3..01e9c200 100644 --- a/python/apt_pkgmodule.cc +++ b/python/apt_pkgmodule.cc @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -232,6 +233,43 @@ static PyObject *sha1sum(PyObject *Self,PyObject *Args) return CppPyString(Sum.Result().Value()); } + PyErr_SetString(PyExc_TypeError,"Only understand strings and files"); + return 0; +} + /*}}}*/ +// sha256sum - Compute the sha1sum of a file or string /*{{{*/ +// --------------------------------------------------------------------- +static char *doc_sha256sum = "sha256sum(String) -> String or sha256sum(File) -> String"; +static PyObject *sha256sum(PyObject *Self,PyObject *Args) +{ + PyObject *Obj; + if (PyArg_ParseTuple(Args,"O",&Obj) == 0) + return 0; + + // Digest of a string. + if (PyString_Check(Obj) != 0) + { + SHA256Summation Sum; + Sum.Add(PyString_AsString(Obj)); + return CppPyString(Sum.Result().Value()); + } + + // Digest of a file + if (PyFile_Check(Obj) != 0) + { + SHA256Summation Sum; + int Fd = fileno(PyFile_AsFile(Obj)); + struct stat St; + if (fstat(Fd,&St) != 0 || + Sum.AddFD(Fd,St.st_size) == false) + { + PyErr_SetFromErrno(PyExc_SystemError); + return 0; + } + + return CppPyString(Sum.Result().Value()); + } + PyErr_SetString(PyExc_TypeError,"Only understand strings and files"); return 0; } @@ -370,6 +408,7 @@ static PyMethodDef methods[] = // Stuff {"md5sum",md5sum,METH_VARARGS,doc_md5sum}, {"sha1sum",sha1sum,METH_VARARGS,doc_sha1sum}, + {"sha256sum",sha1sum,METH_VARARGS,doc_sha256sum}, // Strings {"CheckDomainList",StrCheckDomainList,METH_VARARGS,"CheckDomainList(String,String) -> Bool"}, -- cgit v1.2.3 From 8d79b99c1a3338e31e8def858cee3209824ae8bf Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 26 Jul 2006 18:59:40 +0200 Subject: * #cough# - actually use sha256 --- debian/changelog | 2 +- python/apt_pkgmodule.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index ba6c47f6..783e510f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,7 +13,7 @@ python-apt (0.6.19) unstable; urgency=low - allow change of rootdir for APT database loading - add dh_installexamples in package building Closes: #376014 - -- + -- Michael Vogt Wed, 26 Jul 2006 18:51:56 +0200 python-apt (0.6.18-0.2) unstable; urgency=low diff --git a/python/apt_pkgmodule.cc b/python/apt_pkgmodule.cc index 01e9c200..b1c5c2a5 100644 --- a/python/apt_pkgmodule.cc +++ b/python/apt_pkgmodule.cc @@ -408,7 +408,7 @@ static PyMethodDef methods[] = // Stuff {"md5sum",md5sum,METH_VARARGS,doc_md5sum}, {"sha1sum",sha1sum,METH_VARARGS,doc_sha1sum}, - {"sha256sum",sha1sum,METH_VARARGS,doc_sha256sum}, + {"sha256sum",sha256sum,METH_VARARGS,doc_sha256sum}, // Strings {"CheckDomainList",StrCheckDomainList,METH_VARARGS,"CheckDomainList(String,String) -> Bool"}, -- cgit v1.2.3