treewide: Remove uses of builtins.toPath.

toPath has confusing semantics and is never necessary; it can always
either just be omitted or replaced by pre-concatenating `/.`. It has
been marked as "!!! obsolete?" for more than 10 years in a C++
comment, hopefully removing it will let us properly deprecate and,
eventually, remove it.
This commit is contained in:
Shea Levy
2018-05-22 16:42:02 -04:00
parent 74083c8cd7
commit 6da6accd30
11 changed files with 14 additions and 15 deletions

View File

@@ -22,8 +22,8 @@ assert null == lib.findFirst (c: "/"==c) null (lib.stringToCharacters repository
assert null == lib.findFirst (c: "/"==c) null (lib.stringToCharacters imageName);
let
# Abuse `builtins.toPath` to collapse possible double slashes
repoTag0 = builtins.toString (builtins.toPath "/${stripScheme registry}/${repository}/${imageName}");
# Abuse paths to collapse possible double slashes
repoTag0 = builtins.toString (/. + "/${stripScheme registry}/${repository}/${imageName}");
repoTag1 = lib.removePrefix "/" repoTag0;
layers = builtins.map stripNixStore imageLayers;