mirror of
https://github.com/NixOS/nix.git
synced 2025-11-10 20:46:01 +01:00
diff-closures: use removed / added words
This commit is contained in:
parent
724d552b64
commit
1500e541f2
2 changed files with 7 additions and 2 deletions
|
|
@ -97,8 +97,13 @@ void printClosureDiff(
|
||||||
|
|
||||||
if (showDelta || !removed.empty() || !added.empty()) {
|
if (showDelta || !removed.empty() || !added.empty()) {
|
||||||
std::vector<std::string> items;
|
std::vector<std::string> items;
|
||||||
if (!removed.empty() || !added.empty())
|
if (!removed.empty() && !added.empty()) {
|
||||||
items.push_back(fmt("%s → %s", showVersions(removed), showVersions(added)));
|
items.push_back(fmt("%s → %s", showVersions(removed), showVersions(added)));
|
||||||
|
} else if (!removed.empty()) {
|
||||||
|
items.push_back(fmt("%s removed", showVersions(removed)));
|
||||||
|
} else if (!added.empty()) {
|
||||||
|
items.push_back(fmt("%s added", showVersions(added)));
|
||||||
|
}
|
||||||
if (showDelta)
|
if (showDelta)
|
||||||
items.push_back(fmt("%s%+.1f KiB" ANSI_NORMAL, sizeDelta > 0 ? ANSI_RED : ANSI_GREEN, sizeDelta / 1024.0));
|
items.push_back(fmt("%s%+.1f KiB" ANSI_NORMAL, sizeDelta > 0 ? ANSI_RED : ANSI_GREEN, sizeDelta / 1024.0));
|
||||||
logger->cout("%s%s: %s", indent, name, concatStringsSep(", ", items));
|
logger->cout("%s%s: %s", indent, name, concatStringsSep(", ", items));
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ 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 added"
|
nix profile history | grep "packages.$system.default: 1.0, 1.0-man added"
|
||||||
nix profile diff-closures | grep 'env-manifest.nix: (no version) removed'
|
nix profile diff-closures | grep 'env-manifest.nix: (no version) removed'
|
||||||
|
|
||||||
# Test XDG Base Directories support
|
# Test XDG Base Directories support
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue