diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2019-12-18 14:25:25 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2019-12-18 14:25:25 +0100 |
commit | 87873d0d656890f693aa29f062dd8fc496a9d6ae (patch) | |
tree | 16e332e447e01114cd296dc94d9aa9937c9d7602 /src/libstore/store-api.cc | |
parent | 31c240ee8b5f7949439eede0d7953d04261147fe (diff) | |
parent | f8abbdd4565542464f31f4dc203a9c3e091b3536 (diff) |
Merge remote-tracking branch 'origin/master' into flakes
Diffstat (limited to 'src/libstore/store-api.cc')
-rw-r--r-- | src/libstore/store-api.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index 0411db517..c29ca5a12 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -39,9 +39,9 @@ Path Store::toStorePath(const Path & path) const } -Path Store::followLinksToStore(const Path & _path) const +Path Store::followLinksToStore(std::string_view _path) const { - Path path = absPath(_path); + Path path = absPath(std::string(_path)); while (!isInStore(path)) { if (!isLink(path)) break; string target = readLink(path); @@ -53,12 +53,19 @@ Path Store::followLinksToStore(const Path & _path) const } -StorePath Store::followLinksToStorePath(const Path & path) const +StorePath Store::followLinksToStorePath(std::string_view path) const { return parseStorePath(toStorePath(followLinksToStore(path))); } +StorePathWithOutputs Store::followLinksToStorePathWithOutputs(std::string_view path) const +{ + auto [path2, outputs] = nix::parsePathWithOutputs(path); + return StorePathWithOutputs(followLinksToStorePath(path2), std::move(outputs)); +} + + string storePathToHash(const Path & path) { auto base = baseNameOf(path); @@ -963,7 +970,7 @@ std::list<ref<Store>> getDefaultSubstituters() addStore(uri); stores.sort([](ref<Store> & a, ref<Store> & b) { - return a->getPriority() < b->getPriority(); + return a->priority < b->priority; }); return stores; |