Merge pull request #83241 from Infinisil/valid-drv-name

lib/strings: Add `sanitizeDerivationName` function
This commit is contained in:
Silvan Mosberger
2020-04-02 05:58:13 +02:00
committed by GitHub
3 changed files with 76 additions and 2 deletions
+2 -2
View File
@@ -4,7 +4,7 @@
let
inherit (builtins) head tail length;
inherit (lib.trivial) and;
inherit (lib.strings) concatStringsSep;
inherit (lib.strings) concatStringsSep sanitizeDerivationName;
inherit (lib.lists) fold concatMap concatLists;
in
@@ -310,7 +310,7 @@ rec {
path' = builtins.storePath path;
res =
{ type = "derivation";
name = builtins.unsafeDiscardStringContext (builtins.substring 33 (-1) (baseNameOf path'));
name = sanitizeDerivationName (builtins.substring 33 (-1) (baseNameOf path'));
outPath = path';
outputs = [ "out" ];
out = res;