Skip to content

Print licenses used by the given project and its dependencies.

License

Notifications You must be signed in to change notification settings

vindarel/print-licenses

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Print licenses used by the given project and its dependencies

Install with Quicklisp:

(ql:quickload "print-licenses")

Note that in order to do this the project must be quickloaded, so you might want to do this in a separate Lisp image if you don't want to clutter your current one.

If the project does not specify its license in its ASDF system definition it will be listed as 'Unspecified'. You should manually figure out what license it uses (and maybe send a pull request).

Example:

  (print-licenses 'fast-io)
  =>
  alexandria           | Public Domain / 0-clause MIT
  babel                | MIT
  cffi                 | MIT
  cffi-grovel          | MIT
  cffi-toolchain       | MIT
  fast-io              | NewBSD
  static-vectors       | MIT
  trivial-features     | MIT
  trivial-gray-streams | MIT
  uiop                 | Unspecified

Or you might want to group systems by their license:

  (print-licenses :fast-io
                  :group-by-license t)
  =>
  MIT
    babel, cffi, cffi-grovel, cffi-toolchain, fast-io, static-vectors, trivial-features, trivial-gray-streams

  Public Domain / 0-clause MIT
    alexandria

  Unspecified
    asdf, uiop

See also

Related, to get a graph of dependencies:

and this snippet:

;; thanks https://gist.github.com/svetlyak40wt/a8ed639bf8fe07caed1531611bcf932d
;; added: max-level
(defun print-dependency-graph (system-name &key (level 0) (max-level most-positive-fixnum))
  (when (= level max-level)
    (return-from print-dependency-graph))
  (loop repeat level
        do (format t "  "))
  (format t "~A~%" system-name)
  (typecase system-name
    ((or string symbol)
     (let ((system (asdf/system:find-system system-name)))
       (loop for dep in (asdf/system:system-depends-on system)
              do (print-dependency-graph dep :level (1+ level) :max-level max-level))))))
(print-dependency-graph :str :max-level 3)
;; =>
STR
  cl-ppcre
  cl-ppcre-unicode
    cl-ppcre
    cl-unicode
  cl-change-case
    cl-ppcre
    cl-ppcre-unicode

Credit

Original code entirely taken from @sjl's utilities, the original snippet to build the license tree coming from a @dk_jackdaniel's snippet.

MIT.

About

Print licenses used by the given project and its dependencies.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •