summaryrefslogtreecommitdiff
path: root/apt-pkg/algorithms.h
AgeCommit message (Collapse)Author
2021-01-04Determine autoremovable kernels at run-timeJulian Andres Klode
Our kernel autoremoval helper script protects the currently booted kernel, but it only runs whenever we install or remove a kernel, causing it to protect the kernel that was booted at that point in time, which is not necessarily the same kernel as the one that is running right now. Reimplement the logic in C++ such that we can calculate it at run-time: Provide a function to produce a regular expression that matches all kernels that need protecting, and by changing the default root set function in the DepCache to make use of that expression. Note that the code groups the kernels by versions as before, and then marks all kernel packages with the same version. This optimized version inserts a virtual package $kernel into the cache when building it to avoid having to iterate over all packages in the cache to find the installed ones, significantly improving performance at a minor cost when building the cache. LP: #1615381
2020-02-26apt-pkg: default visibility to hiddenJulian Andres Klode
2020-02-26Rename pkgSimulate::Go2 to pkgSimulate::GoJulian Andres Klode
2019-07-10Fix typos reported by codespell in code commentsDavid Kalnischkies
Also in old changelogs, but nothing really user visible like error messages or alike so barely noteworthy. Reported-By: codespell Gbp-Dch: Ignore
2019-06-12Run unifdef -DAPT_{8,9,10,15}_CLEANER_HEADERSJulian Andres Klode
2019-02-26algorithms: Remove deprecated ProblemResolver::InstallProtect()Julian Andres Klode
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.
2016-08-10simulate all package manager actions explicitlyDavid Kalnischkies
If a planner lets actions to be figured out by dpkg in pending calls these actions aren't mentioned in a simulation. While that might be a good thing for debugging, it would be a change in behavior and especially if a planner avoids explicit removals could be confusing for users. As such we perform the same 'trick' as in the dpkg implementation by performing explicitly what would be done by the pending calls. To save us some work and avoid desyncs we perform a layer violation by using deb/ code in the generic simulation – and further we perform ugly dynamic_cast to avoid breaking the ABI for nothing; aptitude is the only other user of the simulation class according to codesearch.d.n and for that our little trick works. It just isn't working if you happen to extend pkgSimulate or otherwise manage to call the protected Go methods directly – which isn't very realistic/practical.
2016-06-08edsp: if internal is used, keep this decisionDavid Kalnischkies
It wasn't noticeable before, but now with the (optional) logging it can be observed that we decide in the internal path two times if an internal or external solver should be used (and hence with logging, it is attempted twice), so if we are in the internal path call the internal resolver directly, which means those internal methods need to be public – but we can hide them based on the symbol at least.
2016-03-07Fix several typosVeres Lajos
This effectively merges branch 'typofixes-vlajos-20150807' of github.com:vlajos/apt with the following commit: commit 13cacb3e2e2352ba701e769fc889e3344fabbf7e Author: Veres Lajos <vlajos@gmail.com> Date: Sun Aug 9 00:12:53 2015 +0100 typofix - https://github.com/vlajos/misspell_fixer It has been rebased for a better commit message.
2015-11-27add messages to our deprecation warnings in libaptDavid Kalnischkies
Git-Dch: Ignore
2015-10-30algorithms: Replace qsort() by thread-safe std::sort()Julian Andres Klode
Gbp-Dch: ignore
2015-08-10remove the compatibility markers for 4.13 abiDavid Kalnischkies
We aren't and we will not be really compatible again with the previous stable abi, so lets drop these markers (which never made it into a released version) for good as they have outlived their intend already. Git-Dch: Ignore
2015-08-10add c++11 override marker to overridden methodsDavid Kalnischkies
C++11 adds the 'override' specifier to mark that a method is overriding a base class method and error out if not. We hide it in the APT_OVERRIDE macro to ensure that we keep compiling in pre-c++11 standards. Reported-By: clang-modernize -add-override -override-macros 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
2014-11-08explicit overload methods instead of adding parametersDavid Kalnischkies
Adding a new parameter (with a default) is an ABI break, but you can overload a method, which is "just" an API break for everyone doing references to this method (aka: nobody). 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-27fix progress output for (dist-)upgrade calculationDavid Kalnischkies
Previously, we had a start and a done of the calculation printed by higher-level code, but this got intermixed by progress reporting from an external solver or the output of autoremove code… The higherlevel code is now only responsible for instantiating a progress object of its choosing (if it wants progress after all) and the rest will be handled by the upgrade code. Either it is used to show the progress of the external solver or the internal solver will give some hints about its overall progress. The later isn't really a proper progress as it will jump forward after each substep, but that is at least a bit better than before without any progress indication. Fixes also the 'strange' non-display of this progress line in -q=1, while all others are shown, which is reflected by all testcase changes.
2014-03-13follow method attribute suggestions by gccDavid Kalnischkies
Git-Dch: Ignore Reported-By: gcc -Wsuggest-attribute={pure,const,noreturn}
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-02-22Fix typos in documentation (codespell)Michael Vogt
2013-11-01small documentation updates0.9.13_exp1Michael Vogt
2013-10-05Move ListUpdate/AquireUpdate into update.{cc,h}Michael Vogt
This moves the ListUpdate/AquireUpdate out of the "catch-all" algorithm.{cc,h} file into its own update.{cc,h}
2013-10-05* move upgrade releated code into upgrade.{cc,h}Michael Vogt
The upgrade releated code is moved into upgrade.{cc,h} and all pkg*Upgrade* prototypes are included in algorihms.h to avoid breaking API (unless build with APT_9_CLEANER_HEADERS).
2013-10-05cleanup upgrade API some more (thanks for the feedback from David)Michael Vogt
2013-09-18improve the API for Upgrade()Michael Vogt
2013-08-12squash merge of the feature/apt-binary branch without the changes from ↵Michael Vogt
experimental
2013-06-09deprecate InstallProtect as a cpu-eating no-opDavid Kalnischkies
In the past packages were flagged "Protected" so that install/ remove markings where issued before the ProblemResolver. Nowadays, the marking methods check if they are allowed to modify the marking of a package instead, so that markings set by FromUser calls are not overwritten anymore by automatic calls which elimates the need for InstallProtect which just eats CPU now. The method itself is left untouched for now in case frontend needs it still for some wierd usecase, but they should be eliminated.
2012-05-15* apt-pkg/algorithms.cc:Marius Vollmer
- fix memory leak of Flags in pkgSimulate by a proper destructor
2012-05-10* apt-pkg/algorithms.cc:David Kalnischkies
- factor out of ListUpdate a AcquireUpdate to be able to provide your own pkgAcquire fetcher to the wrapper
2012-01-29* apt-pkg/algorithms.cc:Colin Watson
- use a signed int instead of short for score calculation as upgrades become so big now that it can overflow (Closes: #657732, LP: #917173)
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-12-13revert 2184.1.2: do not pollute namespace in 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-09-19use forward declaration in headers if possible instead of includesDavid Kalnischkies
2011-09-19do not pollute namespace in the headers with using (Closes: #500198)David Kalnischkies
2011-07-15merged from http://bzr.debian.org/bzr/apt/apt/debian-sidMichael Vogt
2011-07-14make ResolveByKeep() more clever and hold back packages that would go into a ↵Michael Vogt
broken policy state by the upgrade
2011-06-08* [ABI-Break] Implement EDSP in libapt-pkg so that all front-ends whichMichael Vogt
* [ABI-Break] merge lp:~mvo/apt/sha512-template to add support for sha512 * [ABI-Break] merge lp:~mvo/apt/dpointer to support easier extending without breaking the ABI
2011-05-03implement external solver calling for upgrade and dist-upgrade, tooDavid Kalnischkies
2011-03-30add a first round of stuff needed for talking between APT and solversDavid Kalnischkies
based on a very early draft for EDSP by Stefano APT can now write a scenario as well as load most stuff from it.
2011-03-26do not change protected packages in autoinstall (Closes: #618848)David Kalnischkies
2011-02-02add more dpointer placeholdersMichael Vogt
2010-07-04* apt-pkg/policy.h:David Kalnischkies
- add another round of const& madness as the previous round accidently NOT override the virtual GetCandidateVer() method (Closes: #587725)
2009-06-30add the various foldmarkers in apt-pkg & cmdline (no code change)David Kalnischkies
2008-10-01* apt-pkg/packagemanager.cc, apt-pkg/deb/dpkgpm.cc:Michael Vogt
- move the state file writting into the Go() implementation of dpkgpm (closes: #498799) * apt-pkg/algorithms.cc: - fix simulation performance drop (thanks to Ferenc Wagner for reporting the issue)
2008-01-07* move the ListUpdate() code from cachefile.h into algorithms.{cc,h}Michael Vogt
as it does not require a cachefile at all
2006-10-02* removed the pragma messMichael Vogt