mirror of
https://github.com/NixOS/nix
synced 2025-06-28 13:41:15 +02:00
Remove sourcePathToStorePath()
It's no longer needed now that all store paths inside the evaluator are logical rather than real paths.
This commit is contained in:
parent
584ddd1b4d
commit
4206d95996
3 changed files with 3 additions and 28 deletions
|
@ -921,21 +921,6 @@ LockedFlake lockFlake(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::pair<StorePath, Path> sourcePathToStorePath(
|
|
||||||
ref<Store> store,
|
|
||||||
const SourcePath & _path)
|
|
||||||
{
|
|
||||||
auto path = _path.path.abs();
|
|
||||||
|
|
||||||
if (auto store2 = store.dynamic_pointer_cast<LocalFSStore>()) {
|
|
||||||
auto realStoreDir = store2->getRealStoreDir();
|
|
||||||
if (isInDir(path, realStoreDir))
|
|
||||||
path = store2->storeDir + path.substr(realStoreDir.size());
|
|
||||||
}
|
|
||||||
|
|
||||||
return store->toStorePath(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
void callFlake(EvalState & state,
|
void callFlake(EvalState & state,
|
||||||
const LockedFlake & lockedFlake,
|
const LockedFlake & lockedFlake,
|
||||||
Value & vRes)
|
Value & vRes)
|
||||||
|
@ -953,7 +938,7 @@ void callFlake(EvalState & state,
|
||||||
|
|
||||||
auto lockedNode = node.dynamic_pointer_cast<const LockedNode>();
|
auto lockedNode = node.dynamic_pointer_cast<const LockedNode>();
|
||||||
|
|
||||||
auto [storePath, subdir] = sourcePathToStorePath(state.store, sourcePath);
|
auto [storePath, subdir] = state.store->toStorePath(sourcePath.path.abs());
|
||||||
|
|
||||||
emitTreeAttrs(
|
emitTreeAttrs(
|
||||||
state,
|
state,
|
||||||
|
|
|
@ -234,16 +234,6 @@ void callFlake(
|
||||||
const LockedFlake & lockedFlake,
|
const LockedFlake & lockedFlake,
|
||||||
Value & v);
|
Value & v);
|
||||||
|
|
||||||
/**
|
|
||||||
* Map a `SourcePath` to the corresponding store path. This is a
|
|
||||||
* temporary hack to support chroot stores while we don't have full
|
|
||||||
* lazy trees. FIXME: Remove this once we can pass a sourcePath rather
|
|
||||||
* than a storePath to call-flake.nix.
|
|
||||||
*/
|
|
||||||
std::pair<StorePath, Path> sourcePathToStorePath(
|
|
||||||
ref<Store> store,
|
|
||||||
const SourcePath & path);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void emitTreeAttrs(
|
void emitTreeAttrs(
|
||||||
|
|
|
@ -216,7 +216,7 @@ struct CmdFlakeMetadata : FlakeCommand, MixJSON
|
||||||
auto & flake = lockedFlake.flake;
|
auto & flake = lockedFlake.flake;
|
||||||
|
|
||||||
// Currently, all flakes are in the Nix store via the rootFS accessor.
|
// Currently, all flakes are in the Nix store via the rootFS accessor.
|
||||||
auto storePath = store->printStorePath(sourcePathToStorePath(store, flake.path).first);
|
auto storePath = store->printStorePath(store->toStorePath(flake.path.path.abs()).first);
|
||||||
|
|
||||||
if (json) {
|
if (json) {
|
||||||
nlohmann::json j;
|
nlohmann::json j;
|
||||||
|
@ -1079,7 +1079,7 @@ struct CmdFlakeArchive : FlakeCommand, MixJSON, MixDryRun
|
||||||
|
|
||||||
StorePathSet sources;
|
StorePathSet sources;
|
||||||
|
|
||||||
auto storePath = sourcePathToStorePath(store, flake.flake.path).first;
|
auto storePath = store->toStorePath(flake.flake.path.path.abs()).first;
|
||||||
|
|
||||||
sources.insert(storePath);
|
sources.insert(storePath);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue