mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 15:11:25 +00:00
validateLicenses: Warn about derivations lacking licensing information.
svn path=/nixpkgs/trunk/; revision=30496
This commit is contained in:
parent
36da53ebc3
commit
4122bd643e
@ -330,16 +330,22 @@ rec {
|
||||
{ mkDerivation = args:
|
||||
let
|
||||
pkg = stdenv.mkDerivation args;
|
||||
drv = builtins.unsafeDiscardStringContext pkg.drvPath;
|
||||
license =
|
||||
if pkg ? meta && pkg.meta ? license then
|
||||
pkg.meta.license
|
||||
else if pkg ? outputHash then
|
||||
# Fixed-output derivations such as source tarballs usually
|
||||
# don't have licensing information, but that's OK.
|
||||
null
|
||||
else
|
||||
null;
|
||||
builtins.trace
|
||||
"warning: ${drv} lacks licensing information" null;
|
||||
|
||||
validate = arg:
|
||||
if licensePred license then arg
|
||||
else abort ''
|
||||
while building ${builtins.unsafeDiscardStringContext pkg.drvPath}:
|
||||
while building ${drv}:
|
||||
license `${builtins.toString license}' does not pass the predicate.
|
||||
'';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user