summaryrefslogtreecommitdiff
path: root/apt-pkg/algorithms.cc
Commit message (Collapse)AuthorAgeFilesLines
* simulate all package manager actions explicitlyDavid Kalnischkies2016-08-101-2/+63
| | | | | | | | | | | | | | | | | 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 logging is requested, do it for internal, tooDavid Kalnischkies2016-06-081-4/+5
| | | | | Create and log the EDSP(like) request even if we use the internal resolver.
* edsp: add Forbid-{New-Install,Remove} and Upgrade-AllDavid Kalnischkies2016-05-201-2/+4
| | | | | This allows to differentiate properly between 'apt-get upgrade', 'apt upgrade' and 'apt full-upgrade'.
* factor out Pkg/DepIterator prettyprinters into own headerDavid Kalnischkies2016-04-281-8/+9
| | | | | | | | | 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.
* apt-pkg/algorithms.cc: Avoid stack buffer overflow in KillListJulian Andres Klode2016-03-071-10/+9
| | | | | | | | 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.
* apply various suggestions made by cppcheckDavid Kalnischkies2015-11-051-1/+1
| | | | | Reported-By: cppcheck Git-Dch: Ignore
* sanify API to get 'the' candidate versionDavid Kalnischkies2015-11-041-1/+1
| | | | | | | | | 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
* algorithms: Replace qsort() by thread-safe std::sort()Julian Andres Klode2015-10-301-37/+44
| | | | Gbp-Dch: ignore
* Cleanup includes after running iwyuMichael Vogt2015-08-171-2/+0
|
* Deprecate SPtrArray<T> and convert everyone to unique_ptr<T[]>Julian Andres Klode2015-08-131-12/+12
| | | | More standardization
* remove the compatibility markers for 4.13 abiDavid Kalnischkies2015-08-101-14/+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
* make all d-pointer * const pointersDavid Kalnischkies2015-08-101-1/+1
| | | | | | | | | | | | | | 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
* merge debian/sid into debian/experimentalDavid Kalnischkies2015-03-161-1/+1
|\
| * award points for positive dependencies againDavid Kalnischkies2015-01-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | explicit overload methods instead of adding parametersDavid Kalnischkies2014-11-081-0/+12
| | | | | | | | | | | | | | | | 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
* | fix progress output for (dist-)upgrade calculationDavid Kalnischkies2014-09-271-10/+6
|/ | | | | | | | | | | | | | | | | 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.
* consider priorities only for downloadable pkgs in resolverDavid Kalnischkies2014-04-111-8/+11
| | | | | | | | | | 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.
* cleanup headers and especially #includes everywhereDavid Kalnischkies2014-03-131-7/+6
| | | | | | | | 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)
* warning: useless cast to type A [-Wuseless-cast]David Kalnischkies2014-03-131-2/+2
| | | | | Git-Dch: Ignore Reported-By: gcc -Wuseless-cast
* check version before adding scores in resolverDavid Kalnischkies2014-03-131-1/+12
| | | | | | 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.
* do not do the same looping twiceDavid Kalnischkies2014-03-131-7/+1
| | | | Git-Dch: Ignore
* propagate a negative score point along breaks/conflictsDavid Kalnischkies2014-03-131-14/+25
| | | | | | | | | | | | | | | | | 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.
* Fix typos in documentation (codespell)Michael Vogt2014-02-221-6/+6
|
* Move ListUpdate/AquireUpdate into update.{cc,h}Michael Vogt2013-10-051-99/+0
| | | | | 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-238/+0
| | | | | | 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-10/+15
|
* improve the API for Upgrade()Michael Vogt2013-09-181-8/+30
|
* squash merge of the feature/apt-binary branch without the changes from ↵Michael Vogt2013-08-121-5/+46
| | | | experimental
* Merge remote-tracking branch 'donkult/debian/sid' into debian/sidMichael Vogt2013-07-021-2/+4
|\ | | | | | | | | Conflicts: debian/changelog
| * deprecate InstallProtect as a cpu-eating no-opDavid Kalnischkies2013-06-091-2/+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.
* | make starting debug output of pkgProblemResolver proper englishMichael Vogt2013-06-281-2/+4
| |
* | use just one line for the debug output (thanks to donkult for the review)Michael Vogt2013-06-271-4/+2
| |
* | show broken count when starting the resolverMichael Vogt2013-06-271-2/+6
|/
* merged from the debian-wheezy branchMichael Vogt2013-05-081-1/+4
|\
| * * apt-pkg/algorithms.cc:Michael Vogt2013-05-081-1/+4
| | | | | | | | | | | | - 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)
* | fix pkgProblemResolver::Scores, thanks to Paul Wise. Michael Vogt2013-01-081-8/+11
|\ \ | |/ |/| Closes: #697577
| * fix pkgProblemResolver::Scores, thanks to Paul Wise. Michael Vogt2013-01-081-7/+7
|/ | | Closes: #697577
* * apt-pkg/algorithms.cc:Jonathan Thomas2012-11-101-3/+9
| | | | - fix package-pointer array memory leak in ResolveByKeepInternal()
* * apt-pkg/algorithms.cc:David Kalnischkies2012-11-091-8/+8
| | | | - ensure pkgProblemResolver calls MarkDelete without FromUser set so that it can't overrule holds and the protection flag
* handle packages without a mandatory architecture (debian-policy §5.3)David Kalnischkies2012-09-091-0/+5
| | | | | 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)
* * apt-pkg/deb/deblistparser.cc:David Kalnischkies2012-06-101-5/+30
| | | | | - set pkgCacheGen::Essential to "all" again (Closes: #675449) * apt-pkg/algorithms.cc: - force install only for one essential package out of a group
* * apt-pkg/algorithms.cc:Marius Vollmer2012-05-151-0/+6
| | | | - fix memory leak of Flags in pkgSimulate by a proper destructor
* * apt-pkg/algorithms.cc:David Kalnischkies2012-05-101-11/+26
| | | | - factor out of ListUpdate a AcquireUpdate to be able to provide your own pkgAcquire fetcher to the wrapper
* merge with apt/experimentalDavid Kalnischkies2012-03-061-2/+11
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * apt-pkg/packagemanager.cc: - fix bug in predepends handling - ensure that packages that needs unpackaging are unpacked before they are configured (LP: #927993) [ Julian Andres Klode ] * apt-pkg/deb/deblistparser.cc: - Set the Essential flag on APT instead of only Important * apt-pkg/packagemanager.cc: - Do not use immediate configuration for packages with the Important flag * Treat the Important flag like the Essential flag with those differences: - No Immediate configuration (see above) - Not automatically installed during dist-upgrade - No higher score for installation ordering
| * * Treat the Important flag like the Essential flag with two differences:Julian Andres Klode2012-03-051-2/+11
| | | | | | | | - No Immediate configuration (see above) - Not automatically installed during dist-upgrade
* | fix a bunch of cppcheck "(warning) Member variable '<#>' is notDavid Kalnischkies2012-03-041-1/+1
|/ | | | initialized in the constructor." messages (no functional change)
* * apt-pkg/algorithms.cc:Colin Watson2012-01-291-15/+15
| | | | | - use a signed int instead of short for score calculation as upgrades become so big now that it can overflow (Closes: #657732, LP: #917173)
* * apt-pkg/algorithms.cc:Colin Watson2012-01-291-2/+1
| | | | | - don't break out of the main-resolver loop for Breaks to deal with all of them in a single iteration (Closes: #657695, LP: #922485)
* merge with my debian-sid branchDavid Kalnischkies2011-10-301-2/+9
|\
| * * algorithms.cc:David Kalnischkies2011-10-171-2/+9
| | | | | | - show a debug why a package was kept by ResolveByKeep()