From 180984178dc4e063607f6e9e94eb2fdfedbfe452 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Mon, 4 Mar 2024 07:50:55 +0100 Subject: 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 --- src/libcmd/installables.cc | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/libcmd/installables.cc') 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 evalStore, ref store, Realise mode, OperateOn operateOn, @@ -688,13 +688,27 @@ StorePathSet Installable::toStorePaths( return outPaths; } +StorePaths Installable::toStorePaths( + ref evalStore, + ref 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 evalStore, ref store, Realise mode, OperateOn operateOn, ref 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()); -- cgit v1.2.3