summaryrefslogtreecommitdiff
path: root/apt-pkg/cacheset.h
AgeCommit message (Collapse)Author
2019-06-14Remove deprecated cacheset methodsJulian Andres Klode
This mostly turns them private and then overrides the public version with the switch, as recommended.
2019-06-12Run unifdef -DAPT_{8,9,10,15}_CLEANER_HEADERSJulian Andres Klode
2019-05-06cacheset: Remove simple cases of deprecated codeJulian Andres Klode
This is missing the ones that are still actively used in cacheset.cc, we need to clean those up too, but they are obviously more tricky.
2018-08-29Fix typos reported by codespell & spellintianDavid Kalnischkies
No user-visible change as it effects mostly code comments and not a single error message, manpage or similar. Reported-By: codespell & spellintian Gbp-Dch: Ignore
2017-07-12Reformat and sort all includes with clang-formatJulian Andres Klode
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.
2017-07-12Drop cacheiterators.h includeJulian Andres Klode
Including cacheiterators.h before pkgcache.h fails because pkgcache.h depends on cacheiterators.h.
2017-01-19fix various typos reported by spellintianDavid Kalnischkies
Most of them in (old) code comments. The two instances of user visible string changes the po files of the manpages are fixed up as well. Gbp-Dch: Ignore Reported-By: spellintian
2016-04-28deprecate confusing Pkg.CandVersion() methodDavid Kalnischkies
This method does not return the 'current' candidate of the DepCache which would be most expected, but instead returns the version which would be candidate in a default-only policy setting – aka ignoring apt_preferences settings and co.
2015-11-27add messages to our deprecation warnings in libaptDavid Kalnischkies
Git-Dch: Ignore
2015-11-04add cacheset push_back wrapping for std::back_inserterDavid Kalnischkies
As usual by now, not all containers wrapped by the cacheset containers support all methods, like push_back now, but they fail on use of these unusable methods only. Would be nice to not expose these methods for unsupporting containers at all, but that means either a lot of classes or a lot of std::enable_if magic, which seems like too big work for this small wrapper for now. Git-Dch: Ignore
2015-11-04implement operator* for cacheset iteratorsDavid Kalnischkies
Technically an abi-break as we change a template parameter to std::iterator for this, but this class is empty in all instances and just causes the right typedefs to be set – which were incorrect as detected by std::stable_partition as its implementation uses ::pointer and needs also a operator* implementation. In practice CacheSets have no external users (yet) and the difference is visible only at compile time (which was an error before and now works), not while linking. The changes to apt-mark are functionally identical to the code before, just that we use a std:: algorithm now instead of trying hard on our own.
2015-10-30cacheset: Fix compilation on new GCC in C++98 modeJulian Andres Klode
Since gcc 4.9, the API for erase slightly changed. In commit 3dddcdf2432e78f37c74d8c76c2c519a8d935ab2 the existing checks for __cplusplus where changed to check the gcc version, as the __cplusplus check did nothing, because gcc 4.8 already provided the standard value in there. Fix the code to check for the gcc version in two more places, and change the existing checks to use a convenience macro.
2015-08-17Re-add support for G++ 4.8 and configure travis to use itJulian Andres Klode
This makes tests work again! Gbp-Dch: ignore
2015-08-10avoid virtual in the iteratorsDavid Kalnischkies
With a bit of trickery and the Curiously recurring template pattern we can free us from our use of virtual in the iterators were it is unneeded bloat as we never deal with pointers to iterators and similar such. Git-Dch: Ignore
2015-08-10show or-groups in not-installed recommends and suggests listsDavid Kalnischkies
Further abstracting our new ShowList allows to use it for containers of strings as well giving us the option to implement an or-groups display for the recommends and suggests lists which is a nice trick given that it also helps with migrating the last remaining other cases of old ShowList.
2015-08-10implement a more generic ShowList methodDavid Kalnischkies
apt-get is displaying various lists of package names, which until now it was building as a string before passing it to ShowList, which inserted linebreaks at fitting points and showed a title if needed, but it never really understood what it was working with. With the help of C++11 the new generic knows not only what it works with, but generates the list on the fly rather than asking for it and potentially discarding parts of the input (= the non-default verbose display). It also doubles as a test for how usable the CacheSets are with C++11. (Not all callers are adapted yet.) Git-Dch: Ignore
2015-08-10implement reverse_iterators for cachesetsDavid Kalnischkies
By further abstracting the iterator templates we can wrap the reverse iterators of the wrapped containers and share code in a way that iterator creating is now more template intensive, but shorter in code. Git-Dch: Ignore
2015-08-10prepare cachesets for -std=c++11David Kalnischkies
The "problem" is mostly in the erase() definitions as they slightly conflict and in pre-c++11 are not uniformly in different containers. By differenciating based on the standard we can provide erase() methods for both standards – and as the method is in a template and inline we don't need to worry about symbols here. The rest is adding wrappings for the new forward_list and unordered_set containers and correcting our iterators to use the same trait as the iterator they are wrapping instead of having all of them be simple forward iterators. This allows the use of specialized algorithms which are picked based on iterator_traits and implementing them all is simple to do as we can declare all methods easily and only if they are called they will generate errors (if the underlying iterator doesn't support these). Git-Dch: Ignore
2015-08-10cleanup Container.erase API to look more like std::containersDavid Kalnischkies
C++11 slightly changes the API again to const_iterator, but we are find with iterators in the C++03 style for now as long as they look and behave equally to the methods of the standard containers. Git-Dch: Ignore
2015-08-10make all d-pointer * const pointersDavid Kalnischkies
Doing this disables the implicit copy assignment operator (among others) which would cause hovac if used on the classes as it would just copy the pointer, not the data the d-pointer points to. For most of the classes we don't need a copy assignment operator anyway and in many classes it was broken before as many contain a pointer of some sort. Only for our Cacheset Container interfaces we define an explicit copy assignment operator which could later be implemented to copy the data from one d-pointer to the other if we need it. Git-Dch: Ignore
2015-08-10apply various style suggestions by cppcheckDavid Kalnischkies
Some of them modify the ABI, but given that we prepare a big one already, these few hardly count for much. Git-Dch: Ignore
2015-06-16add d-pointer, virtual destructors and de-inline de/constructorsDavid Kalnischkies
To have a chance to keep the ABI for a while we need all three to team up. One of them missing and we might loose, so ensuring that they are available is a very tedious but needed task once in a while. Git-Dch: Ignore
2015-03-16fix some new compiler warnings reported by gcc-5David Kalnischkies
Git-Dch: Ignore
2014-11-08replace ignore-deprecated #pragma dance with _PragmaDavid Kalnischkies
For compatibility we use/provide and fill quiet some deprecated methods and fields, which subsequently earns us a warning for using them. These warnings therefore have to be disabled for these codeparts and that is what this change does now in a slightly more elegant way. Git-Dch: Ignore
2014-09-30mark private methods as hiddenDavid Kalnischkies
We are the only possible users of private methods, so we are also the only users who can potentially export them via using them in inline methods. The point is: We don't need these symbols exported if we don't do this, so marking them as hidden removes some methods from the API without breaking anything as nobody could have used them. Git-Dch: Ignore
2014-09-27move PCI::From* methods into CacheSetHelper classDavid Kalnischkies
The methods itself deal with the helper a lot, so it makes sense to move them to the helper itself, which helps also if we want to override some of these methods, the FromString mentioned in the bugreport being the obvious example. VCI is spared from this change for now as while it would fit with the same reasoning it much heavier entangled with the previous CacheSetHelper change, so moving it now would mean breaking the API. The PCI change is worthwhile on its own though as it is used by VCI. Closes: 686221
2014-09-27rework cachesets API to allow future extensionDavid Kalnischkies
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
2014-09-27add APT::PackageUniverse as a pkgCache wrapperDavid Kalnischkies
Git-Dch: Ignore
2014-09-27add specialisations for std::vectorDavid Kalnischkies
Git-Dch: Ignore
2014-06-18remove the Section member from package structDavid Kalnischkies
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 …).
2014-05-29Fix more warnings from clangMichael Vogt
Reported-By: clang++ -Werror Conflicts: apt-pkg/acquire-item.cc apt-pkg/acquire-item.h apt-pkg/deb/debmetaindex.h
2014-03-13cleanup headers and especially #includes everywhereDavid Kalnischkies
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)
2014-03-13warning: extra ‘;’ [-Wpedantic]David Kalnischkies
Git-Dch: Ignore Reported-By: gcc -Wpedantic
2014-03-13make doxygen more quiet, fix issues and disable latexDavid Kalnischkies
Git-Dch: Ignore
2014-02-14add missing canNotFindFnmatch/showFnmatchSelection (for the next ABI break)Michael Vogt
2013-08-12squash merge of the feature/apt-binary branch without the changes from ↵Michael Vogt
experimental
2013-07-23remove double list includeMichael Vogt
2012-06-14* apt-pkg/cacheset.cc:David Kalnischkies
- add PackageContainerInterface::FromGroup to support architecture specifications with wildcards on the commandline
2012-04-17newer gcc versions seems to have no problem with that, but while workingDavid Kalnischkies
with g++-4.1 it complains about this so lets be extra clear
2012-02-11correctly ignore already (un)hold packagesDavid Kalnischkies
2011-12-13revert 2184.1.3: forward declaration instead of headersDavid Kalnischkies
The breakage is just to big for now, so guard the change with #ifndef APT_8_CLEANER_HEADERS and be nice to library users
2011-11-22fix the operator++ implementations in the cachesetsDavid Kalnischkies
2011-11-11 - provide a {Package,Version}List similar to {Package,Version}SetDavid Kalnischkies
* cmdline/apt-{get,cache,mark}.cc: - use Lists instead of Sets if input order should be preserved for commands accepting lists of packages, e.g. policy (Closes: #625960)
2011-11-09* apt-pkg/cacheset.cc:David Kalnischkies
- make the cachesets real containers which can embedding any container to be able to use the same interface regardless of set or list usage
2011-09-19use forward declaration in headers if possible instead of includesDavid Kalnischkies
2011-05-17remove deprecated methods which nobody should have used anyway likeDavid Kalnischkies
pseudo-package related and/or private
2011-04-16remove the extra unnecessary qualification cppcheck complains aboutDavid Kalnischkies
2011-03-08Remove the "pseudopackage" handling of Architecture: all packages forDavid Kalnischkies
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
2010-07-30 - [ABI BREAK] add an ErrorType option to CacheSetHelperDavid Kalnischkies
* cmdline/apt-cache.cc: - use Notice instead of Error in the CacheSetHelper messages for compat reasons. Otherwise tools like sbuild blow up
2010-07-17* apt-pkg/cacheset.cc:David Kalnischkies
- move them back to the library as they look stable now