diff options
author | Théophane Hufschmitt <theophane.hufschmitt@tweag.io> | 2023-05-16 11:31:28 +0200 |
---|---|---|
committer | Théophane Hufschmitt <theophane.hufschmitt@tweag.io> | 2023-05-16 11:41:58 +0200 |
commit | 3d144e778e4193c948fa6e0a23f9f3de194bc62f (patch) | |
tree | f37fc62f2930041eee7ab40c6d926bfc0b60029e | |
parent | 8976769a1c4a7fa6276d38402d97cec89b27d98f (diff) |
Rename `ProfileElement.describe()` to `.identifier`
This method isn't used to describe what the element is, but to return a
unique identifier for it whithin the current profile
-rw-r--r-- | src/nix/profile.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/nix/profile.cc b/src/nix/profile.cc index fd63b3519..ce3b6fbbc 100644 --- a/src/nix/profile.cc +++ b/src/nix/profile.cc @@ -42,7 +42,7 @@ struct ProfileElement bool active = true; int priority = defaultPriority; - std::string describe() const + std::string identifier() const { if (source) return fmt("%s#%s%s", source->originalRef, source->attrPath, source->outputs.to_string()); @@ -62,7 +62,7 @@ struct ProfileElement bool operator < (const ProfileElement & other) const { - return std::tuple(describe(), storePaths) < std::tuple(other.describe(), other.storePaths); + return std::tuple(identifier(), storePaths) < std::tuple(other.identifier(), other.storePaths); } void updateStorePaths( @@ -237,13 +237,13 @@ struct ProfileManifest bool changes = false; while (i != prevElems.end() || j != curElems.end()) { - if (j != curElems.end() && (i == prevElems.end() || i->describe() > j->describe())) { - logger->cout("%s%s: ∅ -> %s", indent, j->describe(), j->versions()); + if (j != curElems.end() && (i == prevElems.end() || i->identifier() > j->identifier())) { + logger->cout("%s%s: ∅ -> %s", indent, j->identifier(), j->versions()); changes = true; ++j; } - else if (i != prevElems.end() && (j == curElems.end() || i->describe() < j->describe())) { - logger->cout("%s%s: %s -> ∅", indent, i->describe(), i->versions()); + else if (i != prevElems.end() && (j == curElems.end() || i->identifier() < j->identifier())) { + logger->cout("%s%s: %s -> ∅", indent, i->identifier(), i->versions()); changes = true; ++i; } @@ -251,7 +251,7 @@ struct ProfileManifest auto v1 = i->versions(); auto v2 = j->versions(); if (v1 != v2) { - logger->cout("%s%s: %s -> %s", indent, i->describe(), v1, v2); + logger->cout("%s%s: %s -> %s", indent, i->identifier(), v1, v2); changes = true; } ++i; @@ -491,7 +491,7 @@ struct CmdProfileRemove : virtual EvalCommand, MixDefaultProfile, MixProfileElem if (!matches(*store, element, i, matchers)) { newManifest.elements.push_back(std::move(element)); } else { - notice("removing '%s'", element.describe()); + notice("removing '%s'", element.identifier()); } } |