Merge remote-tracking branch 'origin/master' into closure-size

This commit is contained in:
Luca Bruno
2015-11-25 21:37:30 +01:00
659 changed files with 46562 additions and 13611 deletions
+8
View File
@@ -225,4 +225,12 @@ rec {
# Check whether a value is a store path.
isStorePath = x: builtins.substring 0 1 (toString x) == "/" && dirOf (builtins.toPath x) == builtins.storeDir;
# Convert string to int
# Obviously, it is a bit hacky to use fromJSON that way.
toInt = str:
let may_be_int = builtins.fromJSON str; in
if builtins.isInt may_be_int
then may_be_int
else throw "Could not convert ${str} to int.";
}