summaryrefslogtreecommitdiff
path: root/apt-pkg/packagemanager.cc
Commit message (Collapse)AuthorAgeFilesLines
* fix various typos reported by spellintianDavid Kalnischkies2017-01-191-3/+3
| | | | | | | | 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
* disable explicit configuration of all packages at the endDavid Kalnischkies2016-08-101-3/+3
| | | | | | | | | | | | | | | | | | | With b4450f1dd6bca537e60406b2383ab154a3e1485f we dropped what we calculated here later on and now that we don't need it in the meantime either we can just skip the busy work by default and expect dpkg to do the right thing dropping also our little "last explicit configures" removal trick introduced in b4450f1dd6bca537e60406b2383ab154a3e1485f. This enables the last of a bunch of previously experimental options, some of them existing still, but are very special and hence not really worth documenting anymore (especially as it would need to be rewritten now entirely) which is why the documentation is nearly completely dropped. The order of configuration stanzas in the simulation code changes slightly as it isn't concerning itself with finding the 'right' order, but any order is valid anyhow as long as the entire set happens in the same call.
* simulate all package manager actions explicitlyDavid Kalnischkies2016-08-101-1/+6
| | | | | | | | | | | | | | | | | 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.
* eipp: let apt make a plan, not make stuff planeDavid Kalnischkies2016-06-291-3/+3
| | | | | | | | | | | | | | Julian noticed on IRC that I fall victim to a lovely false friend by calling referring to a 'planer' all the time even through these are machines to e.g. remove splinters from woodwork ("make stuff plane"). The term I meant is written in german in this way (= with a single n) but in english there are two, aka: 'planner'. As that is unreleased code switching all instances without any transitional provisions. Also the reason why its skipped in changelog. Thanks: Julian Andres Klode Gbp-Dch: Ignore
* eipp: enable xz-compressed scenario loggingDavid Kalnischkies2016-06-271-16/+11
| | | | | | | | | | | | In 385d9f2f23057bc5808b5e013e77ba16d1c94da4 I implemented the storage of scenario files based on enabling this by default for EIPP, but I implemented it first optionally for EDSP to have it independent. The reasons mentioned in the earlier commit (debugging and bugreports) obviously apply here, especially as EIPP solutions aren't user approved, nearly impossible to verify before starting the execution and at the time of error the scenario has changed already, so that reproducing the issue becomes hard(er).
* eipp: add Allow-Temporary-Remove-of-EssentialsDavid Kalnischkies2016-06-271-0/+2
| | | | | | | | A rather special need option, but the internal planer supports this and we have a testcase for it & sometimes it is hit (as a bug through). The option itself mostly serves as a reminder for implementors that they should be careful with removes and especially temporary removes if they perform any.
* eipp: implement Immediate-Configuration flagDavid Kalnischkies2016-06-271-1/+7
| | | | | | | | | APT has 3 modes: no immediate configuration, all packages are configured immediately and its default mode of configuring essentials and pseudo-essentials immediately only. While this seems like a job of different planers at first, it might be handy to have it as an option, too, in case a planer (like apts internal one) supports different modes where the introduction of individual planers would be counter intuitive.
* eipp: provide the internal planer as an external oneDavid Kalnischkies2016-06-271-1/+5
| | | | | | Testing the current implementation can benefit from being able to be feed an EIPP request and produce a fully compliant response. It is also a great test for EIPP in general.
* eipp: implement version 0.1 of the protocolDavid Kalnischkies2016-06-271-0/+6
| | | | | | | | | | | | | | | | | | | | | | | The very first step in introducing the "external installation planer protocol" (short: EIPP) as part of my GSoC2016 project. The description reads: APT-based tools like apt-get, aptitude, synaptic, … work with the user to figure out how their system should look like after they are done installing/removing packages and their dependencies. The actual installation/removal of packages is done by dpkg with the constrain that dependencies must be fulfilled at any point in time (e.g. to run maintainer scripts). Historically APT has a super micro-management approach to this task which hasn't aged that well over the years mostly ignoring changes in dpkg and growing into an unmaintainable mess hardly anyone can debug and everyone fears to touch – especially as more and more requirements are tacked onto it like handling cycles and triggers, dealing with "important" packages first, package sources on removable media, touch minimal groups to be able to interrupt the process if needed (e.g. unattended-upgrades) which not only sky-rocket complexity but also can be mutually exclusive as you e.g. can't have minimal groups and minimal trigger executions at the same time.
* factor out Pkg/DepIterator prettyprinters into own headerDavid Kalnischkies2016-04-281-18/+19
| | | | | | | | | 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.
* recheck Pre-Depends satisfaction in SmartConfigureDavid Kalnischkies2016-04-131-2/+2
| | | | | | | | | | | | | | | | | Regression introduced in commit 590f1923121815b36ef889033c1c416a23cbe9a2 (2011!) causing apt to not check if Pre-Depends are satisfied before calling --configure. This managed to hide so perfectly well for years as Pre-Depends aren't that common, apt prefers upgrading these packages first and checks for satisfaction is already in SmartUnpack, so there is only a small window of oppertunity to break a pre-dependency relation (usually with an unpack). Verified by logchecking with two provided status files in the buglog. I would have liked to write a test, but I wasn't able to reach the needed complexity to get apt to fail – but the change is small and reasonable, so what could possible go wrong™, right? LP: #1569099
* Fix several typosVeres Lajos2016-03-071-3/+3
| | | | | | | | | | | | | 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.
* fix alloc-dealloc-mismatch (operator new [] vs operator delete)David Kalnischkies2015-09-141-4/+4
| | | | | Reported-By: gcc -fsanitize=address -fno-sanitize=vptr Git-Dch: Ignore
* avoid using global PendingError to avoid failing too often too soonDavid Kalnischkies2015-09-141-1/+1
| | | | | | | | | | | | | | | | | | | Our error reporting is historically grown into some kind of mess. A while ago I implemented stacking for the global error which is used in this commit now to wrap calls to functions which do not report (all) errors via return, so that only failures in those calls cause a failure to propergate down the chain rather than failing if anything (potentially totally unrelated) has failed at some point in the past. This way we can avoid stopping the entire acquire process just because a single source produced an error for example. It also means that after the acquire process the cache is generated – even if the acquire process had failures – as we still have the old good data around we can and should generate a cache for (again). There are probably more instances of this hiding, but all these looked like the easiest to work with and fix with reasonable (aka net-positive) effects.
* just-in-time removal of broken essential packagesDavid Kalnischkies2015-08-271-3/+38
| | | | | | | | We deal with Conflicts in SmartUnpack in pretty much the same way, but Breaks weren't handled in SmartConfigure so that the remove was sheduled after the configuration of the package breaking the to-be-removed. Closes: 796070
* Cleanup includes after running iwyuMichael Vogt2015-08-171-1/+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-24/+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
* properly handle already reinstall pkgs in orderingDavid Kalnischkies2014-12-071-10/+36
| | | | | | | | | | | The bugreport itself describes the case of the ordering code detecting a loop where none is present, but the testcase finds also cases in which there is actually a loop and we fail to realize it. --reinstall can be considered an interactive command through and it usually doesn't encounter such "hard" problems (= looping essentials), so this is less serious than it sounds at first. Closes: 770291
* use a abi version check similar to the gcc checkDavid Kalnischkies2014-11-081-3/+3
| | | | Git-Dch: Ignore
* check for failure message in testsuccess/failureDavid Kalnischkies2014-10-201-1/+1
| | | | | | | | These functions check the exit code of the command, but for apt commands we can go further and require an error message for non-zero exits and none for zero exits. Git-Dch: Ignore
* fix: warning: extra ‘;’ [-Wpedantic]David Kalnischkies2014-09-271-1/+1
| | | | | Reported-By: gcc -Wpedantic Git-Dch: Ignore
* Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-09-051-1/+48
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: apt-pkg/acquire-item.cc configure.ac debian/changelog doc/apt-verbatim.ent doc/po/apt-doc.pot doc/po/de.po doc/po/es.po doc/po/fr.po doc/po/it.po doc/po/ja.po doc/po/pt.po po/ar.po po/ast.po po/bg.po po/bs.po po/ca.po po/cs.po po/cy.po po/da.po po/de.po po/dz.po po/el.po po/es.po po/eu.po po/fi.po po/fr.po po/gl.po po/hu.po po/it.po po/ja.po po/km.po po/ko.po po/ku.po po/lt.po po/mr.po po/nb.po po/ne.po po/nl.po po/nn.po po/pl.po po/pt.po po/pt_BR.po po/ro.po po/ru.po po/sk.po po/sl.po po/sv.po po/th.po po/tl.po po/tr.po po/uk.po po/vi.po po/zh_CN.po po/zh_TW.po test/integration/test-ubuntu-bug-346386-apt-get-update-paywall
| * Fix SmartConfigure to ignore ordering of packages that are already validMichael Vogt2014-07-291-1/+48
| | | | | | | | | | | | | | | | | | | | With the change of SmartConfigure() in git commit 42d51f the ordering code was trying to re-order dependencies, even when at this point in time this was not needed. Now it will first check all targets of the given dependency and only if there is not a good one try to reorder and unpack/configure as needed. Closes: LP: #1347721
* | Merge remote-tracking branch 'upstream/debian/sid' into debian/experimentalMichael Vogt2014-05-291-188/+166
|\| | | | | | | | | Conflicts: test/integration/test-bug-747261-arch-specific-conflicts
| * fix tight loop detection and temporary removesDavid Kalnischkies2014-05-221-171/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As outlined in #748355 apt segfaulted if it encountered a loop between a package pre-depending on a package conflicting with the previous as it ended up in an endless loop trying to unpack 'the other package'. In this specific case as an essential package is involved a lot of force needs to be applied, but can also be caused by 'normal' tight loops and highlights a problem in how we handle breaks which we want to avoid. The fix comes in multiple entangled changes: 1. All Smart* calls are guarded with loop detection. Some already had it, some had parts of it, some did it incorrect, and some didn't even try. 2. temporary removes to avoid a loop (which is done if a loop is detected) prevent the unpack of this looping package (we tried to unpack it to avoid the conflict/breaks, but due to a loop we couldn't, so we remove/deconfigure it instead which means we can't unpack it now) 3. handle conflicts and breaks very similar instead of duplicating most of the code. The only remaining difference is, as it should: deconfigure is enough for breaks, for conflicts we need the big hammer
| * consistently fail if Smart* packagemanager actions failDavid Kalnischkies2014-05-221-46/+39
| | | | | | | | | | | | | | | | These failure conditions come with an error message attached and the conditions aren't workaroundable (otherwise this would have been done instead of returning failure), so not erroring out here means that we execute dpkg later on with a known not-working ordering adding insult (our own error messages at the end) to injury (dpkg failure).
* | fix some compile errors in the now enabled #if (APT_PKG_MAJOR >= 4 && ↵Michael Vogt2014-05-071-0/+1
|/ | | | APT_PKG_MINOR < 13)
* do not configure already unpacked packages needlesslyDavid Kalnischkies2014-03-131-11/+6
| | | | | | | | | | | | | | | | | | | The unpack of a M-A:same package will force the unpack of all its siblings directly to prevent that they could be separated by later immediate actions. In commit 634985f8 a call to SmartConfigure was introduced to configure these packages at the time the installation order encounters them. Usually, the unpack order is already okay, so that this 'earlier' unpack was not needed and if it wouldn't have been done, the package would now only be unpacked, but by configuring the package now we impose new requirements which must be satisfied. The code is clever enough to handle this most of the time (it worked for 2 years!), but it isn't needed and in very coupled cases this can fail. Removing this call again removes this extra burden and so simplifies the ordering as can be seen in the modified tests. Famous last words, but I don't see a reason for this extra burden to exist hence the remove. Closes: 740843
* cleanup headers and especially #includes everywhereDavid Kalnischkies2014-03-131-2/+9
| | | | | | | | 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)
* show debug output only if told so in packagemanagerDavid Kalnischkies2014-03-131-1/+2
| | | | Git-Dch: Ignore
* Fix typos in documentation (codespell)Michael Vogt2014-02-221-8/+8
|
* restore ABI and prepare next ABI via #if (APT_PKG_MAJOR >= 4 && ↵Michael Vogt2013-10-311-6/+30
| | | | APT_PKG_MINOR >= 13)
* restore binary compatiblity with the pkgPackageManager interfaceMichael Vogt2013-10-211-0/+25
|
* re-add APT::Keep-Fds:: for the dpkg status-fd in dpkgpm.cc as we always need ↵Michael Vogt2013-10-141-13/+5
| | | | this
* move the status-fd progress reporting out of the pkgDPkgPM class, at this ↵Michael Vogt2013-10-131-5/+9
| | | | point, breaks ABI/API, lets see what we can do about this
* apt-pkg/packagemanager.cc:Michael Vogt2013-07-101-2/+2
| | | | | * apt-pkg/packagemanager.cc: - increate APT::pkgPackageManager::MaxLoopCount to 5000
* do not modify DepIterator as we might check againDavid Kalnischkies2013-06-241-5/+7
| | | | | | | | | | | | | fixup for 42d51f333e8ef522fed02cdfc48663488d56c3a3 The for-loop iterating over the DepIterators which need configuration can (and will be in 'complicated' situations) run multiple times, so we can't just GlobOr on the DepIterator as it modifies it, so that the next iteration over the list ends up checking another dependency leading us into a 'Internal error, packages left unconfigured. foopkg' maybe or we are 'lucky' and calculate a solution which might break down the line Git-Dch: Ignore
* do unpacks before configures in SmartConfigureDavid Kalnischkies2013-06-091-45/+68
| | | | | | | | | | | | | | | | | | Splits the big loop over dependencies in SmartConfigure which unpacks and configures dependencies into two loops and reverse their order, so that all dependencies which need to be unpacked are handled first and only after that configures are issued for dependencies. This is needed as otherwise the unpack of a (new) dependency will be issued in between a configure call for two (or more) packages which form a loop, which means the configure calls aren't part of the same dpkg call and therefore dpkg bails out. Such tight loops should really be avoided as they are usually wrong – and in reality the dependencies in libreoffice were greatly simplified thanks to Rene Engelhard so the problem is gone for the benefit of all. Closes: 707578
* * apt-pkg/packagemanager.cc:David Kalnischkies2012-10-241-0/+2
| | | | | - do not do lock-step configuration for a M-A:same package if it isn't unpacked yet in SmartConfigure and do not unpack a M-A:same package again in SmartUnPack if we have already configured it (LP: #1062503)
* unpack versions only in case a different version from the packageDavid Kalnischkies2012-09-031-1/+4
| | | and avoid re-unpack otherwise (Closes: #670900)
* * apt-pkg/packagemanager.cc:David Kalnischkies2012-08-301-1/+3
| | | | | - unpack versions in case a different version from the package is currently in unpack state to recover from broken system states (like different file in M-A:same package and other dpkg errors)
* * apt-pkg/packagemanager.cc:David Kalnischkies2012-07-181-1/+1
| | | | - do not segfault if nothing can be configured to statisfy a pre-depends (e.g. in a pre-depends loop) (Closes: #681958)
* * apt-pkg/packagemanager.cc:David Kalnischkies2012-05-191-1/+1
| | | - do not run into loop on new-pre-depends-breaks (Closes: #673536)
* ensure that apti18n.h is included last as advertised (Closes: #671623)David Kalnischkies2012-05-051-1/+2
|
* * apt-pkg/packagemanager.cc:Malcolm Scott2012-04-191-2/+2
| | | | | - iterate over all pre-depends or-group member instead of looping endlessly over the first member in SmartUnpack (LP: #985852)
* * apt-pkg/packagemanager.cc:David Kalnischkies2012-04-161-1/+1
| | | | - init counter in SmartConfigure so that the loop-breaker isn't triggered at random… (Closes: #669060)
* apt-pkg/packagemanager.cc: tweak MaxLoopCount to 500 and improve the error ↵Michael Vogt2012-04-121-3/+3
| | | | message
* add APT::pkgPackageManager::MaxLoopCount to ensure that theMichael Vogt2012-03-131-2/+12
| | | | ordering code does not get into a endless loop when it flip-flops between two states