make-derivation: add check that the name is consistent with pname and version

This commit is contained in:
Patrick Hilhorst 2018-10-29 14:58:12 +01:00
parent 149a55eca7
commit 2962f94fec
No known key found for this signature in database
GPG key ID: 589BB0A8DAFEF2B2

View file

@ -82,6 +82,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;
let
# TODO(@oxij, @Ericson2314): This is here to keep the old semantics, remove when
# no package has `doCheck = true`.