diff options
author | Ludovic Courtès <ludo@gnu.org> | 2011-11-20 20:53:15 +0000 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2011-11-20 20:53:15 +0000 |
commit | 4122bd643e29232cae238c97f020a91c3c26c65b (patch) | |
tree | 32831b1b22a85ea6fa5ba5f8af4e7879df1b99b8 /pkgs/stdenv/adapters.nix | |
parent | 36da53ebc3ce84964b86786d15f1f47e4a9db938 (diff) |
validateLicenses: Warn about derivations lacking licensing information.
svn path=/nixpkgs/trunk/; revision=30496
Diffstat (limited to 'pkgs/stdenv/adapters.nix')
-rw-r--r-- | pkgs/stdenv/adapters.nix | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/pkgs/stdenv/adapters.nix b/pkgs/stdenv/adapters.nix index 4c6cd24a973f7..a1e8aafd7bc6d 100644 --- a/pkgs/stdenv/adapters.nix +++ b/pkgs/stdenv/adapters.nix @@ -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. ''; |