diff options
author | Patrick Hilhorst <git@hilhorst.be> | 2018-10-29 18:25:59 +0100 |
---|---|---|
committer | Patrick Hilhorst <git@hilhorst.be> | 2018-10-29 18:25:59 +0100 |
commit | c7e026bec483582bf2b8ac624519555f9476751c (patch) | |
tree | f21fc0f00ee886dd4a07da9c120b3a96bc6f553f /pkgs | |
parent | 5be927db142448207c6a1d0c6e58ac5eb2af1fc5 (diff) | |
download | nixlib-c7e026bec483582bf2b8ac624519555f9476751c.tar nixlib-c7e026bec483582bf2b8ac624519555f9476751c.tar.gz nixlib-c7e026bec483582bf2b8ac624519555f9476751c.tar.bz2 nixlib-c7e026bec483582bf2b8ac624519555f9476751c.tar.lz nixlib-c7e026bec483582bf2b8ac624519555f9476751c.tar.xz nixlib-c7e026bec483582bf2b8ac624519555f9476751c.tar.zst nixlib-c7e026bec483582bf2b8ac624519555f9476751c.zip |
make-derivation: use `lib.assertMsg`
As suggested by @Profpatsch
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/stdenv/generic/make-derivation.nix | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 9f6fee937101..2ff7db947fe0 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -83,8 +83,10 @@ rec { , ... } @ attrs: # Check that the name is consistent with pname and version: - assert lib.lists.all (name: builtins.hasAttr name attrs) ["name" "pname" "version"] - -> lib.strings.hasSuffix "${attrs.pname}-${attrs.version}" attrs.name; + assert lib.assertMsg + (lib.lists.all (name: builtins.hasAttr name attrs) ["name" "pname" "version"] + -> lib.strings.hasSuffix "${attrs.pname}-${attrs.version}" attrs.name) + "mkDerivation: `name` must be consistent with `pname-version`"; let # TODO(@oxij, @Ericson2314): This is here to keep the old semantics, remove when |