diff options
-rw-r--r-- | src/globals.cc | 6 | ||||
-rw-r--r-- | src/globals.hh | 19 | ||||
-rw-r--r-- | src/store.cc | 8 |
3 files changed, 10 insertions, 23 deletions
diff --git a/src/globals.cc b/src/globals.cc index a81c90caa..40a5a981b 100644 --- a/src/globals.cc +++ b/src/globals.cc @@ -2,9 +2,8 @@ #include "db.hh" -string dbRefs = "refs"; +string dbHash2Paths = "hash2paths"; string dbSuccessors = "successors"; -string dbNetSources = "netsources"; string nixStore = "/UNINIT"; string nixLogDir = "/UNINIT"; @@ -13,7 +12,6 @@ string nixDB = "/UNINIT"; void initDB() { - createDB(nixDB, dbRefs); + createDB(nixDB, dbHash2Paths); createDB(nixDB, dbSuccessors); - createDB(nixDB, dbNetSources); } diff --git a/src/globals.hh b/src/globals.hh index 8c6a763c4..2fb9fe747 100644 --- a/src/globals.hh +++ b/src/globals.hh @@ -8,11 +8,11 @@ using namespace std; /* Database names. */ -/* dbRefs :: Hash -> Path +/* dbHash2Paths :: Hash -> [Path] - Maintains a mapping from hashes to paths. This is what we use to - resolve CHash(hash) content descriptors. */ -extern string dbRefs; + Maintains a mapping from hashes to lists of paths. This is what we + use to resolve Hash(hash) content descriptors. */ +extern string dbHash2Paths; /* dbSuccessors :: Hash -> Hash @@ -30,17 +30,6 @@ extern string dbRefs; */ extern string dbSuccessors; -/* dbNetSources :: Hash -> URL - - Each pair (hash, url) in this mapping states that the value - identified by hash can be obtained by fetching the value pointed - to by url. - - TODO: this should be Hash -> [URL] - - TODO: factor this out into a separate tool? */ -extern string dbNetSources; - /* Path names. */ diff --git a/src/store.cc b/src/store.cc index 977cd2594..2ea7586e9 100644 --- a/src/store.cc +++ b/src/store.cc @@ -90,7 +90,7 @@ Hash registerPath(const string & _path, Hash hash) if (hash == Hash()) hash = hashPath(path); Strings paths; - queryListDB(nixDB, dbRefs, hash, paths); /* non-existence = ok */ + queryListDB(nixDB, dbHash2Paths, hash, paths); /* non-existence = ok */ for (Strings::iterator it = paths.begin(); it != paths.end(); it++) @@ -98,7 +98,7 @@ Hash registerPath(const string & _path, Hash hash) paths.push_back(path); - setListDB(nixDB, dbRefs, hash, paths); + setListDB(nixDB, dbHash2Paths, hash, paths); exists: return hash; @@ -116,7 +116,7 @@ static string queryPathByHashPrefix(Hash hash, const string & prefix) { Strings paths; - if (!queryListDB(nixDB, dbRefs, hash, paths)) + if (!queryListDB(nixDB, dbHash2Paths, hash, paths)) throw Error(format("no paths known with hash `%1%'") % (string) hash); /* Arbitrarily pick the first one that exists and still hash the @@ -172,5 +172,5 @@ void deleteFromStore(const string & path) if (string(path, 0, prefix.size()) != prefix) throw Error(format("path %1% is not in the store") % path); deletePath(path); -// delDB(nixDB, dbRefs, hash); +// delDB(nixDB, dbHash2Paths, hash); } |