Skip to content

Commit 8a82624

Browse files
authored
Merge pull request #81 from DeterminateSystems/push-twpuyuspwtpz
Replace ε and ∅
2 parents 57ee710 + 1500e54 commit 8a82624

6 files changed

Lines changed: 21 additions & 24 deletions

File tree

doc/manual/source/glossary.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -343,14 +343,6 @@
343343

344344
See [Nix Archive](store/file-system-object/content-address.html#serial-nix-archive) for details.
345345

346-
- [``]{#gloss-empty-set}
347-
348-
The empty set symbol. In the context of profile history, this denotes a package is not present in a particular version of the profile.
349-
350-
- [`ε`]{#gloss-epsilon}
351-
352-
The epsilon symbol. In the context of a package, this means the version is empty. More precisely, the derivation does not have a version attribute.
353-
354346
- [package]{#package}
355347

356348
A software package; files that belong together for a particular purpose, and metadata.

src/nix/diff-closures.cc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ GroupedPaths getClosureInfo(ref<Store> store, const StorePath & toplevel)
4949

5050
std::string showVersions(const StringSet & versions)
5151
{
52-
if (versions.empty()) return "";
52+
if (versions.empty()) return "(absent)";
5353
StringSet versions2;
5454
for (auto & version : versions)
55-
versions2.insert(version.empty() ? "ε" : version);
55+
versions2.insert(version.empty() ? "(no version)" : version);
5656
return concatStringsSep(", ", versions2);
5757
}
5858

@@ -97,8 +97,13 @@ void printClosureDiff(
9797

9898
if (showDelta || !removed.empty() || !added.empty()) {
9999
std::vector<std::string> items;
100-
if (!removed.empty() || !added.empty())
100+
if (!removed.empty() && !added.empty()) {
101101
items.push_back(fmt("%s → %s", showVersions(removed), showVersions(added)));
102+
} else if (!removed.empty()) {
103+
items.push_back(fmt("%s removed", showVersions(removed)));
104+
} else if (!added.empty()) {
105+
items.push_back(fmt("%s added", showVersions(added)));
106+
}
102107
if (showDelta)
103108
items.push_back(fmt("%s%+.1f KiB" ANSI_NORMAL, sizeDelta > 0 ? ANSI_RED : ANSI_GREEN, sizeDelta / 1024.0));
104109
logger->cout("%s%s: %s", indent, name, concatStringsSep(", ", items));

src/nix/diff-closures.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ R""(
1111
baloo-widgets: 20.08.1 → 20.08.2
1212
bluez-qt: +12.6 KiB
1313
dolphin: 20.08.1 → 20.08.2, +13.9 KiB
14-
kdeconnect: 20.08.2 → ∅, -6597.8 KiB
15-
kdeconnect-kde: ∅ → 20.08.2, +6599.7 KiB
14+
kdeconnect: 20.08.2 removed, -6597.8 KiB
15+
kdeconnect-kde: 20.08.2 added, +6599.7 KiB
1616
1717
```
1818

@@ -34,9 +34,9 @@ dolphin: 20.08.1 → 20.08.2, +13.9 KiB
3434

3535
No size change is shown if it's below the threshold. If the package
3636
does not exist in either the *before* or *after* closures, it is
37-
represented using `` (empty set) on the appropriate side of the
38-
arrow. If a package has an empty version string, the version is
39-
rendered as `ε` (epsilon).
37+
represented using `added` or `removed`.
38+
If a package has an empty version string, the version is
39+
rendered as `(no version)`.
4040

4141
There may be multiple versions of a package in each closure. In that
4242
case, only the changed versions are shown. Thus,

src/nix/profile-history.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ R""(
77
```console
88
# nix profile history
99
Version 508 (2020-04-10):
10-
flake:nixpkgs#legacyPackages.x86_64-linux.awscli: ∅ -> 1.17.13
10+
flake:nixpkgs#legacyPackages.x86_64-linux.awscli: 1.17.13 added
1111

1212
Version 509 (2020-05-16) <- 508:
1313
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
2020
packages, not dependencies; for that, use [`nix profile
2121
diff-closures`](./nix3-profile-diff-closures.md).
2222

23-
The addition of a package to a profile is denoted by the string `∅ ->`
24-
*version*, whereas the removal is denoted by *version* `-> ∅`.
23+
The addition of a package to a profile is denoted by the string
24+
*version* `added`, whereas the removal is denoted by *version* ` removed`.
2525

2626
)""

src/nix/profile.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,12 +289,12 @@ struct ProfileManifest
289289

290290
while (i != prev.elements.end() || j != cur.elements.end()) {
291291
if (j != cur.elements.end() && (i == prev.elements.end() || i->first > j->first)) {
292-
logger->cout("%s%s: ∅ -> %s", indent, j->second.identifier(), j->second.versions());
292+
logger->cout("%s%s: %s added", indent, j->second.identifier(), j->second.versions());
293293
changes = true;
294294
++j;
295295
}
296296
else if (i != prev.elements.end() && (j == cur.elements.end() || i->first < j->first)) {
297-
logger->cout("%s%s: %s -> ∅", indent, i->second.identifier(), i->second.versions());
297+
logger->cout("%s%s: %s removed", indent, i->second.identifier(), i->second.versions());
298298
changes = true;
299299
++i;
300300
}

tests/functional/nix-profile.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ nix profile list | grep -A4 'Name:.*flake1' | grep 'Locked flake URL:.*narHash'
5858
[ -e $TEST_HOME/.nix-profile/share/man ]
5959
(! [ -e $TEST_HOME/.nix-profile/include ])
6060
nix profile history
61-
nix profile history | grep "packages.$system.default: ∅ -> 1.0"
62-
nix profile diff-closures | grep 'env-manifest.nix: ε → ∅'
61+
nix profile history | grep "packages.$system.default: 1.0, 1.0-man added"
62+
nix profile diff-closures | grep 'env-manifest.nix: (no version) removed'
6363

6464
# Test XDG Base Directories support
6565
export NIX_CONFIG="use-xdg-base-directories = true"
@@ -128,7 +128,7 @@ nix profile rollback
128128
[ -e $TEST_HOME/.nix-profile/bin/foo ]
129129
nix profile remove foo 2>&1 | grep 'removed 1 packages'
130130
(! [ -e $TEST_HOME/.nix-profile/bin/foo ])
131-
nix profile history | grep 'foo: 1.0 -> ∅'
131+
nix profile history | grep 'foo: 1.0 removed'
132132
nix profile diff-closures | grep 'Version 3 -> 4'
133133

134134
# Test installing a non-flake package.

0 commit comments

Comments
 (0)