-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
substituteAll: disallow invalid arguments, fix plasma-workspace (#350039
- Loading branch information
Showing
12 changed files
with
39 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,22 @@ | ||
{ stdenvNoCC }: | ||
|
||
args: | ||
|
||
{ lib, stdenvNoCC }: | ||
# see the substituteAll in the nixpkgs documentation for usage and constraints | ||
stdenvNoCC.mkDerivation ({ | ||
name = if args ? name then args.name else baseNameOf (toString args.src); | ||
builder = ./substitute-all.sh; | ||
inherit (args) src; | ||
preferLocalBuild = true; | ||
allowSubstitutes = false; | ||
} // args) | ||
args: | ||
let | ||
# keep this in sync with substituteAll | ||
isInvalidArgName = x: builtins.match "^[a-z][a-zA-Z0-9_]*$" x == null; | ||
invalidArgs = builtins.filter isInvalidArgName (builtins.attrNames args); | ||
in | ||
if invalidArgs == [] then | ||
stdenvNoCC.mkDerivation ({ | ||
name = if args ? name then args.name else baseNameOf (toString args.src); | ||
builder = ./substitute-all.sh; | ||
inherit (args) src; | ||
preferLocalBuild = true; | ||
allowSubstitutes = false; | ||
} // args) | ||
else throw '' | ||
Argument names for `pkgs.substituteAll` must: | ||
- start with a lower case ASCII letter | ||
- only contain ASCII letters, digits and underscores | ||
Found invalid argument names: ${lib.concatStringsSep ", " invalidArgs}. | ||
'' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!@runtimeShell@ | ||
|
||
@fish@/bin/fish \ | ||
@OMF@/share/oh-my-fish/bin/install \ | ||
@omf@/share/oh-my-fish/bin/install \ | ||
--noninteractive \ | ||
--offline=@OMF@/share/oh-my-fish | ||
--offline=@omf@/share/oh-my-fish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters