From 6011bd0da24c100f86239ed826fa7b496bbdddf8 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 9 Jul 2003 16:12:40 +0000 Subject: * Outline of the new scheme for derivate distribution. --- src/store.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/store.cc') diff --git a/src/store.cc b/src/store.cc index 095d204307..38e059a294 100644 --- a/src/store.cc +++ b/src/store.cc @@ -158,6 +158,9 @@ static string queryPathByHashPrefix(Hash hash, const string & prefix) } +string expandHash(const Hash & hash, const string & outPath = "") +{ + string queryPathByHash(Hash hash) { return queryPathByHashPrefix(hash, "/"); @@ -187,8 +190,8 @@ void addToStore(string srcPath, string & dstPath, Hash & hash) void deleteFromStore(const string & path) { - string prefix = nixStore + "/"; - if (string(path, 0, prefix.size()) != prefix) + string prefix = + "/"; + if (!isInPrefix(path, nixStore)) throw Error(format("path %1% is not in the store") % path); unregisterPath(path); -- cgit 1.4.1