From 7850d3d27910c30232dd09dd86ee8afdaad26b90 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 1 Jun 2016 14:49:12 +0200 Subject: Make the store directory a member variable of Store --- src/libstore/nar-info.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/libstore/nar-info.cc') diff --git a/src/libstore/nar-info.cc b/src/libstore/nar-info.cc index 4ff4c996d..1aacca84b 100644 --- a/src/libstore/nar-info.cc +++ b/src/libstore/nar-info.cc @@ -3,7 +3,7 @@ namespace nix { -NarInfo::NarInfo(const std::string & s, const std::string & whence) +NarInfo::NarInfo(const Store & store, const std::string & s, const std::string & whence) { auto corrupt = [&]() { throw Error("NAR info file ‘%1%’ is corrupt"); @@ -32,7 +32,7 @@ NarInfo::NarInfo(const std::string & s, const std::string & whence) std::string value(s, colon + 2, eol - colon - 2); if (name == "StorePath") { - if (!isStorePath(value)) corrupt(); + if (!store.isStorePath(value)) corrupt(); path = value; } else if (name == "URL") @@ -53,14 +53,14 @@ NarInfo::NarInfo(const std::string & s, const std::string & whence) auto refs = tokenizeString(value, " "); if (!references.empty()) corrupt(); for (auto & r : refs) { - auto r2 = settings.nixStore + "/" + r; - if (!isStorePath(r2)) corrupt(); + auto r2 = store.storeDir + "/" + r; + if (!store.isStorePath(r2)) corrupt(); references.insert(r2); } } else if (name == "Deriver") { - auto p = settings.nixStore + "/" + value; - if (!isStorePath(p)) corrupt(); + auto p = store.storeDir + "/" + value; + if (!store.isStorePath(p)) corrupt(); deriver = p; } else if (name == "System") -- cgit v1.2.3