diff options
author | eldritch horrors <pennae@lix.systems> | 2024-03-04 07:50:55 +0100 |
---|---|---|
committer | eldritch horrors <pennae@lix.systems> | 2024-03-04 07:50:55 +0100 |
commit | 180984178dc4e063607f6e9e94eb2fdfedbfe452 (patch) | |
tree | 073cde58b67bbc9b6e2c1ecade8ee14f508f24be /src/libcmd/installables.cc | |
parent | aaf1ed1a4cf0ca53f5324932fe13769cb2b69f74 (diff) |
Merge pull request #9648 from cole-h/nix-shell-ordering
nix shell: reflect command line order in PATH order
(cherry picked from commit b91c935c2faf08ced2c763dcd2a831f26d84fa86)
Change-Id: If16c120bb74857c2817366e74e5b0877eb997260
Diffstat (limited to 'src/libcmd/installables.cc')
-rw-r--r-- | src/libcmd/installables.cc | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc index a9d25671c..f40136411 100644 --- a/src/libcmd/installables.cc +++ b/src/libcmd/installables.cc @@ -674,7 +674,7 @@ BuiltPaths Installable::toBuiltPaths( } } -StorePathSet Installable::toStorePaths( +StorePathSet Installable::toStorePathSet( ref<Store> evalStore, ref<Store> store, Realise mode, OperateOn operateOn, @@ -688,13 +688,27 @@ StorePathSet Installable::toStorePaths( return outPaths; } +StorePaths Installable::toStorePaths( + ref<Store> evalStore, + ref<Store> store, + Realise mode, OperateOn operateOn, + const Installables & installables) +{ + StorePaths outPaths; + for (auto & path : toBuiltPaths(evalStore, store, mode, operateOn, installables)) { + auto thisOutPaths = path.outPaths(); + outPaths.insert(outPaths.end(), thisOutPaths.begin(), thisOutPaths.end()); + } + return outPaths; +} + StorePath Installable::toStorePath( ref<Store> evalStore, ref<Store> store, Realise mode, OperateOn operateOn, ref<Installable> installable) { - auto paths = toStorePaths(evalStore, store, mode, operateOn, {installable}); + auto paths = toStorePathSet(evalStore, store, mode, operateOn, {installable}); if (paths.size() != 1) throw Error("argument '%s' should evaluate to one store path", installable->what()); |