diff options
Diffstat (limited to 'src/values.cc')
-rw-r--r-- | src/values.cc | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/values.cc b/src/values.cc index e23624ce5f43..fe65b977eaec 100644 --- a/src/values.cc +++ b/src/values.cc @@ -127,16 +127,13 @@ string fetchURL(string url) #endif -void deleteFromStore(Hash hash) +void deleteFromStore(const string & path) { - string fn; - if (queryDB(nixDB, dbRefs, hash, fn)) { - string prefix = nixStore + "/"; - if (string(fn, prefix.size()) != prefix) - throw Error("path " + fn + " is not in the store"); - deletePath(fn); - delDB(nixDB, dbRefs, hash); - } + string prefix = nixStore + "/"; + if (string(path, 0, prefix.size()) != prefix) + throw Error(format("path %1% is not in the store") % path); + deletePath(path); +// delDB(nixDB, dbRefs, hash); } |