diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2003-07-31T13·47+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2003-07-31T13·47+0000 |
commit | 4a013962bdd08ee0cf285136e4eca0f2c9c76b98 (patch) | |
tree | c354204a50cc2c0a5e8873e2e5dab98316f42a5d /src/normalise.cc | |
parent | 758bd4673a3553fcbd78c8f895d6efe839d3d538 (diff) |
* Started using Berkeley DB environments. This is necessary for
transaction support (but we don't actually use transactions yet).
Diffstat (limited to 'src/normalise.cc')
-rw-r--r-- | src/normalise.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/normalise.cc b/src/normalise.cc index 5ef4d82ac139..5a8cb9a0d0ff 100644 --- a/src/normalise.cc +++ b/src/normalise.cc @@ -9,7 +9,7 @@ void registerSuccessor(const FSId & id1, const FSId & id2) { - setDB(nixDB, dbSuccessors, id1, id2); + nixDB.setString(noTxn, dbSuccessors, id1, id2); } @@ -31,7 +31,7 @@ FSId normaliseFState(FSId id, FSIdSet pending) /* Try to substitute $id$ by any known successors in order to speed up the rewrite process. */ string idSucc; - while (queryDB(nixDB, dbSuccessors, id, idSucc)) { + while (nixDB.queryString(noTxn, dbSuccessors, id, idSucc)) { debug(format("successor %1% -> %2%") % (string) id % idSucc); id = parseHash(idSucc); } @@ -191,7 +191,7 @@ void realiseSlice(const FSId & id, FSIdSet pending) { SliceElem elem = *i; string id; - if (!queryDB(nixDB, dbPath2Id, elem.path, id)) { + if (!nixDB.queryString(noTxn, dbPath2Id, elem.path, id)) { if (pathExists(elem.path)) throw Error(format("path `%1%' obstructed") % elem.path); missing = true; @@ -269,7 +269,7 @@ static void fstateRequisitesSet(const FSId & id, string idSucc; if (includeSuccessors && - queryDB(nixDB, dbSuccessors, id, idSucc)) + nixDB.queryString(noTxn, dbSuccessors, id, idSucc)) fstateRequisitesSet(parseHash(idSucc), includeExprs, includeSuccessors, paths); } @@ -293,13 +293,13 @@ FSIds findGenerators(const FSIds & _ids) mappings, since we know that those are Nix expressions. */ Strings sucs; - enumDB(nixDB, dbSuccessors, sucs); + nixDB.enumTable(noTxn, dbSuccessors, sucs); for (Strings::iterator i = sucs.begin(); i != sucs.end(); i++) { string s; - if (!queryDB(nixDB, dbSuccessors, *i, s)) continue; + if (!nixDB.queryString(noTxn, dbSuccessors, *i, s)) continue; FSId id = parseHash(s); FState fs; |