Skip to content

Add a license scanning script

Andrej Shadura requested to merge wip/andrewsh/license-scan into apertis/v2020pre

This adds a new license scanning script to integrate with the CI.

The script runs scan-copyright and compares its output with the previous version of itself.

If --fail-on-change is passed, it will stop on any difference and report an error. Otherwise, it will fail when it detects files with UNKNOWN license or one of the licenses on a blacklist.

The script uses of the following files to configure the scanning tool:

  • debian/apertis/copyright.whitelist, a gitignore-formatted files to exclude from the scanning process. Extra files can be specified using --extra-whitelist.
  • debian/apertis/copyright.yml, a YAML file mapping files to copyright statements and licenses. It can be used to give the scanning tool hints or completely override its output. The format is described in the Dpkg::Copyright::Scanner manual page.
  • debian/fill.copyright.blanks.yml: some Debian packages already ship a file with hints for scan-copyright; it is also used in the scanning process. The format is described in the Dpkg::Copyright::Scanner manual page.
  • debian/copyright-scan-patterns.yml: some Debian packages already ship a file telling the tool to ignore some files. The format is described in the Dpkg::Copyright::Scanner manual page. The check field is effectively useless, since the license scanning script adds a rule to enable scanning of all files, not just a select list of patterns.

Merge request reports

Loading