summaryrefslogtreecommitdiff
path: root/python/cache.cc
AgeCommit message (Collapse)AuthorFilesLines
2010-06-01revert commit 346 (this re-enable the deprecation warnings)Michael Vogt1-10/+7
2010-06-01* merge from debian bzr, remaining changes:Michael Vogt1-87/+266
- different mirror list * data/templates/gNewSense.info.in, data/templates/gNewSense.mirrors: - add gNewSense template and mirrors, thanks to Karl Goetz * apt/cache.py: - Make Cache.get_changes() much (~35x) faster (Closes: #578074). - Make Cache.req_reinstall_pkgs much faster as well. - Make Cache.get_providing_packages() about 1000 times faster. - Use has_versions and has_provides from apt_pkg.Package where possible. * apt/package.py: - Decode using utf-8 in installed_files (LP: #407953). - Fix fetch_source() to work when source name = binary name (LP: #552400). - Merge a patch from Sebastian Heinlein to make get_changelog() only check sources where source version >= binary version (Closes: #581831). - Add Version.source_version and enhance Sebastian's patch to make use of it, in order to find the best changelog for the package. * python: - Return bool instead of int to Python where possible, looks better. - Document every class, function, property. * python/cache.cc: - Check that 2nd argument to Cache.update() really is a SourceList object. - Fix PackageFile.not_automatic to use NotAutomatic instead of NotSource. - Add Package.has_versions to see which packages have at least one version, and Package.has_provides for provides. - Add rich compare methods to the Version object. * python/generic.cc: - Fix a memory leak when using old attribute names. - Map ArchiveURI property to archive_uri * python/progress.cc: - Do not pass arguments to InstallProgress.wait_child(). * doc: - Update the long documentation. * debian/control: - Change priority to standard, keep -doc and -dev on optional. * utils/migrate-0.8.py: - Open files in universal newline support and pass filename to ast.parse. - Add has_key to the list of deprecated functions. - Don't abort if parsing failed. - do not require files to end in .py if they are passed on the command line or if they contain python somewhere in the shebang line. * apt/cache.py: - make cache open silent by default (use apt.progress.base.OpProgress) * tests/data/aptsources_ports/sources.list: - fix ports test-data * tests/test_apt_cache.py: - add simple test for basic cache/dependency iteration
2010-04-21python: Commit documentation changes suggested by debian-l10n-english.Julian Andres Klode1-32/+39
2010-04-21python/cache.cc: Add Package.has_provides to see which packages are provided ↵Julian Andres Klode1-0/+8
at least once.
2010-04-21Add rich compare methods to the Version object.Julian Andres Klode1-1/+20
2010-04-21Add Package.has_versions to see which packages have at least one version.Julian Andres Klode1-0/+9
2010-04-14merged -r 396..397 from the debian-sid branchMichael Vogt1-1/+1
2010-04-01python: Document every class, function, property.Julian Andres Klode1-72/+208
Finally, a complete reference to apt_pkg available via pydoc and __doc__ attributes.
2010-04-01python: Return bool instead of int to Python where possible, looks better.Julian Andres Klode1-8/+8
2010-04-01Fix PackageFile.not_automatic to use NotAutomatic instead of NotSource.Julian Andres Klode1-1/+1
2010-03-31merged from http://bzr.debian.org/apt/python-apt/debian-sid/Michael Vogt1-1/+2
2010-03-31* python/cache.cc:Julian Andres Klode1-1/+2
- Check that 2nd argument to Cache.update() really is a SourceList object.
2010-03-29If PYTHON_APT_DEPRECATION_WARNINGS is unset, also disable theJulian Andres Klode1-7/+10
deprecation warnings in apt_pkg directly; and don't just disable any deprecation warning in apt/__init__.py (LP: #548623)
2010-02-27* python:Julian Andres Klode1-82/+6
- Handle deprecated attributes and methods in the tp_gettattro slot, this allows us to easily warn if a deprecated function is used.
2010-02-27* python/cache.cc:Julian Andres Klode1-5/+22
- Implement Cache.__len__() and Cache.__contains__() (Closes: #571443).
2010-01-27Merge the CppOwnedPyObject C++ class into CppPyObject.Julian Andres Klode1-57/+57
2010-01-15Merge 0.7.13.5 pre.Julian Andres Klode1-11/+26
2010-01-13* python/cache.cc:Michael Vogt1-11/+16
- add UntranslatedDepType attribute to DependencyType - add DepTypeEnum that returns a value from {DepDepends, DepPreDepends, ...} * python/apt_pkgmodule.cc: - add DepDpkgBreaks, DepEnhances constants * doc/source/apt_pkg/{cache.rst, index.rst}: - update documentation as well
2009-08-21Merge 0.7.13.0 from unstable.Julian Andres Klode1-2/+3
2009-08-21python/cache.cc: Set default pulseInterval to 0 (matches apt-pkg's default).Julian Andres Klode1-1/+1
2009-08-19* apt/cache.py, python/cache.cc:Michael Vogt1-2/+3
- add optional pulseIntevall option to "update()" * po/python-apt.pot: - refreshed
2009-07-31python: Remove the progress classes in apt_pkg.Julian Andres Klode1-6/+0
They have been replaced with apt.progress.base, so stuff like GTK+ or Qt progress classes can be written using subclassing.
2009-07-30* python/cache.cc:Julian Andres Klode1-1/+1
- Support Breaks, Enhances dependency types (Closes: #416247)
2009-07-24python: Fix some more possible NULL issues.Julian Andres Klode1-2/+4
2009-07-24python/cache.cc: Fix segfault if Pkg->Section == NULL.Julian Andres Klode1-14/+15
2009-07-17python/cache.cc: Only support new OpProgress() objects in apt_pkg.Cache().Julian Andres Klode1-1/+9
2009-07-17python: Use PyString_FromFormat instead of snprintf.Julian Andres Klode1-37/+30
2009-07-13python: No zero-size arrays for char *kwlist[].Julian Andres Klode1-1/+1
2009-07-13python: Rename all PyTypeObject's to conform to PEP 7.Julian Andres Klode1-30/+30
This is the first step towards implementing coding guidelines for the C++ code and providing an usable C++ API.
2009-07-12python/cache.cc: Set NoDelete for Caches, instead of using the wrong dealloc ↵Julian Andres Klode1-1/+3
function.
2009-07-12python/cache.cc: Py_DECREF the CacheFile, so it can be deleted.Julian Andres Klode1-1/+1
2009-06-25python: Use PyVarObject_HEAD_INIT() instead of PyObject_HEAD_INIT().Julian Andres Klode1-36/+9
This is related to PEP 3123 and fixes some compiler warnings.
2009-06-25python: Fix some build warnings.Julian Andres Klode1-5/+4
2009-06-25python/cache.cc: Support unicode objects and str objects in Python 2.Julian Andres Klode1-7/+6
2009-06-22python/cache.cc: Drop apt_pkg.Cache.open() and apt_pkg.Cache.close().Julian Andres Klode1-2/+5
Drop these functions, because they cause segfaults and memory leaks. To replace this functionality, simply create/delete a Cache object. This way, reference counting can work.
2009-06-21python: Make all CppOwnedPyObjects and similar support garbage collection.Julian Andres Klode1-34/+28
If you want to subclass apt_pkg.Cache() and create an apt_pkg.DepCache() object in it (e.g. as self.depcache) this is needed because otherwise, Python would not know about the cyclic dependency and refuse to free any of them. This also changes apt_pkg.Cache to the standard deallocation schema, because the underlying CacheFile deletes its pointers automatically on deletion. Thus a second call is not needed.
2009-06-21python: Add DeprecationWarning to functions which were replaced by classes.Julian Andres Klode1-0/+2
2009-06-21python/cache.cc: Give more information on TypeErrors in CacheMapOpJulian Andres Klode1-1/+3
2009-06-15Add support for Enhances as a dependency type (Closes: #416247)Julian Andres Klode1-1/+1
2009-06-14python/cache.cc,depcache.cc: Do not delete the depcache and cache pointers.Julian Andres Klode1-1/+3
Deleting the pointers caused a crash because those pointers will also be deleted by closing the cache file.
2009-06-12Bugfix: Delete pointers correctly, fixing memory leaks. (LP: #370149)Julian Andres Klode1-2/+2
We previously called the destructor of the pointer. This resulted in no object using pointers being deallocated. This patch introduces CppDeallocPtr() and CppOwnedDeallocPtr() which do the same as the other CppDealloc() and CppOwnedDealloc(), but use 'delete' on the pointer instead of the deconstructor. Furthermore, this patch also changes AcquireFile to be a CppOwnedPyObject, owned by the Acquire object. Without this change, deleting the Acquire object would cause a crash when AcquireFile is deallocated.
2009-06-09Allow types providing __new__() to be subclassed.Julian Andres Klode1-1/+2
2009-06-09python/cache.cc: Fix segfaults using the new allocation methods.Julian Andres Klode1-1/+19
We switched to using tp_alloc() to create new objects. Some types had no tp_flags set and were not initialized using PyType_Ready, causing tp_alloc (PyType_GenericAlloc) to crash.
2009-06-05python/: Put all deprecated Get*() functions into #ifdef COMPAT_0_7.Julian Andres Klode1-1/+2
2009-06-05Introduce the rename rules formally, and add some exceptions.Julian Andres Klode1-1/+1
2009-06-04python/cache.cc: Remove some (char*) to make migrate-0.8.py work again.Julian Andres Klode1-13/+13
2009-06-04python/: Unify naming conventions for all new names.Julian Andres Klode1-15/+15
Unify all names to follow these rules: 1. Replace the first [A-Z] with the lowercase version [a-z] 2. Replace multiple [A-Z] with [A-Z][a-z] (one upper, remaining ones lowercase) 3. Replace all remaining [A-Z] with _[a-z] This brings us from 'FileName' to 'file_name' and from 'DescURI' to 'desc_uri'. We will at a later stage add some exceptions to this rule, like 'filename' instead of 'file_name', to improve readability.
2009-06-04python/cache.cc, python/metaindex.cc: Convert remaining stuff to getset ↵Julian Andres Klode1-118/+278
descriptors.
2009-06-03python/: Convert most names to PEP8 naming conventions (except ↵Julian Andres Klode1-1/+48
Version,PackageFile,MetaIndex). On our way to close Bug#481061, this converts almost all names to PEP 8 naming conventions. Missing are now apt_pkg.Version, apt_pkg.PackageFile, apt_pkg.MetaIndex and apt.progress.*. In case of the missing apt_pkg classes, they are not converted yet because they do not use getset descriptors yet. apt.progress.* has not been converted yet because the extension interacts with it, and we first need to modify the extension to recognize the new names, as well as the old names (old applications shouldn't break).
2009-04-24* python/*.cc: Fix build failures with python2.4-dbg.Julian Andres Klode1-1/+1