diff --git a/pkgs/development/misc/bleeding-edge-repos/default.nix b/pkgs/development/misc/bleeding-edge-repos/default.nix index 6a1121f48e2..079339efdbf 100644 --- a/pkgs/development/misc/bleeding-edge-repos/default.nix +++ b/pkgs/development/misc/bleeding-edge-repos/default.nix @@ -17,7 +17,7 @@ args: then (getAttr name fetchInfos) { inherit fetchurl; } else throw "no bleeding edge source attribute found in bleeding-edge-fetch-infos.nix with name ${name}\n" "run NO_FETCH=1 nix-repository-manager --update to add it automatically"; - localTarGZ = managedRepoDir+"/dist/${ lib.dropPath (head fetchinfo.urls) }"; # hack, dropPath should be implemented as primop + localTarGZ = managedRepoDir+"/dist/${ builtins.baseNameOf (head fetchinfo.urls) }"; # hack, dropPath should be implemented as primop fetchInfos = import ../../../misc/bleeding-edge-fetch-infos.nix; in if (getConfig ["bleedingEdgeRepos" "useLocalRepos"] false && builtins.pathExists localTarGZ) then localTarGZ else fetchinfo; diff --git a/pkgs/lib/strings.nix b/pkgs/lib/strings.nix index ed8111b4e6a..e0271a3d20a 100644 --- a/pkgs/lib/strings.nix +++ b/pkgs/lib/strings.nix @@ -79,17 +79,6 @@ rec { # [] for zsh escapeShellArg = lib.escape (stringToCharacters "\\ ';$`()|<>\t*[]"); - # arg: http://foo/bar/bz.ext returns bz.ext - # !!! isn't this what the `baseNameOf' primop does? - dropPath = s : - if s == "" then "" else - let takeTillSlash = left : c : s : - if left == 0 then s - else if (substring left 1 s == "/") then - (substring (add left 1) (sub c 1) s) - else takeTillSlash (sub left 1) (add c 1) s; in - takeTillSlash (sub (stringLength s) 1) 1 s; - # Compares strings not requiring context equality # Obviously, a workaround but works on all Nix versions eqStrings = a: b: (a+(substring 0 0 b)) == ((substring 0 0 a)+b);