diff options
author | Nicolas Pierron <nicolas.b.pierron@gmail.com> | 2009-11-21 17:50:00 +0000 |
---|---|---|
committer | Nicolas Pierron <nicolas.b.pierron@gmail.com> | 2009-11-21 17:50:00 +0000 |
commit | 00efa9c2dd8b397a09b3123dd2d720798bc28433 (patch) | |
tree | 8c606fbd974515d13f7917a8c29c0e12f79adddd /pkgs/stdenv | |
parent | 86f8f47d870346ddbb593582d354327e6ff01237 (diff) | |
download | nixlib-00efa9c2dd8b397a09b3123dd2d720798bc28433.tar nixlib-00efa9c2dd8b397a09b3123dd2d720798bc28433.tar.gz nixlib-00efa9c2dd8b397a09b3123dd2d720798bc28433.tar.bz2 nixlib-00efa9c2dd8b397a09b3123dd2d720798bc28433.tar.lz nixlib-00efa9c2dd8b397a09b3123dd2d720798bc28433.tar.xz nixlib-00efa9c2dd8b397a09b3123dd2d720798bc28433.tar.zst nixlib-00efa9c2dd8b397a09b3123dd2d720798bc28433.zip |
* Add a script to retrieve licenses of the current derivation and of all
its dependencies. To make it works, you need to change the default stdenv as documented in the error message. ./maintainers/scripts/dep-licenses.sh <attribute name> svn path=/nixpkgs/trunk/; revision=18508
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r-- | pkgs/stdenv/adapters.nix | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/pkgs/stdenv/adapters.nix b/pkgs/stdenv/adapters.nix index 5760c4459ad5..410cc16838d1 100644 --- a/pkgs/stdenv/adapters.nix +++ b/pkgs/stdenv/adapters.nix @@ -202,4 +202,29 @@ rec { (stdenv.mkDerivation args) { meta.maintainers = maintainers; }; }; + + + /* Use the trace output to report all processed derivations with their + license name. + + */ + traceDrvLicenses = stdenv: stdenv // + { mkDerivation = args: + let + pkg = stdenv.mkDerivation args; + printDrvPath = val: let + drvPath = builtins.unsafeDiscardStringContext pkg.drvPath; + license = + if pkg ? meta && pkg.meta ? license then + pkg.meta.license + else + null; + in + builtins.trace "@:drv:${toString drvPath}:${builtins.exprToString license}:@" + val; + in pkg // { + outPath = printDrvPath pkg.outPath; + drvPath = printDrvPath pkg.drvPath; + }; + }; } |