Skip to content

Add option to list recursive dependencies of a package along with their licenses #879

Closed
@bos

Description

@bos

(Imported from Trac #889, reported by joeyadams on 2011-09-27)

It should be possible to list all of the dependencies of a package, including their licenses. This would be useful for:

  • Developers writing proprietary applications.
  • Developers who don't want their liberally-licensed libraries to be "upgraded" to the GPL or similar by subtle dependencies.
Attached is a simple patch that makes cabal-install list this information when the verbosity level is 2 or higher. Sample usage:
$ cabal install --verbose=2 --dry-run gnutls
Reading available packages...
Resolving dependencies...
base         BSD3
bytestring   BSD3
ffi          BSD3
ghc-prim     BSD3
gnutls       GPL (Just (Version {versionBranch = [3], versionTags = []}))
integer-gmp  BSD3
monads-tf    BSD3
rts          BSD3
transformers BSD3
In order, the following would be installed:
monads-tf-0.1.0.0 (new package)
gnutls-0.1 (new package)
This is a quick hack, as I am not familiar with the Cabal codebase. This should probably be wrapped as a --list-licenses command line switch. Pretty-printing licenses would be a plus.

I am already finding this feature useful, and hope others will too.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions