scancpan: warn on undefined LICENSE
authorFrancois Perrad <fperrad@gmail.com>
Mon, 13 Aug 2018 16:15:53 +0000 (18:15 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Tue, 14 Aug 2018 13:37:14 +0000 (15:37 +0200)
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
utils/scancpan

index fa31dfdeab9ca397f73928584f7b1efb314b3e51..8f47521692137252dd47350231e9027dd1a2761b 100755 (executable)
@@ -705,6 +705,10 @@ while (my ($distname, $dist) = each %dist) {
         $license =~ s|openssl|OpenSSL|;
         $license =~ s|perl_5|Artistic or GPL-1.0+|;
         my $license_files = join q{ }, keys %{$license_files{$distname}};
+        if ($license_files && (!$license || $license eq q{unknown})) {
+            push @info, qq{[$distname] undefined LICENSE, see $license_files};
+            $license = q{???};
+        }
         say qq{write ${mkname}} unless $quiet;
         open my $fh, q{>}, $mkname;
         say {$fh} qq{################################################################################};
@@ -718,7 +722,7 @@ while (my ($distname, $dist) = each %dist) {
         say {$fh} qq{${brname}_SITE = \$(BR2_CPAN_MIRROR)${directories}};
         say {$fh} qq{${brname}_DEPENDENCIES = ${dependencies}} if $need_target{$distname} && $dependencies;
         say {$fh} qq{HOST_${brname}_DEPENDENCIES = ${host_dependencies}} if $need_host{$distname} && $host_dependencies;
-        say {$fh} qq{${brname}_LICENSE = ${license}} if $license && $license ne q{unknown};
+        say {$fh} qq{${brname}_LICENSE = ${license}} if $license;
         say {$fh} qq{${brname}_LICENSE_FILES = ${license_files}} if $license_files;
         say {$fh} qq{};
         foreach (sort @{$deps_optional{$distname}}) {