summaryrefslogtreecommitdiff
path: root/apt-private/private-cacheset.cc
Commit message (Collapse)AuthorAgeFilesLines
* Fix segfault in CacheSetHelperAPTGet::tryVirtualPackage()Julian Andres Klode2022-04-071-1/+2
| | | | | | | | We forgot to check whether Archive() and Codename() exist in the first place, sigh. Maybe we should return empty strings instead of nullptr. Reported-By: Johannes 'josch' Schauer Marin Rodrigues on IRC
* Allow =version and /release selector on virtual packagesDavid Kalnischkies2020-05-271-43/+119
| | | | | | | | | | | We already have code for figuring out if a virtual package is only provided by a single provider (and otherwise show a list) we can auto-select for the user, so we can adapt that to work with versioned provides as well and while at it also release selectors. The code tries to keep ABI backward compatible and hence turns relatively ugly as we need a parameter (the selector) to be passed around without adding a parameter or new virtual methods.
* Apply various suggestions by cppcheckDavid Kalnischkies2019-07-081-4/+5
| | | | Reported-By: cppcheck
* Remove deprecated cacheset methodsJulian Andres Klode2019-06-141-5/+60
| | | | | This mostly turns them private and then overrides the public version with the switch, as recommended.
* apt-private: Collect not found packages in CacheSetHelperAPTGetJulian Andres Klode2018-04-131-2/+8
| | | | | Collecting the packages we could not find allows us to pass them to other places.
* Reformat and sort all includes with clang-formatJulian Andres Klode2017-07-121-4/+4
| | | | | | | | | | | | | 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.
* fail instead of segfault on unreadable config filesDavid Kalnischkies2016-05-201-4/+9
| | | | | | | | | | | | | The report mentions "apt list --upgradable", but there are others which have inconsistent behavior ranging from segfaulting to doing something with the partial (and hence incomplete) data. We had a recent report about sources.list (#818628), this one mentions prefences, the obvious next step is conf files… so the testcase is adapted to check for all three in file and directory versions and run a bunch of commands each time which should all have more or less the same behavior in such a case (aka error out). Closes: 824503
* apply various suggestions made by cppcheckDavid Kalnischkies2015-11-051-4/+2
| | | | | Reported-By: cppcheck Git-Dch: Ignore
* implement dpkgs vision of interpreting pkg:<arch> dependenciesDavid Kalnischkies2015-09-141-0/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | How the Multi-Arch field and pkg:<arch> dependencies interact was discussed at DebConf15 in the "MultiArch BoF". dpkg and apt (among other tools like dose) had a different interpretation in certain scenarios which we resolved by agreeing on dpkg view – and this commit realizes this agreement in code. As was the case so far libapt sticks to the idea of trying to hide MultiArch as much as possible from individual frontends and instead translates it to good old SingleArch. There are certainly situations which can be improved in frontends if they know that MultiArch is upon them, but these are improvements – not necessary changes needed to unbreak a frontend. The implementation idea is simple: If we parse a dependency on foo:amd64 the dependency is formed on a package 'foo:amd64' of arch 'any'. This package is provided by package 'foo' of arch 'amd64', but not by 'foo' of arch 'i386'. Both of those foo packages provide each other through (assuming foo is M-A:foreign) to allow a dependency on 'foo' to be satisfied by either foo of amd64 or i386. Packages can also declare to provide 'foo:amd64' which is translated to providing 'foo:amd64:any' as well. This indirection over provides was chosen as the alternative would be to teach dependency resolvers how to deal with architecture specific dependencies – which violates the design idea of avoiding resolver changes, especially as architecture-specific dependencies are a cornercase with quite a few subtil rules. Handling it all over versioned provides as we already did for M-A in general seems much simpler as it just works for them. This switch to :any has actually a "surprising" benefit as well: Even frontends showing a package name via .Name() [which doesn't show the architecture] will display the "architecture" for dependencies in which it was explicitely requested, while we will not show the 'strange' :any arch in FullName(true) [= pretty-print] either. Before you had to specialcase these and by default you wouldn't get these details shown. The only identifiable disadvantage is that this complicates error reporting and handling. apt-get's ShowBroken has existing problems with virtual packages [it just shows the name without any reason], so that has to be worked on eventually. The other case is that detecting if a package is completely unknown or if it was at least referenced somewhere needs to acount for this "split" – not that it makes a practical difference which error is shown… but its one of the improvements possible.
* Re-add support for G++ 4.8 and configure travis to use itJulian Andres Klode2015-08-171-1/+1
| | | | | | This makes tests work again! Gbp-Dch: ignore
* headers are for declarations onlyDavid Kalnischkies2015-08-101-2/+207
| | | | | | | | Housekeeping. This used to be embedded in apt-get directly, then moved to into our (then new) private lib and now header and code get a proper separation. Git-Dch: Ignore
* rework cachesets API to allow future extensionDavid Kalnischkies2014-09-271-4/+4
| | | | | | | | | | | | | | | The introduction of Fnmatch showed that each new selector would require multiple new virtual methods in the CacheSetHelper to work correctly, which isn't that great. We now flip to a single virtual method which handles all cases separated by an enum – as new enum values can be added without an ABI break. Great care was taken to make old code work with the new way of organisation, which means in return that you might be bombarded with deprecation warnings now if you don't adapt, but code should still compile and work as before as can be seen in apt itself with this commit. Git-Dch: Ignore
* make GetLocalitySortedVersionSet more genericDavid Kalnischkies2014-09-071-43/+46
| | | | | | | | | No reason in and of by itself at the moment, but prepares for the goal of having 'apt search' and 'apt-cache search' using the same code now that they at least support the same stuff. The 'apt' code is just a multitude slower at the moment… Git-Dch: Ignore
* Ensure we have a Policy in CacheFile.BuildDepCache()Michael Vogt2014-09-051-4/+1
| | | | | | This partly reverts d059cc2 and fixes bug #753297 in a more general way by ensuring that CacheFile.BuildDepCache() builds a pkgPolicy if there isn't one already.
* Fix incorrect upgradable listing in "apt list" (thanks to Michael Musenbrock)Michael Vogt2014-09-051-1/+4
| | | | | | | | | | The "apt list" command was using only the pkgDepCache but not the pkgPolicy to figure out if a package is upgradable. This lead to incorrect display of upgradable package when the user used the policy to pin-down packages. Thanks to Michael Musenbrock for the initial patch. Closes: #753297
* fix apt list output for pkgs in dpkg ^rc stateMichael Vogt2014-04-081-1/+7
| | | | | | Packages in the "deinstall ok config-file" have no candidate or instaleld version. So they must be special cased in the apt list generation.
* cleanup headers and especially #includes everywhereDavid Kalnischkies2014-03-131-2/+11
| | | | | | | | 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)
* add --manual-installed commandline switchMichael Vogt2014-01-161-0/+9
|
* squash merge of the feature/apt-binary branch without the changes from ↵Michael Vogt2013-08-121-0/+63
experimental