aboutsummaryrefslogtreecommitdiff
path: root/src/libmain
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2011-08-31 21:11:50 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2011-08-31 21:11:50 +0000
commit93227ff65c73e726c4ceef0cdd9439e7a4301417 (patch)
treeba7b60ca132c373913dd4a1c42a900009aeb8a77 /src/libmain
parent5bcdc7e3517e6d679cad1aaba41e4deb76d5a6e7 (diff)
* Eliminate all uses of the global variable ‘store’ from libstore.
This should also fix: nix-instantiate: ./../boost/shared_ptr.hpp:254: T* boost::shared_ptr<T>::operator->() const [with T = nix::StoreAPI]: Assertion `px != 0' failed. which was caused by hashDerivationModulo() calling the ‘store’ object (during store upgrades) before openStore() assigned it.
Diffstat (limited to 'src/libmain')
-rw-r--r--src/libmain/shared.cc4
-rw-r--r--src/libmain/shared.hh4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc
index 43ec4bcdd..f0035c358 100644
--- a/src/libmain/shared.cc
+++ b/src/libmain/shared.cc
@@ -52,11 +52,11 @@ void printGCWarning()
}
-void printMissing(const PathSet & paths)
+void printMissing(StoreAPI & store, const PathSet & paths)
{
unsigned long long downloadSize, narSize;
PathSet willBuild, willSubstitute, unknown;
- queryMissing(paths, willBuild, willSubstitute, unknown, downloadSize, narSize);
+ queryMissing(store, paths, willBuild, willSubstitute, unknown, downloadSize, narSize);
if (!willBuild.empty()) {
printMsg(lvlInfo, format("these derivations will be built:"));
diff --git a/src/libmain/shared.hh b/src/libmain/shared.hh
index c99810c78..bd3d19531 100644
--- a/src/libmain/shared.hh
+++ b/src/libmain/shared.hh
@@ -24,11 +24,13 @@ namespace nix {
MakeError(UsageError, nix::Error);
+class StoreAPI;
+
/* Ugh. No better place to put this. */
Path makeRootName(const Path & gcRoot, int & counter);
void printGCWarning();
-void printMissing(const PathSet & paths);
+void printMissing(StoreAPI & store, const PathSet & paths);
template<class N> N getIntArg(const string & opt,
Strings::iterator & i, const Strings::iterator & end)