1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-27 12:41:00 +01:00

Merged R9105

This commit is contained in:
Wouter den Breejen 2007-10-08 11:58:34 +00:00
parent 00602dd20c
commit dacf2e0e87
28 changed files with 503 additions and 502 deletions

View file

@ -8,7 +8,8 @@ namespace nix {
bool StoreAPI::hasSubstitutes(const Path & path)
{
return !querySubstitutes(path).empty();
PathSet paths = querySubstitutablePaths();
return paths.find(path) != paths.end();
}
@ -207,6 +208,45 @@ Path computeStorePathForText(const string & suffix, const string & s,
return makeStorePath(type, hash, suffix);
}
//TODO !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ValidPathInfo decodeValidPathInfo(std::istream & str)
{
ValidPathInfo info;
getline(str, info.path);
if (str.eof()) { info.path = ""; return info; }
getline(str, info.deriver);
string s; int n;
getline(str, s);
if (!string2Int(s, n))
throw Error("number expected");
while (n--) {
getline(str, s);
info.references.insert(s);
}
getline(str, s);
if (!string2Int(s, n))
throw Error("number expected");
while (n--) {
getline(str, s);
info.stateReferences.insert(s);
}
unsigned int u;
getline(str, s);
if (!string2UnsignedInt(s, u))
throw Error("number expected");
info.revision = u;
if (!str || str.eof()) throw Error("missing input");
return info;
}
//TODO !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
}