1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-10 20:46:01 +01:00

Use words like added / removed

This commit is contained in:
Graham Christensen 2025-06-02 09:28:59 -04:00
parent 039d19159f
commit 724d552b64
4 changed files with 12 additions and 12 deletions

View file

@ -11,8 +11,8 @@ R""(
baloo-widgets: 20.08.1 → 20.08.2 baloo-widgets: 20.08.1 → 20.08.2
bluez-qt: +12.6 KiB bluez-qt: +12.6 KiB
dolphin: 20.08.1 → 20.08.2, +13.9 KiB dolphin: 20.08.1 → 20.08.2, +13.9 KiB
kdeconnect: 20.08.2 → ∅, -6597.8 KiB kdeconnect: 20.08.2 removed, -6597.8 KiB
kdeconnect-kde: ∅ → 20.08.2, +6599.7 KiB kdeconnect-kde: 20.08.2 added, +6599.7 KiB
``` ```
@ -34,8 +34,8 @@ dolphin: 20.08.1 → 20.08.2, +13.9 KiB
No size change is shown if it's below the threshold. If the package No size change is shown if it's below the threshold. If the package
does not exist in either the *before* or *after* closures, it is does not exist in either the *before* or *after* closures, it is
represented using `∅` (empty set) on the appropriate side of the represented using `added` or `removed`.
arrow. If a package has an empty version string, the version is If a package has an empty version string, the version is
rendered as `(no version)`. rendered as `(no version)`.
There may be multiple versions of a package in each closure. In that There may be multiple versions of a package in each closure. In that

View file

@ -7,7 +7,7 @@ R""(
```console ```console
# nix profile history # nix profile history
Version 508 (2020-04-10): Version 508 (2020-04-10):
flake:nixpkgs#legacyPackages.x86_64-linux.awscli: ∅ -> 1.17.13 flake:nixpkgs#legacyPackages.x86_64-linux.awscli: 1.17.13 added
Version 509 (2020-05-16) <- 508: Version 509 (2020-05-16) <- 508:
flake:nixpkgs#legacyPackages.x86_64-linux.awscli: 1.17.13 -> 1.18.211 flake:nixpkgs#legacyPackages.x86_64-linux.awscli: 1.17.13 -> 1.18.211
@ -20,7 +20,7 @@ between subsequent versions of a profile. It only shows top-level
packages, not dependencies; for that, use [`nix profile packages, not dependencies; for that, use [`nix profile
diff-closures`](./nix3-profile-diff-closures.md). diff-closures`](./nix3-profile-diff-closures.md).
The addition of a package to a profile is denoted by the string `∅ ->` The addition of a package to a profile is denoted by the string
*version*, whereas the removal is denoted by *version* `-> ∅`. *version* `added`, whereas the removal is denoted by *version* ` removed`.
)"" )""

View file

@ -289,12 +289,12 @@ struct ProfileManifest
while (i != prev.elements.end() || j != cur.elements.end()) { while (i != prev.elements.end() || j != cur.elements.end()) {
if (j != cur.elements.end() && (i == prev.elements.end() || i->first > j->first)) { if (j != cur.elements.end() && (i == prev.elements.end() || i->first > j->first)) {
logger->cout("%s%s: ∅ -> %s", indent, j->second.identifier(), j->second.versions()); logger->cout("%s%s: %s added", indent, j->second.identifier(), j->second.versions());
changes = true; changes = true;
++j; ++j;
} }
else if (i != prev.elements.end() && (j == cur.elements.end() || i->first < j->first)) { else if (i != prev.elements.end() && (j == cur.elements.end() || i->first < j->first)) {
logger->cout("%s%s: %s -> ∅", indent, i->second.identifier(), i->second.versions()); logger->cout("%s%s: %s removed", indent, i->second.identifier(), i->second.versions());
changes = true; changes = true;
++i; ++i;
} }

View file

@ -58,8 +58,8 @@ nix profile list | grep -A4 'Name:.*flake1' | grep 'Locked flake URL:.*narHash'
[ -e $TEST_HOME/.nix-profile/share/man ] [ -e $TEST_HOME/.nix-profile/share/man ]
(! [ -e $TEST_HOME/.nix-profile/include ]) (! [ -e $TEST_HOME/.nix-profile/include ])
nix profile history nix profile history
nix profile history | grep "packages.$system.default: ∅ -> 1.0" nix profile history | grep "packages.$system.default: 1.0 added"
nix profile diff-closures | grep 'env-manifest.nix: (no version) → ∅' nix profile diff-closures | grep 'env-manifest.nix: (no version) removed'
# Test XDG Base Directories support # Test XDG Base Directories support
export NIX_CONFIG="use-xdg-base-directories = true" export NIX_CONFIG="use-xdg-base-directories = true"
@ -128,7 +128,7 @@ nix profile rollback
[ -e $TEST_HOME/.nix-profile/bin/foo ] [ -e $TEST_HOME/.nix-profile/bin/foo ]
nix profile remove foo 2>&1 | grep 'removed 1 packages' nix profile remove foo 2>&1 | grep 'removed 1 packages'
(! [ -e $TEST_HOME/.nix-profile/bin/foo ]) (! [ -e $TEST_HOME/.nix-profile/bin/foo ])
nix profile history | grep 'foo: 1.0 -> ∅' nix profile history | grep 'foo: 1.0 removed'
nix profile diff-closures | grep 'Version 3 -> 4' nix profile diff-closures | grep 'Version 3 -> 4'
# Test installing a non-flake package. # Test installing a non-flake package.