mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-23 06:26:15 +02:00
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
This commit is contained in:
parent
8976769a1c
commit
3d144e778e
1 changed files with 8 additions and 8 deletions
|
@ -42,7 +42,7 @@ struct ProfileElement
|
||||||
bool active = true;
|
bool active = true;
|
||||||
int priority = defaultPriority;
|
int priority = defaultPriority;
|
||||||
|
|
||||||
std::string describe() const
|
std::string identifier() const
|
||||||
{
|
{
|
||||||
if (source)
|
if (source)
|
||||||
return fmt("%s#%s%s", source->originalRef, source->attrPath, source->outputs.to_string());
|
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
|
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(
|
void updateStorePaths(
|
||||||
|
@ -237,13 +237,13 @@ struct ProfileManifest
|
||||||
bool changes = false;
|
bool changes = false;
|
||||||
|
|
||||||
while (i != prevElems.end() || j != curElems.end()) {
|
while (i != prevElems.end() || j != curElems.end()) {
|
||||||
if (j != curElems.end() && (i == prevElems.end() || i->describe() > j->describe())) {
|
if (j != curElems.end() && (i == prevElems.end() || i->identifier() > j->identifier())) {
|
||||||
logger->cout("%s%s: ∅ -> %s", indent, j->describe(), j->versions());
|
logger->cout("%s%s: ∅ -> %s", indent, j->identifier(), j->versions());
|
||||||
changes = true;
|
changes = true;
|
||||||
++j;
|
++j;
|
||||||
}
|
}
|
||||||
else if (i != prevElems.end() && (j == curElems.end() || i->describe() < j->describe())) {
|
else if (i != prevElems.end() && (j == curElems.end() || i->identifier() < j->identifier())) {
|
||||||
logger->cout("%s%s: %s -> ∅", indent, i->describe(), i->versions());
|
logger->cout("%s%s: %s -> ∅", indent, i->identifier(), i->versions());
|
||||||
changes = true;
|
changes = true;
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
@ -251,7 +251,7 @@ struct ProfileManifest
|
||||||
auto v1 = i->versions();
|
auto v1 = i->versions();
|
||||||
auto v2 = j->versions();
|
auto v2 = j->versions();
|
||||||
if (v1 != v2) {
|
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;
|
changes = true;
|
||||||
}
|
}
|
||||||
++i;
|
++i;
|
||||||
|
@ -491,7 +491,7 @@ struct CmdProfileRemove : virtual EvalCommand, MixDefaultProfile, MixProfileElem
|
||||||
if (!matches(*store, element, i, matchers)) {
|
if (!matches(*store, element, i, matchers)) {
|
||||||
newManifest.elements.push_back(std::move(element));
|
newManifest.elements.push_back(std::move(element));
|
||||||
} else {
|
} else {
|
||||||
notice("removing '%s'", element.describe());
|
notice("removing '%s'", element.identifier());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue