summaryrefslogtreecommitdiff
path: root/apt-private
AgeCommit message (Collapse)Author
2021-01-08Implement update --error-on=anyJulian Andres Klode
People have been asking for a feature to error out on transient network errors for a while, this gives them one while keeping the door open for other modes we need, such as --error-on=no-success which we need to determine when to retry the daily update job. Closes: #594813 (and a whole bunch of duplicates...)
2021-01-08Add support for Phased-Update-PercentageJulian Andres Klode
This adds support for Phased-Update-Percentage by pinning upgrades that are not to be installed down to 1. The output of policy has been changed to add the level of phasing, and documentation has been improved to document how phased updates work. The patch detects if it is running in a chroot, and if so, always includes phased updates, restoring classic apt behavior to avoid behavioral changes on buildd chroots. Various options are added to control this all: * APT::Get::{Always,Never}-Include-Phased-Updates and their legacy update-manager equivalents to always or never include phased updates * APT::Machine-ID can be set to a UUID string to have all machines in a fleet phase the same * Dir::Etc::Machine-ID is weird in that it's default is sort of like ../machine-id, but not really, as ../machine-id would look up $PWD/../machine-id and not relative to Dir::Etc; but it allows you to override the path to machine-id (as opposed to the value) * Dir::Bin::ischroot is the path to the ischroot(1) binary which is used to detect whether we are running in a chroot.
2021-01-08Only autoremove kernels in apt(8); respect --no-auto-removeJulian Andres Klode
Automatically removing kernels in apt-get could be unexpected, so limit it to apt for now. To handle --no-auto-remove correctly, rewrite the hack that makes apt ignore APT::Get::AutomaticRemove options from config files such that it unsets the option. This then means we can do FindB("APT::Get::AutomaticRemove", true) as the default for APT::Get::AutomaticRemove::Kernels and get the behavior we want: If you set --no-auto-remove, it is respected as that FindB returns false; if you don't set it, it will be true.
2021-01-04Automatically remove unused kernels on dist-upgradeJulian Andres Klode
Kernels clutter /boot and /boot is small size, so we need to take extra care to remove kernels when possible.
2020-11-07Support compressed output from rred similar to apt-helper cat-fileDavid Kalnischkies
2020-11-07Prepare rred binary for external usageDavid Kalnischkies
Merging patches is a bit of non-trivial code we have for client-side work, but as we support also server-side merging we can export this functionality so that server software can reuse it. Note that this just cleans up and makes rred behave a bit more like all our other binaries by supporting setting configuration at runtime and supporting --help and --version. If you can make due without this, the now advertised functionality is provided already in earlier versions.
2020-08-04Merge branch 'master' into 'master'Julian Andres Klode
Support marking all newly installed packages as automatically installed See merge request apt-team/apt!110
2020-08-04Replace whitelist/blacklist with allowlist/denylistJulian Andres Klode
2020-06-08Support marking all newly installed packages as automatically installedNicolas Schier
Add option '--mark-auto' to 'apt install' that marks all newly installed packages as automatically installed. Signed-off-by: Nicolas Schier <nicolas@fjasle.eu>
2020-05-18private-search: Only use V.TranslatedDescription() if goodJulian Andres Klode
When we could not find a translated description, we were pushing V.TranslatedDescription() to the vector, but that one might not have been good either. Add the check so we don't crash later when trying to access it. LP: #1877987
2020-05-04apt list: Fix behavior of regex vs fnmatch vs wildcardsJulian Andres Klode
Previously (and still in cacheset), patterns where only allowed to start with ? or ~, which ignores the fact that a pattern might just as well start with a negation, such a !~nfoo. Also, we ignored the --regex flag if it looked like this, which was somewhat bad. Let's change this all: * If --regex is given, arguments are always interpreted as regex * If it is a valid package wildcard (name or * characters), then it will be interpreted as a wildcard - this set of characters is free from meaningful overlap with patterns. * Otherwise, the argument is interpreted as a pattern. For a future version, we need to adapt parsing for cacheset and list to use a common parser, to avoid differences in their interpretation. Likely, this code will go into the pattern parser, such that it generates a pattern given a valid fnmatch argument for example.
2020-02-26apt(8): Wait for frontend and cache lockJulian Andres Klode
This is a rework of !6 with additional stuff for the frontend lock, so we can lock the frontend lock and then keep looping over dpkg lock.
2020-02-24Make map_pointer<T> typesafeJulian Andres Klode
Instead of just using uint32_t, which would allow you to assign e.g. a map_pointer<Version> to a map_pointer<Package>, use our own smarter struct that has strict type checking. We allow creating a map_pointer from a nullptr, and we allow comparing map_pointer to nullptr, which also deals with comparisons against 0 which are often used, as 0 will be implictly converted to nullptr.
2020-02-24Replace map_pointer_t with map_pointer<T>Julian Andres Klode
This is a first step to a type safe cache, adding typing information everywhere. Next, we'll replace map_pointer<T> implementation with a type safe one.
2020-02-18Remove code tagged APT_PKG_590, add some missing includesJulian Andres Klode
Remove all code scheduled to be removed after 5.90, and fix files to include files they previously got from hashes.h including more headers.
2020-02-03Implement short patterns (patterns starting with ~)Julian Andres Klode
Also make pattern detector in cacheset and private's list accept such patterns. We probably should just try to parse and see if it is a (start of a) pattern.
2020-01-15apt(8): Disable regular expressions and fnmatchJulian Andres Klode
This is the first step. Next step will be to add warnings to apt-get and then remove support there as well.
2020-01-14Convert users of {MD5,SHA1,SHA256,SHA512}Summation to use HashesJulian Andres Klode
This makes use of the a function GetHashString() that returns the specific hash string. We also need to implement another overload of Add() for signed chars with sizes, so the existing users do not require reinterpret_cast everywhere.
2019-12-06satisfy: Fix segmentation fault when called with empty argumentJulian Andres Klode
apt satisfy "" caused a segmentation fault because we were iterating over the characters, checking if the next character was the end of the string; when it could also be the current character. Instead, check whether the next character is before the end of the string, rather than identical to the end.
2019-11-25Search in all available description translationsАлексей Шилин
When multiple translations of package descriptions are available, perform search in all of them. It allows using search patterns in any of the configured languages. Previously, only the first available translation was searched. As the result, patterns in e.g. English never matched packages which had their descriptions translated into local language. Closes: #490000
2019-09-27Parse 'show' arguments for the 'info' alias as wellJulian Andres Klode
We recently made info an alias for show, but we did not change the command-line parser to work around it. LP: #1843812
2019-08-15Add pattern tree parser infra and connect with cacheset and apt listJulian Andres Klode
This adds a transformation from parse tree into a CacheFilter and connects it with cachesets and the apt list command.
2019-07-08Apply various suggestions by cppcheckDavid Kalnischkies
Reported-By: cppcheck
2019-06-14Remove deprecated cacheset methodsJulian Andres Klode
This mostly turns them private and then overrides the public version with the switch, as recommended.
2019-06-12Adjust code for missing includes/using std::stringJulian Andres Klode
2019-06-11Merge branch 'depend-solutions' into 'master'Julian Andres Klode
apt-cache: only show solutions if displayed See merge request apt-team/apt!65
2019-06-11Introduce apt satisfy and apt-get satisfyJulian Andres Klode
Allow to satisfy dependency strings supplied on the command line, optionally prefixed with "Conflicts:" to satisfy them like Conflicts. Build profiles and architecture restriction lists, as used in build dependencies, are supported as well. Compared to build-dep, build-essential is not installed automatically, and installing of recommended packages follows the global default, which defaults to yes. Closes: #275379 See merge request apt-team/apt!63
2019-05-13apt-cache: only show solutions if displayedStephen Kitt
Currently, apt-cache [r]depends always shows all solutions for a package, if appropriate, even if the package itself wasn’t displayed (e.g. “--installed” was specified). Thus, currently, with haskell-platform uninstalled and amd64 and i386 enabled, “apt-cache rdepends alex” shows alex Reverse Depends: haskell-platform alex:i386 haskell-platform alex:i386 and “apt-cache rdepends alex --installed” shows alex Reverse Depends: alex:i386 alex:i386 which is rather confusing. This patch changes the behaviour so that solutions are only displayed for packages which were themselves displayed; “apt-cache rdepends alex --installed” then shows alex Reverse Depends: Signed-off-by: Stephen Kitt <skitt@debian.org>
2019-05-10apt-mark: Add hidden showheld alias for showholdJulian Andres Klode
For Unit193 and those who value grammar, I suppose.
2019-04-30Add 'explicit' to most single argument constructorsJulian Andres Klode
This prevents implicit conversions that we do not want, such as having a FileFd* being converted to a debListParser. Two cases are not yet handled because they require changes in code using them: 1. The classes in hashes.h 2. The URI class - this one is used quite a lot
2019-04-30acq: worker: Move CurrentSize, TotalSize, ResumePoint to CurrentItemJulian Andres Klode
These status fields belong to the current item, move them there. This prepares us for eventually having multiple current items.
2019-03-08Merge tag '1.8.0'Julian Andres Klode
apt Debian release 1.8.0
2019-03-06Fix name of APT::Update::Post-Invoke-Stats (was ...Update-Post...)Julian Andres Klode
Bad accident. Accidents happen.
2019-02-26apt-private: Remove unused InitLocale() variantJulian Andres Klode
2019-02-26sptr: Remove deprecated smart pointer classesJulian Andres Klode
Please use the standard C++ variants instead.
2019-02-26acquire: Fold pkgAcquireStatus2 into pkgAcquireStatusJulian Andres Klode
Clean up the code, make it neat, lalala
2019-02-26clean: Fold pkgArchiveCleaner2 into pkgArchiveCleanerJulian Andres Klode
2019-02-26pkgSrcRecords::Parser: Fold Files2() into Files()Julian Andres Klode
This is possible now with the API break. Cleaner code, woohoo.
2019-02-13Introduce APT::Install::Pre-Invoke / Post-Invoke-SuccessJulian Andres Klode
These will run in our frontends currently, and can show messages. For the sake of keeping the implementation complexity low, a non-success variant of Post-Invoke is not provided. LP: #1815761
2019-02-13update: Provide APT::Update-Post-Invoke-Stats script hook pointJulian Andres Klode
This is run after an update has been run and only if status on the new cache has been shown, allowing scripts to display their own status messages. LP: #1815760
2019-01-29private-json-hooks.cc: deal with EPIPEMichael Vogt
While running our CI we noticed that sometimes we see an error from the new json hooks code. The error message is: ``` E: Could not read response to hello message from hook [ ! -f /usr/bin/snap ] || /usr/bin/snap advise-snap --from-apt 2>/dev/null || true: Broken pipe ``` when purging the snapd package which provides the hook. This indicates that we should probably also consider EPIPE not an error (just like we do for ECONNRESET). This PR does exactly this.
2019-01-27Add a "reinstall" command as an alias for "install --reinstall".Josh Triplett
aptitude has a similar "reinstall" command for precedent.
2019-01-10apt-mark: Introduce minimize-manualJulian Andres Klode
This visits dependencies of all manually installed metapackages, as determined by APT::Never-MarkAuto-Sections, and marks them as automatically installed. It can be used to clean up autoflags after a d-i install, for example.
2019-01-07apt-private: Export some functions for apt-markJulian Andres Klode
We need to show a yes/no prompt in minimize-manual, and pretty package names, so export them here. Gbp-Dch: ignore
2018-12-03Provide a "autopurge" shortcutJulian Andres Klode
This adds a new "autopurge" command that will is a shortcut for "autoremove --purge" Thanks: Michael Vogt for the initial work
2018-11-25Fix typo reported by codespell in code commentsDavid Kalnischkies
No user visible change expect for some years old changelog entries, so we don't really need to add a new one for this… Reported-By: codespell Gbp-Dch: Ignore
2018-11-21Print useful error on "apt changelog" without argumentsJulian Andres Klode
Fixes Debian/apt#77
2018-09-20Deal with descriptions embedded in displayed record correctlyDavid Kalnischkies
The implementation of "apt-cache show" (not "apt show") incorrectly resets the currently used parser if the record itself and the description to show come from the same file (as it is the case if no Translation-* files are available e.g. after debootstrap). The code is more complex than you would hope to support some rather unusual setups involving Descriptions and their translations as tested for by ./test-bug-712435-missing-descriptions as otherwise this could be a one-line change. Regression-Of: bf53f39c9a0221b670ffff74053ed36fc502d5a0 Closes: #909155
2018-09-15Show all architectures in 'apt list' outputDavid Kalnischkies
The uniqueness in std::set containers is ensured by the ordering operator we provide, but it was not considering that different versions can have the same description like the different architectures for a version of a package. Closes: #908218
2018-08-07Merge branch 'bugfix/big-lock' into 'master'Julian Andres Klode
Add support for dpkg frontend lock See merge request apt-team/apt!11