summaryrefslogtreecommitdiff
path: root/apt-private
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'ui-2.9.1' into 'main'Julian Andres Klode2024-04-142-10/+77
|\ | | | | | | | | UI improvements for 2.9.1 See merge request apt-team/apt!338
| * apt: Default to N in the y/N prompt if there were warningsJulian Andres Klode2024-04-131-2/+3
| | | | | | | | | | This especially helps with the running out of space warnings to be safe.
| * Use "Continue anyway?" if a warning is queuedJulian Andres Klode2024-04-131-1/+2
| |
| * install: Show downgrades as yellowJulian Andres Klode2024-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | dnf shows downgrades as green because the package comes from a remote repository, but I think yellow is more indicative that they are unsupported. Ganneff asked for yellow for kept packages too, however I'm not adding yellow there, as kept packages are more indicative of an archive error, likely temporary, rather than an action item for the user.
| * Add warnings if space estimate exceeds free spaceJulian Andres Klode2024-04-131-0/+16
| |
| * Remove approx. from space estimates; and do some alignmentJulian Andres Klode2024-04-131-3/+4
| | | | | | | | | | | | This aligns the /boot message with the parent one, and also align the formatting of the partially downloaded size message to add spaces around /
| * Show space estimate for /boot, if separate; or estimate initrd for /usrJulian Andres Klode2024-04-131-1/+22
| | | | | | | | | | | | | | | | | | Calculate an estimate of 110% of the biggest initrd + system.map as the additional space a kernel needs in /boot. If /boot is a different file system than /usr, print the size of the kernels + the additional space they will need separately; otherwise include it in our /usr figure.
| * Hide nice subtree character and indentation of summary from translationsJulian Andres Klode2024-04-132-8/+14
| | | | | | | | | | | | | | | | Also allow us to have utf-8 characters in xgettext, but msgcomm still fails so ugh. This avoids translations messing up the formatting a bit more, at least, and makes apt build again
| * Space needed: Show space available in /usrJulian Andres Klode2024-04-131-2/+23
| |
| * Rename "Installed size:" to "Space needed:"Julian Andres Klode2024-04-131-1/+1
| |
* | Remove duplicate sentence in private-output.ccRafael2024-04-141-1/+1
|/
* Use the same words for the summaryJulian Andres Klode2024-04-121-4/+4
| | | | | | Instead of using Upgrades, Installs, and so on, just use Upgrading, Installing, etc. This solves the problem of not having a nice noun for "Not upgrading".
* Only show Recommends/Suggests for new installs, not upgradesJulian Andres Klode2024-04-121-1/+1
| | | | | | This makes things more useful in combination with the upgrade command, but introduces a subtle change seen in the test suite when you use the install command to upgrade packages.
* Show Recommends/Suggests for upgrades too, move them downJulian Andres Klode2024-04-121-91/+98
| | | | | | Extract the code to show them into its own function and call it in the old place for output version < 30, or after the dependencies being installed for new output format.
* apt: Introduce the new terse apt output format 3.0Julian Andres Klode2024-04-124-35/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The key talking points here are: 1. Instead of long sentences, we use short concise messages, e.g. "The following NEW packages will be installed" becomes "Installing". 2. Dependencies are only listed once. We removed the "The following additional packages will be installed" section in favor of splitting up the "Installing" section into "Installing" and "Installing dependencies" (like dnf) 3. The order of the output is different: 1. Packages to be installed manually 2. Packages to be installed automatically 4. Weak dependencies of new packages not installed 3. Packages to be upgraded 4. Packages to be downgraded 5. Packages that have been kept back / are on hold 6. Removals 7. Essential removals i.e. we logically show you the action that is being done, followed by lists related to the action. 4. As requested by popey, we have colorful UI, with green for packages being installed and red for packages being removed. Caveats: - The list of recommends and suggests has not been updated yet, it should move to after the packages being installed (as they are what triggers them) This also introduces output format versioning, configured by the APT::Output-Format option. The default value is 0, except for the apt(8) binary where it is 30 - which enables the new style.
* OpProgress: Erase lines when doneJulian Andres Klode2024-04-121-0/+4
| | | | | | | | | | | It's interesting to the user to see the progress when it happens, but arguably once it's done it is just visual clutter, so let's not write newlines, and when we are done, instead of appending "Done", let's just empty the line. This requires some effort to keep apt-cdrom happy which just writes lines to stdout itself. Bad apt-cdrom. Maybe there is a better fix for it, but this gets us going.
* columnar: Fix floating point exception (list is empty if -V)Julian Andres Klode2024-04-121-1/+1
|
* Columnar output for package lists similar to 'ls'Christian Blichmann2024-04-123-11/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change makes it a bit easier to quickly grasp the changes about to be performed by apt. It displays package lists in a columnar format by default, similar to what `ls` produces for files. A new long option `--no-list-columns` and an associated `APT::Get::List-Columns` config setting control the behavior. Usage example, with 60 column wide terminal: ``` $ sudo apt upgrade | Reading package lists... Done | Building dependency tree... Done | Reading state information... Done | Calculating upgrade... Done | The following packages were automatically installed and are | no longer required: | libappindicator1 libindicator7 | libdbusmenu-gtk4 linux-image-5.14.0-4-amd64 | Use 'sudo apt autoremove' to remove them. | The following packages have been kept back: | criu linux-headers-amd64 nvidia-settings | libxnvctrl0 nvidia-modprobe xwayland | 0 upgraded, 0 newly installed, 0 to remove and 6 not upgrade| d. | ``` The effect becomes more pronounced with more packages (e.g. when doing a dist-upgrade).
* Modernize standard library includesJulian Andres Klode2024-02-2016-30/+30
| | | | | | This was automated with sed and git-clang-format, and then I had to fix up the top of policy.cc by hand as git-clang-format accidentally indented it by two spaces.
* Show a separate list of upgrades deferred due to phasingJulian Andres Klode2024-02-133-1/+27
| | | | | | | | | | | | | | | | | | This introduces a new line: The following upgrades have been deferred due to phasing This is any kept back package that is also phasing. This may not be 100% accurate as we have kept it back due to other reasons in an install command, for example, but we don't track for which packages we applied phasing in reality. If additional packages are kept back that are not phasing, show a a notice "N: Some packages may have been kept back due to phasing." LP: #1988819
* Support -a for setting host architecture in apt-get source -bDavid Kalnischkies2024-01-191-0/+1
| | | | | | | | | | It is documented and the code supports it, but the command line parsing actually refuses -a/--host-architecture=arch … probably a sign how much "apt-get source -b" is (not) used in practice. Setting via -o APT::Get::Host-Architecture=arch (which -a is just a shorthand for) works as it did before and can be used if backward compatibility is important.
* Do not store .diff_Index files in updateDavid Kalnischkies2024-01-031-1/+1
| | | | | | | | | | | | | Nowadays we only download the index file if we have a non-current file on disk which we want to patch. If that is the case, any index file for patches we could have stored is by definition outdated, so storing those files just takes up disk space. At least, that is the case if we have a Release file – if we don't this commit introduces a needless redownload for such repositories but such repositories are an error by default and if they can't be bothered to provide a Release file its very unlikely they actually ship diffs, so adding detection code for this seems pointless at best.
* Improve and test distclean implementationDavid Kalnischkies2024-01-033-24/+22
| | | | | | | | | | | | | The implementation as-is as various smaller/esoteric bugs and inconsistencies like apt-get not supporting them, the option -s being supported in code but not accepted on the command line, the regex not escaping the dot before the file extension and exposing more implementation details to public headers than we actually need. Also comes with a small test case to ensure it actually works. References: bd7c126e3fb1b94e76e0e632c657cea854586844
* Merge branch 'fix-959093' into 'main'Julian Andres Klode2023-12-082-5/+20
|\ | | | | | | | | Add 'dist-clean' command to remove packages and list files See merge request apt-team/apt!290
| * Add 'dist-clean' command to remove packages and list filesGábor Németh2023-11-222-5/+20
| | | | | | | | | | | | | | We assume all files in the 'listsdir' are candidates. Keep only files ending with Release, Release.gpg, and InRelease. Closes: #959093
* | Restore ?garbage by calling MarkAndSweep before parsingJulian Andres Klode2023-11-201-0/+3
| | | | | | | | | | | | This ensures that things work correctly. LP: #1995790
* | Downgrade unmerged-usr from error to two warningsJulian Andres Klode2023-09-201-17/+32
| | | | | | | | | | | | | | | | | | | | | | | | One warning will be issued before the Y/n prompt, the other will be issued at the end after package installs have been attempted or if there were other failures, such that the last line you see is warnings about unmerged-usr I do not anticipate this to be the final version either, but there we go. Closes: #1052058
* | Only accept installs of usrmerge on unmerged-usr systemsJulian Andres Klode2023-09-161-0/+20
| | | | | | | | | | | | | | | | | | | | As of bookworm, merged-usr is mandatory, and people got caught in the crosshairs of the dpkg fsys-unmessusr debacle and inadvertently reverted back to an unmerged configuration and continue to remain on an unsupported system unknowingly. Help them by erroring out when they are installing packages on /, they are not in a chroot, and a usrmerge package is available.
* | update: Add notice about missing Signed-By in deb822 sourcesJulian Andres Klode2023-06-271-0/+14
| | | | | | | | | | | | | | We want to gently steer users towards having Signed-By for each source such that we can retire a shared keyring across sources which improves resilience against configuration issues and incompetent malicious actors.
* | Initial support for snapshot servers, apt --snapshot optionJulian Andres Klode2023-05-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide snapshot support for offical Debian and Ubuntu archives. There are two ways to enable snapshots for sources: 1. Add Snapshot: yes to your sources file ([snapshot=yes]). This will allow you to specify a snapshot to use when updating or installing using the --snapshot,-S option. 2. Add Snapshot: ID to your sources files to request a specific snapshot for this source. Snapshots are discovered using Label and Origin fields in the Release file of the main source, hence you need to have updated the source at least once before you can use snapshots. The Release file may also declare a snapshots server to use, similar to Changelogs, it can contain a Snapshots field with the values: 1. `Snapshots: https://example.com/@SNAPSHOTID@` where `@SNAPSHOTID@` is a placeholder that is replaced with the requested snapshot id 2. `Snapshots: no` to disable snapshot support for this source. Requesting snapshots for this source will result in a failure to load the source. The implementation adds a SHADOWED option to deb source entries, and marks the main entry as SHADOWED when a snapshot has been requested, which will cause it to be updated, but not included in the generated cache. The concern here was that we need to keep generating the shadowed entries because the cleanup in `apt update` deletes any files not queued for download, so we gotta keep downloading the main source. This design is not entirely optimal, but avoids the pitfalls of having to reimplement list cleanup. Gaps: - Ubuntu Pro repositories and PPAs are not yet supported.
* | Add apt install,upgrade,... -U,--update optionsJulian Andres Klode2023-05-025-1/+17
|/ | | | | This runs update before opening the cache and sources.list for installing/upgrading.
* Suggest using non-free-firmware in update for DebianDavid Kalnischkies2023-02-041-28/+138
| | | | | | | | | | | | | | | | | | | In an ideal world everyone would read release notes, but if the last sources.list change is any indication a lot of people wont. This is even more a problem in so far as apt isn't producing errors for invalid repositories, but instead carries on as normal even through it will not be able to install upgrades for the moved packages. This commit implements two scenarios and prints a notice in those cases pointing to the release notes: a) User has 'non-free' but not 'non-free-firmware' b) User has a firmware package which isn't available from anywhere Both only happen if we are talking about a repository which identifies itself as one of Debian and is for a release codenamed bookworm (or sid). Note that as (usually) apt/oldstable is used to upgrade to the new stable release these suggestions only show for users after they have upgraded to bookworm on apt command line usage after that.
* Respect users pkg order on `apt install` for resolvingDavid Kalnischkies2022-09-023-10/+15
| | | | | | | | | | | | | | | | | | | | | | | The command line is evaluated in two steps: First all packages given are marked for install and as a second step the resolver is started on all of them in turn to get their dependencies installed. This is done so a user can provide a non-default choice on the command line and have it respected regardless of where on the command line it appears. On the other hand, the order in which dependencies are resolved can matter, so instead of using a "random" order, we now do this in the order given on the command line, so if you e.g. have a meta package pulling in non-default choices and mention it first the choices are respected predictably instead of depending on first appearance of the package name while creating the binary cache. I might have "broken" this more than a decade ago while introducing the reworked command line parsing for Multi-Arch, which also brought in the split into the two steps mentioned above which was the far more impactful 'respect user choice' change. This one should hardly matter in practice, but as the tests show, order can have surprising side effects.
* Avoid triggering unused variable ‘State’ in doAutoInstallDavid Kalnischkies2022-09-021-5/+3
| | | | | Reported-By: gcc Gbp-Dch: Ignore
* Keep color disabled if APT::Color was set to falseDavid Kalnischkies2022-08-081-2/+2
| | | | | | | | Support for envvar NO_COLOR was added in 2.3.11, but with our own options we can also be a tiny bit more sensible in not overriding an explicit choice to disable colors. References: 400a6895566b67d70bcde43dc8a1cc1c7121f87d
* Let the auto installer loose for non-broken packages tooJulian Andres Klode2022-07-111-2/+0
| | | | | | Because the auto installer now also marks other binaries in the package for upgrade, we do need to run it or we don't mark those for upgrade.
* Include our config.h in all C++ files to avoid ODR violationsDavid Kalnischkies2022-05-071-0/+1
| | | | | | | Some of our headers use APT_COMPILING_APT trickery to avoid exposing too broadly details we don't want external clients to know and make use of. The flip-side is that this can lead to different compilation units seeing different definitions if they aren't all using the same config.
* Remove unused public zlib include from libapt fileutl.hDavid Kalnischkies2022-05-072-0/+2
| | | | | | | | Our public interface doesn't use zlib for quite a while now so lets drop the last remnants as hopefully nobody depends on us bringing it in… Unlike our own private lib for transitive provision of unistd.h. References: 680b916ce7203a40ebd0a3882b9a71ca77278a67
* Merge branch 'pu/invalid-dotty-options' into 'main'Julian Andres Klode2022-05-061-1/+1
|\ | | | | | | | | Do not accept arguments for apt-cache dotty, xvcg See merge request apt-team/apt!237
| * Do not accept arguments for apt-cache dotty, xvcgJulian Andres Klode2022-05-061-1/+1
| | | | | | | | | | | | | | These commands do not actually interpret the same arguments as depends, or any own ones for that matter. Gbp-Dch: full
* | Merge branch 'fix/tagfilekeys' into 'main'Julian Andres Klode2022-05-061-8/+9
|\ \ | |/ |/| | | | | Consistently dealing with fields via pkgTagSection::Key See merge request apt-team/apt!233
| * Parse Checksum fields via pkgTagSection::Key, tooDavid Kalnischkies2022-04-011-4/+2
| | | | | | | | | | | | | | We abstract hashes a fair bit to be able to add new ones eventually, which lead us to building the field names on the fly. We can do better through by keeping a central place for these names, too, which even helps in reducing code as we don't need the MD5 → Files dance anymore.
| * Use pkgTagSection::Key in more places in src:aptDavid Kalnischkies2022-04-011-4/+7
| | | | | | | | | | | | | | | | | | | | The speed critical paths were converted earlier, but the remaining could benefit a tiny bit from this as well especially as we have the facility now available and can therefore brush up the code in various places in the process as well. Also takes the time to add the hidden Exists method advertised in the headers, but previously not implemented.
* | Fix segfault in CacheSetHelperAPTGet::tryVirtualPackage()Julian Andres Klode2022-04-071-1/+2
|/ | | | | | | | We forgot to check whether Archive() and Codename() exist in the first place, sigh. Maybe we should return empty strings instead of nullptr. Reported-By: Johannes 'josch' Schauer Marin Rodrigues on IRC
* Allow --solver apt to work on apt satisfyDavid Kalnischkies2022-02-101-1/+1
| | | | | | | | | Our EDSP code is confused by the spaces in the package name, so we adopt a naming scheme similar to build-dep here instead of trying to teach EDSP to somehow encode the spaces as that is probably even more confusing for onlookers than this invalid package name is. Reported-By: Johannes Schauer Marin Rodrigues on IRC
* Add a --full mode to apt showJulian Andres Klode2022-01-212-8/+11
| | | | | This adds back the missing fields that we do not show any other way.
* Spelling fixesVille Skyttä2021-11-273-5/+5
|
* Support more than exact release matches in 'source'David Kalnischkies2021-11-231-6/+3
| | | | | | | | | | | | | | | | | The Debian 11 release notes elevate matching with regex to a documented and much used feature, which it previously wasn't. For binary packages this is not a problem, but source packages are special and it turns out that matching by release is here an exact string match only. A bit of refactoring later we can reuse the code we use for Packages files also for Release files, which is what we have for Sources files as those files itself have no representation in the cache. This means that we do not support matching based on components (c=main) in source, but we didn't before and we can cross that bridge if anyone notices… Closes: #998444
* Require argument to remove essential packages, do not promptJulian Andres Klode2021-11-173-32/+1
| | | | Let's make this one step harder.
* Merge branch 'feature/install-versioned-provides' into 'main'Julian Andres Klode2021-10-192-43/+121
|\ | | | | | | | | Allow =version and /release selectors on virtual packages See merge request apt-team/apt!121