diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2003-07-09 16:12:40 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2003-07-09 16:12:40 +0000 |
commit | 6011bd0da24c100f86239ed826fa7b496bbdddf8 (patch) | |
tree | a97710dbe6f7cacc871443df24fab0b00fbda5e3 /src/store.cc | |
parent | 2b95a9dc05d0a943859ba92bb301c294473758f1 (diff) |
* Outline of the new scheme for derivate distribution.
Diffstat (limited to 'src/store.cc')
-rw-r--r-- | src/store.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/store.cc b/src/store.cc index 095d20430..38e059a29 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); |