summaryrefslogtreecommitdiff
path: root/apt-pkg/pkgcache.cc
Commit message (Collapse)AuthorAgeFilesLines
* remove the Section member from package structDavid Kalnischkies2014-06-181-1/+10
| | | | | | | | | | | | | | | | | | A version belongs to a section and has hence a section member of its own. A package on the other hand can have multiple versions from different sections. This was "solved" by using the section which was parsed first as order of sources.list defines, but that is obviously a horribly unpredictable thing. We therefore directly remove this struct member to free some space and mark the access method as deprecated, which is told to return the section of the 'newest' known version, which is at least predictable, but possible not what it returned before – but nobody knows. Users are way better of with the Section() as returned by the version they are dealing with. It is likely the same for all versions of a package, but in the few cases it isn't, it is important (like packages moving from main/* to contrib/* or into oldlibs …).
* cleanup datatypes mix used in binary cacheDavid Kalnischkies2014-06-181-2/+2
| | | | | | | | We had a wild mixture of (unsigned) int, long and long long here without much sense, so this commit adds a few typedefs to get some sense in the typesystem and ensures that a ID isn't sometimes computed as int, stored as long and compared with a long long… as this could potentially bite us later on as the size of the archive only increases over time.
* increase hashtable size for packages/groups by factor 5David Kalnischkies2014-06-181-12/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It also makes the size configureable, so it can be adapted in the future without the need for an abi break - and even by users… The increase was long overdue as it gives a >10% decrease in runtime of e.g. 'apt-get check -s'. Some (useless) benchmark with 69933 groups and 187796 packages without a pre-built cache: time apt-get check -so APT::Cache-HashTableSize=1 → 20m time apt-get check -so APT::Cache-HashTableSize=1000 → 6,41s time apt-get check -so APT::Cache-HashTableSize=2000 → 5,64s (old) time apt-get check -so APT::Cache-HashTableSize=3000 → 5,30s time apt-get check -so APT::Cache-HashTableSize=5000 → 5,08s time apt-get check -so APT::Cache-HashTableSize=6000 → 5,05s time apt-get check -so APT::Cache-HashTableSize=7000 → 5,02s time apt-get check -so APT::Cache-HashTableSize=8000 → 5,00s time apt-get check -so APT::Cache-HashTableSize=9000 → 4,98s time apt-get check -so APT::Cache-HashTableSize=10000 → 4,96s (new) time apt-get check -so APT::Cache-HashTableSize=15000 → 4,90s time apt-get check -so APT::Cache-HashTableSize=20000 → 4,86s time apt-get check -so APT::Cache-HashTableSize=30000 → 4,77s time apt-get check -so APT::Cache-HashTableSize=40000 → 4,74s time apt-get check -so APT::Cache-HashTableSize=50000 → 4,73s time apt-get check -so APT::Cache-HashTableSize=60000 → 4,71s The gap increases further for operations which have more package lookups. Factor 5 was chosen as higher values do not provide any really significant timing advantage anymore compared to the memory increase in my testing and there is always the possibility to increase it now if that changes. (also most users will not have 3 releases and 4 architectures in the cache, so theirs will be much smaller and faster).
* Merge remote-tracking branch 'mvo/feature/hash-stats' into debian/experimentalMichael Vogt2014-06-181-8/+4
|\ | | | | | | | | | | | | | | | | Conflicts: apt-pkg/acquire-item.cc apt-pkg/acquire-item.h apt-pkg/deb/debmetaindex.h apt-pkg/pkgcache.cc test/integration/test-apt-ftparchive-src-cachedb
| * [API-Break] rename pkgCache::Package::NextPackage to pkgCache::Package::NextMichael Vogt2014-06-181-4/+4
| | | | | | | | | | This is a internal struct not a external interface so the actual breakage should be small.
| * increase Pkg/Grp hash table size from 2k to 64kMichael Vogt2014-05-291-5/+1
| |
* | invalid cache if architecture set doesn't matchDavid Kalnischkies2014-05-101-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The cache heavily depends on the architecture(s) it is build for, especially if you move from single- to multiarch. Adding a new architecture to dpkg therefore has to be detected and must invalidate the cache so that we don't operate on incorrect data. The incorrect data will prevent us from doing otherwise sensible actions (it doesn't allow bad things to happen) and the recovery is simple and automatic in most cases, so this hides pretty well and is also not as serious as it might sound at first. Closes: 745036
* | mark as Automatic/Downloadable pure as gcc suggestsDavid Kalnischkies2014-05-081-2/+2
| | | | | | | | | | Git-Dch: Ignore Reported-By: gcc
* | Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-05-071-14/+21
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: apt-pkg/cachefilter.h apt-pkg/contrib/fileutl.cc apt-pkg/contrib/netrc.h apt-pkg/deb/debsrcrecords.cc apt-pkg/init.h apt-pkg/pkgcache.cc debian/apt.install.in debian/changelog
| * abstract version hash comparison a bitDavid Kalnischkies2014-03-131-0/+4
| | | | | | | | | | | | | | | | In #737085 we see that apt can be confused if informations about versions only differ slightly. This commit adds a way of at least adding a few more data points with the next abi break to help a bit with it. Git-Dch: Ignore
| * cleanup headers and especially #includes everywhereDavid Kalnischkies2014-03-131-2/+5
| | | | | | | | | | | | | | | | Beside being a bit cleaner it hopefully also resolves oddball problems I have with high levels of parallel jobs. Git-Dch: Ignore Reported-By: iwyu (include-what-you-use)
| * warning: unused parameter ‘foo’ [-Wunused-parameter]David Kalnischkies2014-03-131-1/+1
| | | | | | | | | | Reported-By: gcc -Wunused-parameter Git-Dch: Ignore
| * warning: extra ‘;’ [-Wpedantic]David Kalnischkies2014-03-131-10/+10
| | | | | | | | | | Git-Dch: Ignore Reported-By: gcc -Wpedantic
* | Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-02-271-2/+2
|\| | | | | | | | | | | | | | | Conflicts: apt-private/private-list.cc configure.ac debian/apt.install.in debian/changelog
| * Fix typos in documentation (codespell)Michael Vogt2014-02-221-2/+2
| |
* | Merge branch 'debian/sid' into debian/experimentalMichael Vogt2013-08-151-0/+12
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: apt-pkg/contrib/strutl.cc apt-pkg/deb/dpkgpm.cc configure.ac debian/changelog doc/po/apt-doc.pot po/apt-all.pot po/ar.po po/ast.po po/bg.po po/bs.po po/ca.po po/cs.po po/cy.po po/da.po po/de.po po/dz.po po/el.po po/es.po po/eu.po po/fi.po po/fr.po po/gl.po po/hu.po po/it.po po/ja.po po/km.po po/ko.po po/ku.po po/lt.po po/mr.po po/nb.po po/ne.po po/nl.po po/nn.po po/pl.po po/pt.po po/pt_BR.po po/ro.po po/ru.po po/sk.po po/sl.po po/sv.po po/th.po po/tl.po po/uk.po po/vi.po po/zh_CN.po po/zh_TW.po test/integration/framework test/integration/test-bug-602412-dequote-redirect test/integration/test-ubuntu-bug-346386-apt-get-update-paywall test/interactive-helper/aptwebserver.cc test/interactive-helper/makefile
| * Version 3 for DPkg::Pre-Install-Pkgs with MultiArch infoDavid Kalnischkies2013-07-111-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds on top of Version 2 to all displayed version numbers the architecture as well as the MultiArch flag for consumption by the hooks. Most of the time the architecture will be the same for both versions displayed, but packages might change from "all" to "any" (or back) between versions so we can't display the architecture for packages. Pseudo-Format for Version 3: <name> <version> <arch> <m-a-flag> <compare> <version> <arch> <m-a-flag> Examples: stuff - - none < 1 amd64 none **CONFIGURE** libsame 1 i386 same < 2 i386 same **CONFIGURE** stuff 2 i386 none > 1 i386 none **CONFIGURE** libsame 2 i386 same > - - none **REMOVE** toolkit 1 all foreign > - - none **REMOVE** Closes: #712116
* | merged debian-sid branch and resolved conflictsMichael Vogt2013-04-231-23/+40
|\|
| * * apt-pkg/cacheiterators.h:David Kalnischkies2013-04-031-4/+12
| | | | | | - provide DepIterator::IsSatisfied as a nicer shorthand for DepCheck
| * - sort group and package names in the hashtable on insertDavid Kalnischkies2013-04-031-11/+20
| | | | | | | | * apt-pkg/pkgcache.cc: - assume sorted hashtable entries for groups/packages
| * various simple changes to fix cppcheck warningsDavid Kalnischkies2013-03-101-9/+9
| |
* | * [ABI BREAK] apt-pkg/pkgcache.h:Michael Vogt2013-01-081-1/+1
|/ | | - adjust pkgCache::State::VerPriority enum, to match reality
* * apt-pkg/pkgcache.cc:David Kalnischkies2012-09-191-2/+23
| | | | - ignore negative dependencies applying in the same group for M-A:same packages on the real package name as self-conflicts
* handle packages without a mandatory architecture (debian-policy §5.3)David Kalnischkies2012-09-091-1/+5
| | | | | by introducing a pseudo-architecture 'none' so that the small group of users with these packages can get right of them without introducing too much hassle for other users (Closes: #686346)
* * apt-pkg/pkgcache.cc:David Kalnischkies2012-06-141-1/+1
| | | | - do a string comparision for architecture checking in IsMultiArchImplicit as 'unique' strings in the pkgcache aren't unique (Closes: #677454)
* * apt-pkg/deb/deblistparser.cc:Thibaut Girka2012-06-111-1/+4
| | | | - add support for arch-specific qualifiers in dependencies
* * apt-pkg/cacheiterators.h:David Kalnischkies2012-06-111-0/+26
| | | - add an IsMultiArchImplicit() method for Dep- and PrvIterator
* factor out the detection of self-conflicts into Dep::IsIgnorableDavid Kalnischkies2012-01-131-15/+34
|
* * apt-pkg/pkgcache.cc:David Kalnischkies2012-01-131-5/+12
| | | - ignore implicit conflicts on providers in AllTarget, too
* * apt-pkg/pkgcache.cc:David Kalnischkies2011-10-121-3/+14
| | | - always prefer "en" over "" for "en"-language regardless of cache-order
* do not pollute namespace in the headers with using (Closes: #500198)David Kalnischkies2011-09-191-2/+2
|
* merge with debian/sidDavid Kalnischkies2011-09-131-1/+1
|\
| * * apt-pkg/packagemanager.cc, apt-pkg/pkgcache.cc:David Kalnischkies2011-08-171-1/+1
| | | | | | | | | | - ignore "self"-conflicts for all architectures of a package instead of just for the architecture of the package locked at in the ordering of installations too (Closes: #802901)
* | merge with debian/experimentalDavid Kalnischkies2011-09-131-13/+18
|\ \
| * | merged from the debian-sid branchMichael Vogt2011-08-151-13/+13
| |\|
| | * cppcheck complains about some possible speed improvements which could beDavid Kalnischkies2011-08-111-13/+13
| | | | | | | | | | | | | | | | | | done on the mirco-optimazation level, so lets fix them: (performance) Possible inefficient checking for emptiness. (performance) Prefer prefix ++/-- operators for non-primitive types.
| * | * apt-pkg/pkgcache.cc:Julian Andres Klode2011-07-201-0/+3
| | | | | | | | | - Check that cache is at least CacheFileSize bytes large (LP: #16467)
| * | apt-pkg/pkgcache.h: Add pkgCache::Header::CacheFileSize, storing the cache sizeJulian Andres Klode2011-07-201-0/+2
| | |
* | | reorder includes: add <config.h> if needed and include it at firstDavid Kalnischkies2011-09-131-3/+4
|/ /
* / remove deprecated methods which nobody should have used anyway likeDavid Kalnischkies2011-05-171-3/+0
|/ | | | pseudo-package related and/or private
* convert a lot of places to use IsNegative instead of checking by handDavid Kalnischkies2011-05-111-9/+3
| | | | for the three different dependencies
* if critical or-group can't be satisfied, exit directly.David Kalnischkies2011-05-111-0/+11
|
* * apt-pkg/pkgcache.cc:David Kalnischkies2011-04-251-3/+6
| | | - really ignore :arch in FindPkg() in non-multiarch environment
* * apt-pkg/pkgcache.cc:David Kalnischkies2011-04-061-5/+6
| | | | - use the native Architecture stored in the cache header instead of loading it from configuration as suggested by Julian Andres Klode
* document the pkg:any specialcasing in FindPkg as well to make it clearDavid Kalnischkies2011-04-061-0/+3
| | | | that it is a needed "hack" to support multi-arch in the least breaking way
* * apt-pkg/deb/deblistparser.cc:David Kalnischkies2011-03-281-5/+5
| | | - create foo:any provides for all architectures for an allowed package
* * apt-pkg/pkgcachegen.cc:David Kalnischkies2011-03-251-1/+1
| | | | - make "all"->"native" an implementation detail of NewPackage rather than rewrite it in higher methods
* Remove the "pseudopackage" handling of Architecture: all packages forDavid Kalnischkies2011-03-081-16/+2
| | | | | | | | | Multi-Arch; instead, Arch: all packages only satisfy dependencies for the native arch, except where the Arch: all package is declared Multi-Arch: foreign. (Closes: #613584) This has the sideeffect that arch:all packages internally show up as coming from the native arch - so packages with the architecture "all" doesn't exist any longer in the pkgcache
* * apt-pkg/pkgcache.cc:David Kalnischkies2010-10-261-7/+8
| | | - fallback always to a suitable description (Closes: #601016)
* * apt-pkg/policy.cc:David Kalnischkies2010-09-141-0/+1
| | | | | | - support 100-pinning in Release file with ButAutomaticUpgrades as requested by the backports crew (Closes: #596097) * apt-pkg/deb/deblistparser.cc: - overrule NotAutomatic in case of ButAutomaticUpgrades