summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'fix/recursivemark' into 'main'Julian Andres Klode2021-09-0611-129/+281
|\ | | | | | | | | Fix infinite recursions in MarkPackage and improve recursions in general See merge request apt-team/apt!183
| * Increase recursion limits from 100 to 3000David Kalnischkies2021-08-293-5/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you install dpkg on an empty status file with all recommends and suggests apt wants to install 4000+ packages. The deepest chain seemingly being 236 steps long. And dpkg isn't even the worst (~259). That is a problem as libapt has a hardcoded recursion limit for MarkInstall and friends … set to 100. We are saved by the fact that chains without suggests are much shorter (dpkg has 5, max seems ~43), but I ignored Conflicts in these chains, which typically trigger upgrades, so if two of the worst are chained together we suddenly get dangerously close to the limit still. So, lets just increase the limit into oblivion as it is really just a safety measure we should not be running into to begin with. MarkPackage was running years without it after all. 3000 is picked as a nice number as any other and because it is roughly the half of the stack crashs I saw previously in this branch.
| * Stop autoremover from endlessly exploring cyclic providersDavid Kalnischkies2021-08-282-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fullyExplored is needed to keep track of having explored all providers of a package name, while Marked is tracking if we have explored a given real package (along its chosen version), so we should stop MarkPackage from exploring a (real) package if it is marked and let fullyExplored only guard the looping over the individual dependencies. The testcase is deceptively simple, but in practice only an ecosystem like rust who makes heavy use of cyclic dependency relations intermixed with versioned provides actually triggers this as seen by the buggy code being in use for four months in Debian and Ubuntu development releases. (easier to trigger if most packages are marked manual installed) Note that the testcase is successful already due to the earlier changes as we exit the recursion eventually and all packages are marked as they need to be already, but this fix does work standalone as well. Closes: #992993
| * Don't venture too deeply in AutoRemovers MarkPackageDavid Kalnischkies2021-08-281-9/+16
| | | | | | | | | | | | MarkInstall has the same depth limit, so lets use this arbitrary limit to avoid trying to hard as that usually means we will never stop – at least not until we crash, which is not a very good error case.
| * Move hidden MarkPackage to a static functionDavid Kalnischkies2021-08-282-113/+93
| | | | | | | | | | | | | | | | | | | | We can't have external users as its marked hidden and as we don't even have users outside of pkgDepCache itself we can remove the function completely from the public eye. That adds many new parameters, but it also allows to add a few more like avoiding constantly checking the debug config value. Gbp-Dch: Ignore
| * Simplify selection of highest source version providersDavid Kalnischkies2021-08-281-6/+3
| | | | | | | | | | | | | | | | | | The old code is a bit longer and does a sort (N*log(N)) + find (at most N) It is replaced by max_element (N) + remove_if (N). The practical difference is minimal as the N we operate on is rather small, but the replacement is hopefully easier to understand at a glance as well. Gbp-Dch: Ignore
| * Inhibit autoremove calculation in apt-mark and apt showDavid Kalnischkies2021-08-282-0/+5
| | | | | | | | | | | | | | As we never display the information in these code paths there isn't a lot of point in calculating it first saving us some precious CPU cycles. References: d6f3458badf2cfea3ca7de7632ae31daff5742be
| * Try to show core dump info in test frameworkDavid Kalnischkies2021-08-284-5/+65
|/ | | | | | | | If the system tells us that a core dump was created we should try to display the contained info as that system might not be easily available when we see the error (like C-I or autopkgtest). Gbp-Dch: Ignore
* Dutch manpages translation updateFrans Spiesschaert2021-08-181-25/+13
| | | | Closes: #992352
* Release 2.3.82.3.8Julian Andres Klode2021-08-145-6/+13
|
* Bump to C++17Julian Andres Klode2021-08-092-2/+2
| | | | | Comparison operators need to be const-invocable now, but otherwise no change seems necessary.
* Release 2.3.72.3.7Julian Andres Klode2021-07-2915-37/+160
|
* Merge branch 'pu/fetch-at' into 'main'Julian Andres Klode2021-07-297-17/+139
|\ | | | | | | | | Main-process-side implementation of retry back-off See merge request apt-team/apt!181
| * tests (retry-downloads): Avoid delay in second testJulian Andres Klode2021-07-291-1/+1
| | | | | | | | This delay of 4+2+1=7 seconds in unnecessary.
| * Enhance test to check time spentJulian Andres Klode2021-07-291-1/+17
| | | | | | | | | | | | | | | | This is subject to clock skew, unfortunately, as we cannot read monotonic time in shell. We check for >=5s out of the 7s it should take to reduce the risk of skew a bit.
| * Add support for a maximum delay and testing of delayJulian Andres Klode2021-07-283-3/+20
| | | | | | | | | | | | This is very basic support on the testing side, we just test the debug output but not how long it actually took. Would be nice to check time really.
| * Properly convert PulseInterval to timevalJulian Andres Klode2021-07-281-6/+3
| | | | | | | | | | Fix the typo, and use the helper function to convert it, so we do not end up with 5 seconds encoded as 0s and 5*10^6 microseconds.
| * Convert to monotonic clockJulian Andres Klode2021-07-285-22/+33
| | | | | | | | | | This yields more accurate delays and avoids issues with clock skew.
| * acquire: Automatically reduce select() timeout as neededJulian Andres Klode2021-07-281-1/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If there is an item with fetchAfter at the top of a queue, reduce sleep() timeout so we can detect it and start it, by calling Cycle() on the queue in the next iteration. For some reasons we have to call select() with a 0s timeout if we just marked an item as ready. Oh well. Previous versions of this patch only called global Bump() after a timeout from select(); this was unfortunately incorrect - it meant that we never bumped a queue that did not start yet while other queues were running, potentially significantly delaying retries.
| * Implement exponential delay between retriesJulian Andres Klode2021-07-286-4/+51
| | | | | | | | | | | | | | Add a new Item field called FetchAfter, which determines the earliest time the item should be fetched at. Adjust insertion into queue to take it into account alongside priority, and only fill pipelines with items that are ready.
| * pkgAcqIndex::CommonFailed: Set StatIdle before calling Init()Julian Andres Klode2021-07-131-1/+1
|/ | | | | | | | Enqueuing by calling Init(), and then resetting the status to idle means that the item can get enqueued twice if we call Cycle() from inside pkgAcquire::Run(). Reset the status to StatIdle before calling Init()
* Merge branch 'fix/dpkgchroot' into 'main'Julian Andres Klode2021-07-054-30/+34
|\ | | | | | | | | Restore dpkg::chroot-directory functionality See merge request apt-team/apt!178
| * Restore dpkg::chroot-directory functionalityDavid Kalnischkies2021-06-104-30/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we call dpkg inside a chroot we have to ensure that the temporary directory we construct to call dpkg --recursive is inside the chroot and that we strip the path to the chroot from the directory name we pass to dpkg. Note that the added test succeeds before and (hopefully) after as we can't really chroot here or fiddle with the needed settings as we are already setting up apt to work with a quasi-chroot. The test perhaps helps in ensuring we don't break it too much in the future though. (Broken five years (and one day) ago this seems to have an immense user base at the moment, but it might in the future via mmdebstrap) References: f495992428a396e0f98886c9a761a804aa161c68 Reported-By: Johannes Schauer Marin Rodrigues on IRC Tested-By: Johannes Schauer Marin Rodrigues
* | Merge branch 'fix/sizesharing' into 'main'Julian Andres Klode2021-07-0518-43/+173
|\ \ | | | | | | | | | | | | Allow packages from volatile sources to be reinstalled See merge request apt-team/apt!177
| * | Test that tiny differences result in different versionsDavid Kalnischkies2021-06-101-0/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | Just because two packages have the same version number doesn't mean it is the same package. APT can detect rebuilds and other "inconsistencies", but we had no explicit test for it so far. It turned out to be the wrong track in this branch, but as I wrote it already, lets add it at least. Gbp-Dch: Ignore
| * | Give our test packages proper size informationDavid Kalnischkies2021-06-1016-41/+66
| | | | | | | | | | | | | | | | | | | | | | | | Temporary hacks should be temporary, especially if they hide bugs. After fixing one in the previous commit this is just busy work to add download information to the places which check that output. Gbp-Dch: Ignore
| * | Store size from volatile sources for already installed versionsDavid Kalnischkies2021-06-102-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | Volatile sources are parsed after the status file, so if we have a version already installed the size information is not stored, so that a reinstall of said version is refused claiming a broken repository. References: 1412cf51403286e9c040f9f86fd4d8306e62aff2
| * | Use full item description in broken repo errorDavid Kalnischkies2021-06-102-4/+3
| |/ | | | | | | | | | | | | | | The error says the repository is broken but doesn't mention which one it is. The item description gives us at least all the information, but is not as nicely formatted. As this message is not even marked for translation this is a rather temporary affair and we can survive without the eye candy for a while.
* | Check sources.list could be parsed before adding volatile filesJulian Andres Klode2021-07-012-0/+17
| | | | | | | | | | | | | | We just used the pointer returned which might be nullptr, properly call BuildSourceList() and check the result first. Closes: #990518
* | apt.conf(5): indicate # is also used for commentsDillon Brock2021-06-251-0/+1
|/ | | | LP: #1309658
* Release 2.3.62.3.6Julian Andres Klode2021-06-095-6/+15
|
* Merge branch 'fix/uriencodefilename' into 'main'Julian Andres Klode2021-06-098-37/+91
|\ | | | | | | | | URI encode filename fields (again) See merge request apt-team/apt!175
| * No URL decode and quoting support for Files in SourcesDavid Kalnischkies2021-06-042-16/+24
| | | | | | | | | | | | | | | | The code exists since ever, but no other client supports this and the specification like debian-policy isn't asking for this either. What it does do is breaking than all others continue working through: If the filename includes in fact URI encoded bits (hopefully no quotes) which is rather unlikely, but none the less possible.
| * Do not use filename of local sources in 'apt download'David Kalnischkies2021-06-043-12/+14
| | | | | | | | | | | | | | | | | | | | If a source is not copying files to the destination the download code forces the copy – which in practice are local repositories accessed via file:/ – but in that process takes the filename the local repo used rather than the filename it e.g. advertised via --print-uris. A local repository could hence override a file in the current directory if you use 'apt download', which is a rather weak ability, but still.
| * URI encode Filename field of Packages files (again)David Kalnischkies2021-06-045-15/+59
|/ | | | | | | | | | | | | | Keeping URIs encoded in the acquire system depends on having them encoded in the first place. While many other places got the encoding 2 out of 3 ArchiveURI implementations were missed which are in practice responsible for nearly all of the URI building, just that index filename do not contain characters to escape and the Filename fields in Packages files usually aren't. Usually. Except if you happen to have e.g. an epoch featuring package with the colon encoded in the filename. On the upside, in most repositories the epoch isn't part of the filename. Reported-By: Johannes 'josch' Schauer on IRC References: e6c55283d235aa9404395d30f2db891f36995c49
* Release 2.3.52.3.5Julian Andres Klode2021-05-175-6/+12
|
* policy: Apply phasing to uninstalled packages tooJulian Andres Klode2021-05-172-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a package is not installed yet, we do need to apply phasing as we otherwise get into weird situations when installing packages: In the launchpad bug below, ubuntu-release-upgrader-core was installed, and hence the phasing for the upgrade to it was applied. However, ubuntu-release-upgrader-gtk was about to be installed - and hence the phasing did not apply, causing a version mismatch, because ubuntu-release-upgrader-gtk from -updates was used, but -core from release pocket. Sigh. An alternative approach to dealing with this issue could be to apply phasing to all packages within the same source package, which would work in most cases. However, there might be unforeseen side effects and it is of course possible to have = depends between source packages, such as -signed packages on the unsigned ones for bootloaders. This problem does not occur in the update-manager implementation of phased updates as update-manager only deals with upgrading packages, but does not install new packages and thus does not see that issue. APT however, has to apply phasing more broadly, as you can and often do install additional packages during upgrade, or upgrade packages during install commands, as both accept package list arguments and have the same code in the backend. LP: #1925745
* Release 2.3.42.3.4Julian Andres Klode2021-05-125-6/+16
|
* Turn TLS handshake issues into transient errorsJulian Andres Klode2021-05-122-1/+44
| | | | | | | This makes them retriable, and brings them more into line with TCP, where handshake is also a transient error. LP: #1928100
* Merge branch 'master' of https://github.com/kraj/aptJulian Andres Klode2021-05-051-0/+7
|\ | | | | | | See https://github.com/Debian/apt/pull/129
| * srvrec: Keep support for older resolverKhem Raj2021-03-201-0/+7
| | | | | | | | | | | | | | | | | | Some C libraries e.g. musl do not implement the new res_n* APIs therefore keep the old implementation as fallback and check __RES version macro to determine the API level Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Julian Andres Klode <julian.klode@canonical.com>
* | Release 2.3.32.3.3Julian Andres Klode2021-04-295-6/+24
| |
* | Temporarily Revert "2.3-only: Warn that the 0.1 protocol is deprecated"Julian Andres Klode2021-04-292-12/+7
| | | | | | | | This reverts commit 64127478630b676838735b509fec5cdfa36874c8.
* | Merge branch 'BrianMurray-main-patch-26842' into 'main'Julian Andres Klode2021-04-291-1/+1
|\ \ | | | | | | | | | | | | Fix a typo in json-hooks-protocol.md See merge request apt-team/apt!173
| * | Fix a typo in json-hooks-protocol.mdBrian Murray2021-04-281-1/+1
| | |
* | | Merge branch 'pu/upgradecounter' into 'main'Julian Andres Klode2021-04-299-42/+108
|\ \ \ | | | | | | | | | | | | | | | | Count uninstallable packages in "not upgraded" See merge request apt-team/apt!169
| * | | Count uninstallable packages in "not upgraded"David Kalnischkies2021-04-259-42/+108
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a first step of the solver can figure out that a package is uninstallable it might reset the candidate so that later steps are prevented from exploring this dead end. While that helps the resolver it can confuse the display of the found solution as this will include an incorrect count of packages not upgraded in this solution. It was possible before, but happens a fair bit more with the April/May resolver changes last year so finally doing proper counting is a good idea. Sadly this is a bit harder than just getting the number first and than subtracting the packages we upgraded from it as the user can influence candidates via the command line and a package which could be upgraded, but is removed instead shouldn't count as not upgraded as we clearly did something with it. So we keep a list of packages instead of a number which also help in the upgrade cmds as those want to show the list. Closes: #981535
* | | Merge branch 'pu/autoremove' into 'main'Julian Andres Klode2021-04-2914-94/+288
|\ \ \ | | | | | | | | | | | | | | | | Mark only provides from protected versioned kernel packages See merge request apt-team/apt!168
| * | | Store versioned kernel package detectors in d-pointerDavid Kalnischkies2021-04-261-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | They are kinda costly, so it makes more sense to keep them around in private storage rather than generate them all the time in the MarkPackage method. We do keep them lazy through as we have that implemented already.
| * | | Call MarkAndSweep only manually in apt-get for autoremoveDavid Kalnischkies2021-04-2612-45/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An interactive tool like aptitude needs these flags current far more often than we do as a user can see them in apt only in one very well defined place – the autoremove display block – so we don't need to run it up to four times while a normal "apt install" is processed as that is just busywork. The effect on runtime is minimal, as a single run doesn't take too long anyhow, but it cuts down tremendously on debug output at the expense of requiring some manual handholding. This is opt-in so that aptitude doesn't need to change nor do we need to change our own tools like "apt list" where it is working correctly as intended. A special flag and co is needed as we want to prevent the ActionGroup inside pkgDepCache::Init to be inhibited already so we need to insert ourselves while the DepCache is still in the process of being built. This is also the reason why the debug output in some tests changed to all unmarked, but that is fine as the marking could have been already obsoleted by the actions taken, just inhibited by a proper action group.