nix3-profile: make element names stable

Based off of commit 6268a45b650f563bae2360e0540920a2959bdd40

Upstream-PR: https://github.com/NixOS/nix/pull/9656
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
Change-Id: I0fcf069a8537c61ad6fc4eee1f3c193a708ea1c4
This commit is contained in:
Qyriad
2024-05-02 12:59:15 -06:00
co-authored by Eelco Dolstra
parent ce70f02aff
commit e0911eef73
6 changed files with 102 additions and 81 deletions
+4 -2
View File
@@ -35,7 +35,6 @@ constexpr int DEFAULT_PRIORITY = 5;
struct ProfileElement
{
StorePathSet storePaths;
std::string name;
std::optional<ProfileElementSource> source;
bool active = true;
int priority = DEFAULT_PRIORITY;
@@ -57,7 +56,7 @@ struct ProfileElement
struct ProfileManifest
{
std::vector<ProfileElement> elements;
std::map<std::string, ProfileElement> elements;
ProfileManifest() { }
@@ -67,6 +66,9 @@ struct ProfileManifest
StorePath build(ref<Store> store);
void addElement(std::string_view nameCandidate, ProfileElement element);
void addElement(ProfileElement element);
static void printDiff(const ProfileManifest & prev, const ProfileManifest & cur, std::string_view indent);
};