summaryrefslogtreecommitdiff
path: root/apt-pkg/cachefilter.cc
Commit message (Collapse)AuthorAgeFilesLines
* remove pointless APT_PURE from void functionsDavid Kalnischkies2017-12-141-2/+2
| | | | | | | | | | | Earlier gcc versions used to complain that you should add them althrough there isn't a lot of point to it if you think about it, but now gcc (>= 8) complains about the attribute being present. warning: ‘pure’ attribute on function returning ‘void’ [-Wattributes] Reported-By: gcc -Wattributes Gbp-Dch: Ignore
* Replace APT_CONST with APT_PURE everywhereJulian Andres Klode2017-08-241-8/+8
| | | | | As a follow up to the last commit, let's replace APT_CONST with APT_PURE everywhere to clean stuff up.
* Reformat and sort all includes with clang-formatJulian Andres Klode2017-07-121-3/+3
| | | | | | | | | | | | | This makes it easier to see which headers includes what. The changes were done by running git grep -l '#\s*include' \ | grep -E '.(cc|h)$' \ | xargs sed -i -E 's/(^\s*)#(\s*)include/\1#\2 include/' To modify all include lines by adding a space, and then running ./git-clang-format.sh.
* Drop cacheiterators.h includeJulian Andres Klode2017-07-121-1/+0
| | | | | Including cacheiterators.h before pkgcache.h fails because pkgcache.h depends on cacheiterators.h.
* Read dpkg tables to handle architecture wildcardsJulian Andres Klode2017-01-171-28/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our implementation of wildcards was rudimentary. It worked for some common ones, but it was also broken: For example, armel matched any-armel, but should match any-arm. With this commit, we load the correct tables from dpkg. Supported are both triplets and quadruplet tables (the latter introduced in dpkg 1.18.11). There are some odd things we have to deal with in the cache filter for historical and API reasons: * The character "*" must be accepted as an alternative to any - in fact it may appear anywhere in the wildcard as we also allow fnmatch() style wildcard matching on the commandline. * The code might get passed an arch with a minus at the end, for example the cmdline "install apt:any-arm-" will first try to check if any-arm- is a valid architecture. We deal with this by rejecting any wildcard ending in a minus. * Triplets are actually implemented by extending them to faux quadruplets - by prepending a "base" component for the architecture tuple, and "any" if there is a wildcard component. Once we have constructed a wildcard, it is transformed into an fnmatch() expression for historical reasons. In the future, we should really get a tuple class and implement matching in a better, more explicit way. This does for now though - it passes all the test cases and accepts all things it should accept. Closes: #748936 Thanks: James Clarke <jrtc27@jrtc27.com> for the initial patch
* support <libc>-<kernel>-<cpu> in architecture specsDavid Kalnischkies2016-01-311-16/+35
| | | | | | | | | | | | | | | | | | | APT has a different understanding than dpkg (#748936) what matches and what doesn't match an architecture specification as it isn't converting back (and forward) to Debian triplets. That has to eventually be solved some way or the other, but until that happens we change the matching in apt so that porters can continue their work on non-gnu libc-ports even if policy doesn't specify that yet (and dpkg just supporting it "by accident" via triplets). The initial patch was reformatted, fixed in terms of patterns containing "any-any", dealing with expanding an arch without libc to gnu while a pattern expands libc to any, the parsedepends test was fixed (the new if's were inserted one step too early) and another test just for the specifications added. Closes: #812212 Thanks: Bálint Réczey for initial patch
* add an API for cache filters/matcherDavid Kalnischkies2014-09-271-25/+119
| | | | | | | | | | A lot of code deals with iterating over packages and checking for specific states. At the moment these are all handcrafted inplace, but that makes sharing common code which just differs in the states it checks rather difficult and is error prune. Having an API to construct arbitrary complex filters will come in handy for those. Git-Dch: Ignore
* cleanup headers and especially #includes everywhereDavid Kalnischkies2014-03-131-1/+3
| | | | | | | | 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)
* squash merge of the feature/apt-binary branch without the changes from ↵Michael Vogt2013-08-121-0/+11
| | | | experimental
* various simple changes to fix cppcheck warningsDavid Kalnischkies2013-03-101-2/+1
|
* * apt-pkg/cachefilter.cc:David Kalnischkies2012-07-121-6/+0
| | | | | | | - remove architecture-specific arch to tuple expansion-rules as they lead to the same tuples for different architectures (e.g. linux-arm for arm, armel and armhf) while the dpkg-architecture code uses triples which are different (in the first part, which we omit in our tuples), so e.g. build-dep restrictions for armel ended up effecting armhf as well
* * apt-pkg/deb/deblistparser.cc:David Kalnischkies2012-06-141-0/+51
| | | | | - use PackageArchitectureMatchesSpecification filter * apt-pkg/cachefilter.cc: - add PackageArchitectureMatchesSpecification (Closes: #672603)
* ensure that apti18n.h is included last as advertised (Closes: #671623)David Kalnischkies2012-05-051-2/+2
|
* fix a bunch of cppcheck "(warning) Member variable '<#>' is notDavid Kalnischkies2012-03-041-1/+1
| | | | initialized in the constructor." messages (no functional change)
* reorder includes: add <config.h> if needed and include it at firstDavid Kalnischkies2011-09-131-0/+2
|
* factor regex package name matches into newly created cachefilter classesDavid Kalnischkies2010-07-171-0/+54