summaryrefslogtreecommitdiff
path: root/apt-private
Commit message (Collapse)AuthorAgeFilesLines
* Match version constraints before saving garbage packagesDavid Kalnischkies2024-04-241-6/+14
| | | | | | | | | We remove new garbage packages from the solution if we can as installing a new package which is at the same time considered garbage looks silly, but it could also be a new dependency of another garbage package, so we have a second round trying to save such packages. In this round we weren't considering versioned constraints on dependency relations through so even an unsatisfied old recommends could save which it shouldn't.
* Avoid figuring which kept pkgs are phased if we don't display itDavid Kalnischkies2024-04-241-10/+10
| | | | | | | Not all commands show kept back packages, so even if it hardly matters, lets not crunch numbers needlessly if we don't need the info which also reduces the lifetime of the involved variables hopefully also reducing the mental requirements for a reader.
* Highlight essential removals with action::remove colorJulian Andres Klode2024-04-231-1/+1
|
* Merge branch 'ui-2.9.2' into 'main'Julian Andres Klode2024-04-226-17/+36
|\ | | | | | | | | UI changes for 2.9.2 See merge request apt-team/apt!343
| * Show "Upgrading:" before other sectionsJulian Andres Klode2024-04-191-2/+2
| | | | | | | | | | | | This avoids awkward interactions with Installing dependencies and Suggested packages appearing before it; despite being triggered by it.
| * Insert blank line following simulation noteJulian Andres Klode2024-04-191-0/+2
| |
| * Remove spurious newline inside `apt autoremove` messageJulian Andres Klode2024-04-192-11/+17
| | | | | | | | | | | | Add a new `note` field to `ShowList` which contains a line to be displayed after the list itself. This allows `ShowList` to render a self-contained list block.
| * show: Highlight field names and colorize package nameJulian Andres Klode2024-04-192-3/+9
| | | | | | | | We should pass this properly to the TagSection.write()
| * apt update: Show upgradable package count in boldJulian Andres Klode2024-04-192-1/+6
| |
* | Add an --audit option to switch on audit loggingJulian Andres Klode2024-04-192-2/+7
| | | | | | | | | | This option is recommended to be used by repository operators for testing.
* | Change the default log level from debug to noticeJulian Andres Klode2024-04-192-2/+2
|/ | | | | | | | | | We never used the debug level before, so we can do that. This allows us to have the new audit level. We did call DumpErrors() with DEBUG in two debug code paths, so don't touch those. debug
* private-output: Remove check for output version for colorJulian Andres Klode2024-04-191-2/+2
| | | | This is somewhat pointless.
* Add a --color, --no-color optionJulian Andres Klode2024-04-192-5/+4
| | | | Wrap empty else in {} to avoid readability issues
* Configure individual action colors using APT::Color::ActionJulian Andres Klode2024-04-192-7/+13
|
* Use APT::Configuration::color to apply color to outputJulian Andres Klode2024-04-194-15/+18
|
* Also respect an APT_NO_COLOR variableJulian Andres Klode2024-04-152-3/+3
| | | | | This is easier to discover than APT::Color options and matches best practices.
* 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