mirror of
https://github.com/NixOS/nix.git
synced 2025-11-20 17:29:36 +01:00
treewide: Add Store::requireStoreObjectAccessor, simplify uses of getFSAccessor
This is a simple wrapper around getFSAccessor that throws an InvalidPath error. This simplifies usage in callsites that only care about getting a non-null accessor.
This commit is contained in:
parent
959c244a12
commit
0c32fb3fa2
10 changed files with 33 additions and 22 deletions
|
|
@ -1130,7 +1130,7 @@ Derivation Store::derivationFromPath(const StorePath & drvPath)
|
|||
|
||||
static Derivation readDerivationCommon(Store & store, const StorePath & drvPath, bool requireValidPath)
|
||||
{
|
||||
auto accessor = store.getFSAccessor(drvPath, requireValidPath);
|
||||
auto accessor = store.requireStoreObjectAccessor(drvPath, requireValidPath);
|
||||
try {
|
||||
return parseDerivation(store, accessor->readFile(CanonPath::root), Derivation::nameFromPath(drvPath));
|
||||
} catch (FormatError & e) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue