summaryrefslogtreecommitdiff
path: root/apt-pkg/algorithms.h
Commit message (Collapse)AuthorAgeFilesLines
* Determine autoremovable kernels at run-timeJulian Andres Klode2021-01-041-0/+14
| | | | | | | | | | | | | | | | | | | | | | | 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
* apt-pkg: default visibility to hiddenJulian Andres Klode2020-02-261-7/+7
|
* Rename pkgSimulate::Go2 to pkgSimulate::GoJulian Andres Klode2020-02-261-2/+1
|
* Fix typos reported by codespell in code commentsDavid Kalnischkies2019-07-101-1/+1
| | | | | | | | Also in old changelogs, but nothing really user visible like error messages or alike so barely noteworthy. Reported-By: codespell Gbp-Dch: Ignore
* Run unifdef -DAPT_{8,9,10,15}_CLEANER_HEADERSJulian Andres Klode2019-06-121-9/+0
|
* algorithms: Remove deprecated ProblemResolver::InstallProtect()Julian Andres Klode2019-02-261-2/+0
|
* Reformat and sort all includes with clang-formatJulian Andres Klode2017-07-121-3/+2
| | | | | | | | | | | | | 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.
* simulate all package manager actions explicitlyDavid Kalnischkies2016-08-101-1/+9
| | | | | | | | | | | | | | | | | 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.
* edsp: if internal is used, keep this decisionDavid Kalnischkies2016-06-081-3/+2
| | | | | | | | | 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.
* Fix several typosVeres Lajos2016-03-071-2/+2
| | | | | | | | | | | | | 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.
* add messages to our deprecation warnings in libaptDavid Kalnischkies2015-11-271-1/+1
| | | | Git-Dch: Ignore
* algorithms: Replace qsort() by thread-safe std::sort()Julian Andres Klode2015-10-301-2/+1
| | | | Gbp-Dch: ignore
* remove the compatibility markers for 4.13 abiDavid Kalnischkies2015-08-101-10/+0
| | | | | | | | 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
* add c++11 override marker to overridden methodsDavid Kalnischkies2015-08-101-4/+4
| | | | | | | | | 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
* make all d-pointer * const pointersDavid Kalnischkies2015-08-101-2/+2
| | | | | | | | | | | | | | 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
* apply various style suggestions by cppcheckDavid Kalnischkies2015-08-101-3/+3
| | | | | | | Some of them modify the ABI, but given that we prepare a big one already, these few hardly count for much. Git-Dch: Ignore
* add d-pointer, virtual destructors and de-inline de/constructorsDavid Kalnischkies2015-06-161-3/+3
| | | | | | | | 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
* explicit overload methods instead of adding parametersDavid Kalnischkies2014-11-081-0/+10
| | | | | | | | 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
* mark private methods as hiddenDavid Kalnischkies2014-09-301-9/+9
| | | | | | | | | | 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
* fix progress output for (dist-)upgrade calculationDavid Kalnischkies2014-09-271-5/+5
| | | | | | | | | | | | | | | | | 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.
* follow method attribute suggestions by gccDavid Kalnischkies2014-03-131-1/+1
| | | | | Git-Dch: Ignore Reported-By: gcc -Wsuggest-attribute={pure,const,noreturn}
* cleanup headers and especially #includes everywhereDavid Kalnischkies2014-03-131-1/+4
| | | | | | | | 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)
* Fix typos in documentation (codespell)Michael Vogt2014-02-221-2/+2
|
* small documentation updatesMichael Vogt2013-11-011-1/+1
|
* Move ListUpdate/AquireUpdate into update.{cc,h}Michael Vogt2013-10-051-5/+1
| | | | | This moves the ListUpdate/AquireUpdate out of the "catch-all" algorithm.{cc,h} file into its own update.{cc,h}
* * move upgrade releated code into upgrade.{cc,h}Michael Vogt2013-10-051-15/+5
| | | | | | 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).
* cleanup upgrade API some more (thanks for the feedback from David)Michael Vogt2013-10-051-4/+6
|
* improve the API for Upgrade()Michael Vogt2013-09-181-2/+10
|
* squash merge of the feature/apt-binary branch without the changes from ↵Michael Vogt2013-08-121-0/+4
| | | | experimental
* deprecate InstallProtect as a cpu-eating no-opDavid Kalnischkies2013-06-091-3/+4
| | | | | | | | | | | | 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.
* * apt-pkg/algorithms.cc:Marius Vollmer2012-05-151-0/+1
| | | | - fix memory leak of Flags in pkgSimulate by a proper destructor
* * apt-pkg/algorithms.cc:David Kalnischkies2012-05-101-1/+3
| | | | - factor out of ListUpdate a AcquireUpdate to be able to provide your own pkgAcquire fetcher to the wrapper
* * apt-pkg/algorithms.cc:Colin Watson2012-01-291-1/+1
| | | | | - use a signed int instead of short for score calculation as upgrades become so big now that it can overflow (Closes: #657732, LP: #917173)
* revert 2184.1.3: forward declaration instead of headersDavid Kalnischkies2011-12-131-0/+1
| | | | | The breakage is just to big for now, so guard the change with #ifndef APT_8_CLEANER_HEADERS and be nice to library users
* revert 2184.1.2: do not pollute namespace in headersDavid Kalnischkies2011-12-131-0/+4
| | | | | The breakage is just to big for now, so guard the change with #ifndef APT_8_CLEANER_HEADERS and be nice to library users
* use forward declaration in headers if possible instead of includesDavid Kalnischkies2011-09-191-1/+2
|
* do not pollute namespace in the headers with using (Closes: #500198)David Kalnischkies2011-09-191-4/+2
|
* merged from http://bzr.debian.org/bzr/apt/apt/debian-sidMichael Vogt2011-07-151-0/+3
|\
| * make ResolveByKeep() more clever and hold back packages that would go into a ↵Michael Vogt2011-07-141-0/+3
| | | | | | | | broken policy state by the upgrade
* | * [ABI-Break] Implement EDSP in libapt-pkg so that all front-ends whichMichael Vogt2011-06-081-0/+3
|\ \ | | | | | | | | | | | | * [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
| * | add more dpointer placeholdersMichael Vogt2011-02-021-0/+3
| | |
* | | implement external solver calling for upgrade and dist-upgrade, tooDavid Kalnischkies2011-05-031-0/+1
| | |
* | | add a first round of stuff needed for talking between APT and solversDavid Kalnischkies2011-03-301-0/+2
| |/ |/| | | | | | | | | based on a very early draft for EDSP by Stefano APT can now write a scenario as well as load most stuff from it.
* | do not change protected packages in autoinstall (Closes: #618848)David Kalnischkies2011-03-261-1/+1
|/
* * apt-pkg/policy.h:David Kalnischkies2010-07-041-1/+1
| | | | - add another round of const& madness as the previous round accidently NOT override the virtual GetCandidateVer() method (Closes: #587725)
* add the various foldmarkers in apt-pkg & cmdline (no code change)David Kalnischkies2009-06-301-4/+4
|
* * apt-pkg/packagemanager.cc, apt-pkg/deb/dpkgpm.cc:Michael Vogt2008-10-011-0/+1
| | | | | | | - 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)
* * move the ListUpdate() code from cachefile.h into algorithms.{cc,h}Michael Vogt2008-01-071-0/+3
| | | | as it does not require a cachefile at all
* * removed the pragma messMichael Vogt2006-10-021-3/+0
|