make-derivation: use a more descriptive assert message

As suggested by @Profpatsch
This commit is contained in:
Patrick Hilhorst 2018-10-30 14:27:28 +01:00
parent c7e026bec4
commit 1f7fc09176
No known key found for this signature in database
GPG Key ID: 589BB0A8DAFEF2B2

View File

@ -86,7 +86,8 @@ rec {
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`";
("mkDerivation: `name` (\"${attrs.name}\") must be consistent " +
"with `pname-version` \"${attrs.pname}-${attrs.version}\"");
let
# TODO(@oxij, @Ericson2314): This is here to keep the old semantics, remove when