diff options
author | Shea Levy <shea@shealevy.com> | 2018-09-06 08:09:53 -0400 |
---|---|---|
committer | Shea Levy <shea@shealevy.com> | 2018-09-06 08:09:53 -0400 |
commit | 18337f3ece325ac0b0b26d05e2ccbe5f6398c937 (patch) | |
tree | 401b66e49052817f7042406b51a71e1597dbbf3e /lib | |
parent | 0af9072e74c9e70af62e828ba4fb21391df2e601 (diff) | |
parent | 6da6accd303be776bb4e958da52046da86f9cb5c (diff) | |
download | nixpkgs-18337f3ece325ac0b0b26d05e2ccbe5f6398c937.tar nixpkgs-18337f3ece325ac0b0b26d05e2ccbe5f6398c937.tar.gz nixpkgs-18337f3ece325ac0b0b26d05e2ccbe5f6398c937.tar.bz2 nixpkgs-18337f3ece325ac0b0b26d05e2ccbe5f6398c937.tar.lz nixpkgs-18337f3ece325ac0b0b26d05e2ccbe5f6398c937.tar.xz nixpkgs-18337f3ece325ac0b0b26d05e2ccbe5f6398c937.tar.zst nixpkgs-18337f3ece325ac0b0b26d05e2ccbe5f6398c937.zip |
Merge branch 'no-toPath'
Diffstat (limited to 'lib')
-rw-r--r-- | lib/strings.nix | 5 | ||||
-rw-r--r-- | lib/tests/misc.nix | 4 |
2 files changed, 4 insertions, 5 deletions
diff --git a/lib/strings.nix b/lib/strings.nix index af932ce6ecf..833f69d2fbf 100644 --- a/lib/strings.nix +++ b/lib/strings.nix @@ -501,7 +501,7 @@ rec { isStorePath = x: isCoercibleToString x && builtins.substring 0 1 (toString x) == "/" - && dirOf (builtins.toPath x) == builtins.storeDir; + && dirOf x == builtins.storeDir; /* Convert string to int Obviously, it is a bit hacky to use fromJSON that way. @@ -537,11 +537,10 @@ rec { */ readPathsFromFile = rootPath: file: let - root = toString rootPath; lines = lib.splitString "\n" (builtins.readFile file); removeComments = lib.filter (line: line != "" && !(lib.hasPrefix "#" line)); relativePaths = removeComments lines; - absolutePaths = builtins.map (path: builtins.toPath (root + "/" + path)) relativePaths; + absolutePaths = builtins.map (path: rootPath + "/${path}") relativePaths; in absolutePaths; diff --git a/lib/tests/misc.nix b/lib/tests/misc.nix index cf99aca58c0..d3bd7746d89 100644 --- a/lib/tests/misc.nix +++ b/lib/tests/misc.nix @@ -112,7 +112,7 @@ runTests { storePathAppendix = isStorePath "${goodPath}/bin/python"; nonAbsolute = isStorePath (concatStrings (tail (stringToCharacters goodPath))); - asPath = isStorePath (builtins.toPath goodPath); + asPath = isStorePath goodPath; otherPath = isStorePath "/something/else"; otherVals = { attrset = isStorePath {}; @@ -357,7 +357,7 @@ runTests { int = 42; bool = true; string = ''fno"rd''; - path = /. + "/foo"; # toPath returns a string + path = /. + "/foo"; null_ = null; function = x: x; functionArgs = { arg ? 4, foo }: arg; |