diff options
author | Qyriad <qyriad@qyriad.me> | 2024-05-01 19:55:26 -0600 |
---|---|---|
committer | Qyriad <qyriad@qyriad.me> | 2024-05-02 12:59:15 -0600 |
commit | e0911eef73e36d5b42ebd2e9fa114d535ab287f7 (patch) | |
tree | 23d258d39e0b08590d162c142aead5d204718587 /src/libcmd/cmd-profiles.hh | |
parent | ce70f02aff058c6438119e9946122f86431151f1 (diff) |
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
Diffstat (limited to 'src/libcmd/cmd-profiles.hh')
-rw-r--r-- | src/libcmd/cmd-profiles.hh | 6 |
1 files changed, 4 insertions, 2 deletions
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<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); }; |