diff options
author | John Crispin <blogic@openwrt.org> | 2014-10-26 16:57:33 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2014-10-26 16:57:33 +0000 |
commit | ef7634e29e01793325998ecb32cb3541fb423109 (patch) | |
tree | e6e048f580022ead70c56842c4ad3fa04b9b9622 /scripts/metadata.pl | |
parent | 70fa8d00c06da8560aa7f4692b5366498808b9ad (diff) | |
download | upstream-ef7634e29e01793325998ecb32cb3541fb423109.tar.gz upstream-ef7634e29e01793325998ecb32cb3541fb423109.tar.bz2 upstream-ef7634e29e01793325998ecb32cb3541fb423109.zip |
generate list of license information for packages
Many packages define already metadata about their license (PKG_LICENSE),
but this is only included in the ipk files.
This change allows to create the information also on the build-host,
to get an overview on the used licenses.
In the full list, also all packages without this info are shown
Signed-off-by: Thomas Langer <thomas.langer@lantiq.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@43070 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'scripts/metadata.pl')
-rwxr-xr-x | scripts/metadata.pl | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/metadata.pl b/scripts/metadata.pl index 366e61cb63..f3d04dba2d 100755 --- a/scripts/metadata.pl +++ b/scripts/metadata.pl @@ -871,6 +871,28 @@ sub gen_package_feeds() { } } +sub gen_package_license($) { + my $level = shift; + parse_package_metadata($ARGV[0]) or exit 1; + foreach my $name (sort {uc($a) cmp uc($b)} keys %package) { + my $pkg = $package{$name}; + if ($pkg->{name}) { + if ($pkg->{license}) { + print "$pkg->{name}: "; + print "$pkg->{license}\n"; + if ($pkg->{licensefiles} && $level == 0) { + print "\tFiles: $pkg->{licensefiles}\n"; + } + } else { + if ($level == 1) { + print "$pkg->{name}: Missing license! "; + print "Please fix $pkg->{makefile}\n"; + } + } + } + } +} + sub parse_command() { my $cmd = shift @ARGV; for ($cmd) { @@ -880,6 +902,8 @@ sub parse_command() { /^kconfig/ and return gen_kconfig_overrides(); /^package_source$/ and return gen_package_source(); /^package_feeds$/ and return gen_package_feeds(); + /^package_license$/ and return gen_package_license(0); + /^package_licensefull$/ and return gen_package_license(1); } print <<EOF Available Commands: @@ -889,6 +913,8 @@ Available Commands: $0 kconfig [file] [config] Kernel config overrides $0 package_source [file] Package source file information $0 package_feeds [file] Package feed information in makefile format + $0 package_license [file] Package license information + $0 package_licensefull [file] Package license information (full list) EOF } |