summaryrefslogtreecommitdiff
path: root/apt-pkg/algorithms.cc
AgeCommit message (Collapse)Author
2018-05-07Remove obsolete RCS keywordsGuillem Jover
Prompted-by: Jakub Wilk <jwilk@debian.org>
2018-05-05Fix various typos reported by spellcheckersDavid Kalnischkies
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-06-26avoid explicit types for pkg counts by autoDavid Kalnischkies
Changes nothing on the program front and as the datatypes are sufficently comparable fixes no bug either, but problems later on if we ever change the types of those and prevent us using types which are too large for the values we want to store waste (a tiny bit of) resources. Gbp-Dch: Ignore
2017-01-31algorithms: Fix typo: gental -> gentleJulian Andres Klode
Oh dear, nobody (or rather no tool) saw that yet... Gbp-Dch: ignore
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-12-31use FindB instead of FindI for Debug::pkgAutoRemoveDavid Kalnischkies
Again no practical difference, but for consistency a boolean option should really be accessed via a boolean method rather than an int especially if you happen to try setting the option to "true" … Gbp-Dch: Ignore
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 logging is requested, do it for internal, tooDavid Kalnischkies
Create and log the EDSP(like) request even if we use the internal resolver.
2016-05-20edsp: add Forbid-{New-Install,Remove} and Upgrade-AllDavid Kalnischkies
This allows to differentiate properly between 'apt-get upgrade', 'apt upgrade' and 'apt full-upgrade'.
2016-04-28factor out Pkg/DepIterator prettyprinters into own headerDavid Kalnischkies
The old prettyprinters have only access to the struct they pretty print, which isn't enough usually as we want to know for a package also a bit of state information like which version is the candidate. We therefore need to pull the DepCache into context and hence use a temporary struct which is printed instead of the iterator itself.
2016-03-07apt-pkg/algorithms.cc: Avoid stack buffer overflow in KillListJulian Andres Klode
Dynamically allocate KillList in order to avoid an overflow when more than 100 elements would be written to it. This happened while playing around with the status file from Bug#701069 on a modern system.
2015-11-05apply various suggestions made by cppcheckDavid Kalnischkies
Reported-By: cppcheck Git-Dch: Ignore
2015-11-04sanify API to get 'the' candidate versionDavid Kalnischkies
This was discussed a while ago on #debian-apt and now that I see myself making this mistake lets bite the bullet and fix it in the easy way out version: Using a new name which fits with a similar named setter and deprecate the old method instead of 'hostily' changing API. Closes: #803471
2015-10-30algorithms: Replace qsort() by thread-safe std::sort()Julian Andres Klode
Gbp-Dch: ignore
2015-08-17Cleanup includes after running iwyuMichael Vogt
2015-08-13Deprecate SPtrArray<T> and convert everyone to unique_ptr<T[]>Julian Andres Klode
More standardization
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-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-03-16merge debian/sid into debian/experimentalDavid Kalnischkies
2015-01-10award points for positive dependencies againDavid Kalnischkies
Commit 9ec748ff103840c4c65471ca00d3b72984131ce4 from Feb 23 last year adds a version check after 8daf68e366fa9fa2794ae667f51562663856237c added 8 days earlier negative points for breaks/conflicts with the intended that only dependencies which are satisfied propagate points (aka: old conflicts do not). The implementation was needlessly complex and flawed through preventing positive dependencies from gaining points like they did before these commits making library transitions harder instead of simpler. It worked out anyhow most of the time out of pure 'luck' (and other ways of gaining points) or got miss attributed to being a temporary hick-up. Closes: 774924
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-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-04-11consider priorities only for downloadable pkgs in resolverDavid Kalnischkies
A package which can't be downloaded anymore is very likely dropped from a release and can therefore no longer be 'standard' (or similar). We therefore do not grant points for them anymore and demote them to prio:extra instead which helps other packages breaking them away even if they have a lower priority. The testcase was initially created by Michael Vogt and just amended.
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: useless cast to type A [-Wuseless-cast]David Kalnischkies
Git-Dch: Ignore Reported-By: gcc -Wuseless-cast
2014-03-13check version before adding scores in resolverDavid Kalnischkies
Prevents that "old" dependencies have an influence in the scoring. With positive dependencies this is usually not a problem, but negative dependencies can linger around for a long time.
2014-03-13do not do the same looping twiceDavid Kalnischkies
Git-Dch: Ignore
2014-03-13propagate a negative score point along breaks/conflictsDavid Kalnischkies
versioned -dev packages like db and boost have the problem of no dependencies which would give them a competitive advantage against an older incarnation of the -dev package, so they tend to be kept back until the old version is removed from the archive, which, if the user has older releases in its sources can take a long time (or never happens). The newer version has a conflicts/breaks against the older one, but the older one hasn't against the newer, so by giving via the conflicts the older one a reduced score the newer one can win if there is no other reason to keep it. If both have a conflict against each other the scoring will cancel itself out, so no harm done. This gives "action" a slightly bigger edge in breaks/conflicts cases than before, but holding back isn't a really good solution anyway.
2014-02-22Fix typos in documentation (codespell)Michael 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-07-02Merge remote-tracking branch 'donkult/debian/sid' into debian/sidMichael Vogt
Conflicts: debian/changelog
2013-06-28make starting debug output of pkgProblemResolver proper englishMichael Vogt
2013-06-27use just one line for the debug output (thanks to donkult for the review)Michael Vogt
2013-06-27show broken count when starting the resolverMichael Vogt
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.
2013-05-08merged from the debian-wheezy branchMichael Vogt
2013-05-08* apt-pkg/algorithms.cc:Michael Vogt
- Do not propagate negative scores from rdepends. Propagating the absolute value of a negative score may boost obsolete packages and keep them installed instead of installing their successors. (Closes: #699759)
2013-01-08fix pkgProblemResolver::Scores, thanks to Paul Wise. Michael Vogt
Closes: #697577
2013-01-08fix pkgProblemResolver::Scores, thanks to Paul Wise. Michael Vogt
Closes: #697577
2012-11-10* apt-pkg/algorithms.cc:Jonathan Thomas
- fix package-pointer array memory leak in ResolveByKeepInternal()
2012-11-09* apt-pkg/algorithms.cc:David Kalnischkies
- ensure pkgProblemResolver calls MarkDelete without FromUser set so that it can't overrule holds and the protection flag
2012-09-09handle packages without a mandatory architecture (debian-policy §5.3)David Kalnischkies
by introducing a pseudo-architecture 'none' so that the small group of users with these packages can get right of them without introducing too much hassle for other users (Closes: #686346)
2012-06-10* apt-pkg/deb/deblistparser.cc:David Kalnischkies
- set pkgCacheGen::Essential to "all" again (Closes: #675449) * apt-pkg/algorithms.cc: - force install only for one essential package out of a group
2012-05-15* apt-pkg/algorithms.cc:Marius Vollmer
- fix memory leak of Flags in pkgSimulate by a proper destructor