diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2017-10-30 17:17:07 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2017-10-30 17:17:07 +0100 |
commit | c3255fe8ec326d2c8fe9462d49ed83aa64d3e68f (patch) | |
tree | 4b95bf3e53ef19ba273ff7d573379e506c65c757 /pkgs/build-support/fetchgit | |
parent | 6d41ae55dd8697dd79022891ba8b1d77696c7bb0 (diff) |
fetchzip and friends: Set "name" to "source" by default
This makes them produce the same store paths as builtins.fetchgit, builtins.fetchTarball etc. See https://github.com/NixOS/nix/commit/65b5f177b5fbb1b0778ede047a13a3cee9c59cfe.
Diffstat (limited to 'pkgs/build-support/fetchgit')
-rw-r--r-- | pkgs/build-support/fetchgit/gitrepotoname.nix | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/pkgs/build-support/fetchgit/gitrepotoname.nix b/pkgs/build-support/fetchgit/gitrepotoname.nix deleted file mode 100644 index 90005b5456923..0000000000000 --- a/pkgs/build-support/fetchgit/gitrepotoname.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ lib }: - -let - inherit (lib) removeSuffix hasPrefix removePrefix splitString stringToCharacters concatMapStrings last elem; - - allowedChars = stringToCharacters "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-._?="; - sanitizeStoreName = s: - let - s' = concatMapStrings (c: if elem c allowedChars then c else "") (stringToCharacters s); - s'' = if hasPrefix "." s' then "_${removePrefix "." s'}" else s'; - in - s''; -in - urlOrRepo: rev: - let - repo' = last (splitString ":" (baseNameOf (removeSuffix ".git" (removeSuffix "/" urlOrRepo)))); - rev' = baseNameOf rev; - in - "${sanitizeStoreName repo'}-${sanitizeStoreName rev'}-src" |