From e0911eef73e36d5b42ebd2e9fa114d535ab287f7 Mon Sep 17 00:00:00 2001 From: Qyriad Date: Wed, 1 May 2024 19:55:26 -0600 Subject: 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 Change-Id: I0fcf069a8537c61ad6fc4eee1f3c193a708ea1c4 --- src/libcmd/cmd-profiles.hh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/libcmd/cmd-profiles.hh') diff --git a/src/libcmd/cmd-profiles.hh b/src/libcmd/cmd-profiles.hh index 7f2c8a76f..2185daa34 100644 --- a/src/libcmd/cmd-profiles.hh +++ b/src/libcmd/cmd-profiles.hh @@ -35,7 +35,6 @@ constexpr int DEFAULT_PRIORITY = 5; struct ProfileElement { StorePathSet storePaths; - std::string name; std::optional source; bool active = true; int priority = DEFAULT_PRIORITY; @@ -57,7 +56,7 @@ struct ProfileElement struct ProfileManifest { - std::vector elements; + std::map elements; ProfileManifest() { } @@ -67,6 +66,9 @@ struct ProfileManifest StorePath build(ref 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); }; -- cgit v1.2.3