1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-26 04:00:59 +01:00

Before modifying commit shell script

This commit is contained in:
Wouter den Breejen 2007-05-30 11:27:01 +00:00
parent cbd0d39583
commit 653e557e81
10 changed files with 140 additions and 91 deletions

View file

@ -451,11 +451,21 @@ static Expr prim_derivationStrict(EvalState & state, const ATermVector & args)
if(s[0] == '/')
s = s.substr(1, s.length());
if(s == stateRootRepos)
throw EvalError(format("The statedir `%1%' is a keyword and cannot be used, choose another name") % stateRootRepos);
dir.path = s;
}
else if (statekey == "type") { dir.type = s; }
else if (statekey == "interval") { dir.interval = s; }
else throw EvalError(format("invalid subattirbute `%1%' for attribute dirs") % statekey);
else if (statekey == "interval") {
if(s == "")
continue;
int n;
if (!string2Int(s, n)) throw Error("interval is not a number");
if(n == 0) throw Error("Interval cannot be 0");
dir.interval = s;
}
else throw EvalError(format("invalid sub-attirbute `%1%' for attribute dirs") % statekey);
}
catch (Error & e) {
e.addPrefix(format("while evaluating the state derivation attribute `%1%' at %2%:\n") % key % showPos(statepos));