about summary refs log tree commit diff
path: root/src/libstore/nar-info.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-06-01T12·49+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-06-01T14·24+0200
commit7850d3d27910c30232dd09dd86ee8afdaad26b90 (patch)
treeda539f14d98d815e89b6ad60ed8e1e1ab9981cbf /src/libstore/nar-info.cc
parent1b5b654fe25cf7f2219ebe96a943397d683bfa0e (diff)
Make the store directory a member variable of Store
Diffstat (limited to 'src/libstore/nar-info.cc')
-rw-r--r--src/libstore/nar-info.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libstore/nar-info.cc b/src/libstore/nar-info.cc
index 4ff4c996dabd..1aacca84b800 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<Strings>(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")