make-derivation: use lib.assertMsg

As suggested by @Profpatsch
This commit is contained in:
Patrick Hilhorst 2018-10-29 18:25:59 +01:00
parent 5be927db14
commit c7e026bec4
No known key found for this signature in database
GPG Key ID: 589BB0A8DAFEF2B2

View File

@ -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