[OpenWrt-Devel] generate list of license information for packages

John Crispin blogic at openwrt.org
Tue Oct 21 15:51:30 EDT 2014


Hi Thomas,

i knew before trying, but i tried anyway


Applying: generate list of license information for packages
fatal: sha1 information is lacking or useless (include/package-dumpinfo.mk).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 generate list of license information for packages
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".
applying 6516 FAILED

please send a fixed version that is generate against trunk

    John




On 21/10/2014 21:46, thomas.langer at lantiq.com wrote:
> From: Thomas Langer <thomas.langer at lantiq.com>
>
> 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 at lantiq.com>
> ---
> This patch is created against BB, but should also be applicable for trunk.
>
> diff --git a/include/package-dumpinfo.mk b/include/package-dumpinfo.mk
> --- a/include/package-dumpinfo.mk
> +++ b/include/package-dumpinfo.mk
> @@ -43,7 +43,9 @@ Category: $(CATEGORY)
>  Title: $(TITLE)
>  Maintainer: $(MAINTAINER)
>  Source: $(PKG_SOURCE)
> -Type: $(if $(Package/$(1)/targets),$(Package/$(1)/targets),$(if $(PKG_TARGETS),$(PKG_TARGETS),ipkg))
> +$(if $(PKG_LICENSE),License: $(PKG_LICENSE)
> +)$(if $(PKG_LICENSE_FILES),LicenseFiles: $(PKG_LICENSE_FILES)
> +)Type: $(if $(Package/$(1)/targets),$(Package/$(1)/targets),$(if $(PKG_TARGETS),$(PKG_TARGETS),ipkg))
>  $(if $(KCONFIG),Kernel-Config: $(KCONFIG)
>  )$(if $(BUILDONLY),Build-Only: $(BUILDONLY)
>  )$(if $(HIDDEN),Hidden: $(HIDDEN)
> diff --git a/scripts/metadata.pl b/scripts/metadata.pl
> --- a/scripts/metadata.pl
> +++ b/scripts/metadata.pl
> @@ -858,6 +858,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) {
> @@ -867,6 +889,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:
> @@ -876,6 +900,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
>  }
> diff --git a/scripts/metadata.pm b/scripts/metadata.pm
> --- a/scripts/metadata.pm
> +++ b/scripts/metadata.pm
> @@ -97,6 +97,8 @@ sub parse_package_metadata($) {
>  		/^Submenu: \s*(.+)\s*$/ and $pkg->{submenu} = $1;
>  		/^Submenu-Depends: \s*(.+)\s*$/ and $pkg->{submenudep} = $1;
>  		/^Source: \s*(.+)\s*$/ and $pkg->{source} = $1;
> +		/^License: \s*(.+)\s*$/ and $pkg->{license} = $1;
> +		/^LicenseFiles: \s*(.+)\s*$/ and $pkg->{licensefiles} = $1;
>  		/^Default: \s*(.+)\s*$/ and $pkg->{default} = $1;
>  		/^Provides: \s*(.+)\s*$/ and do {
>  			my @vpkg = split /\s+/, $1;
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list