Merge remote-tracking branch 'origin/master' into flakes
This commit is contained in:
+13
-12
@@ -51,28 +51,29 @@ StorePathsCommand::StorePathsCommand(bool recursive)
|
||||
|
||||
void StorePathsCommand::run(ref<Store> store)
|
||||
{
|
||||
Paths storePaths;
|
||||
StorePaths storePaths;
|
||||
|
||||
if (all) {
|
||||
if (installables.size())
|
||||
throw UsageError("'--all' does not expect arguments");
|
||||
for (auto & p : store->queryAllValidPaths())
|
||||
storePaths.push_back(p);
|
||||
storePaths.push_back(p.clone());
|
||||
}
|
||||
|
||||
else {
|
||||
for (auto & p : toStorePaths(store, realiseMode, installables))
|
||||
storePaths.push_back(p);
|
||||
storePaths.push_back(p.clone());
|
||||
|
||||
if (recursive) {
|
||||
PathSet closure;
|
||||
store->computeFSClosure(PathSet(storePaths.begin(), storePaths.end()),
|
||||
closure, false, false);
|
||||
storePaths = Paths(closure.begin(), closure.end());
|
||||
StorePathSet closure;
|
||||
store->computeFSClosure(storePathsToSet(storePaths), closure, false, false);
|
||||
storePaths.clear();
|
||||
for (auto & p : closure)
|
||||
storePaths.push_back(p.clone());
|
||||
}
|
||||
}
|
||||
|
||||
run(store, storePaths);
|
||||
run(store, std::move(storePaths));
|
||||
}
|
||||
|
||||
void StorePathCommand::run(ref<Store> store)
|
||||
@@ -107,7 +108,7 @@ MixProfile::MixProfile()
|
||||
.dest(&profile);
|
||||
}
|
||||
|
||||
void MixProfile::updateProfile(const Path & storePath)
|
||||
void MixProfile::updateProfile(const StorePath & storePath)
|
||||
{
|
||||
if (!profile) return;
|
||||
auto store = getStore().dynamic_pointer_cast<LocalFSStore>();
|
||||
@@ -116,20 +117,20 @@ void MixProfile::updateProfile(const Path & storePath)
|
||||
switchLink(profile2,
|
||||
createGeneration(
|
||||
ref<LocalFSStore>(store),
|
||||
profile2, storePath));
|
||||
profile2, store->printStorePath(storePath)));
|
||||
}
|
||||
|
||||
void MixProfile::updateProfile(const Buildables & buildables)
|
||||
{
|
||||
if (!profile) return;
|
||||
|
||||
std::optional<Path> result;
|
||||
std::optional<StorePath> result;
|
||||
|
||||
for (auto & buildable : buildables) {
|
||||
for (auto & output : buildable.outputs) {
|
||||
if (result)
|
||||
throw Error("'--profile' requires that the arguments produce a single store path, but there are multiple");
|
||||
result = output.second;
|
||||
result = output.second.clone();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user