Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] scancpan: refactor license name adjustment
@ 2018-09-22  6:53 Francois Perrad
  2018-09-25 20:58 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Francois Perrad @ 2018-09-22  6:53 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
 utils/scancpan | 37 +++++++++++++++++++++----------------
 1 file changed, 21 insertions(+), 16 deletions(-)

diff --git a/utils/scancpan b/utils/scancpan
index ee547c3e7..c460e1665 100755
--- a/utils/scancpan
+++ b/utils/scancpan
@@ -655,6 +655,24 @@ sub brname {
     return uc $name;
 }
 
+# Buildroot requires license name as in http://spdx.org/licenses/
+sub brlicense {
+    my $license = shift;
+    $license =~ s|apache_1_1|Apache-1.1|;
+    $license =~ s|apache_2_0|Apache-2.0|;
+    $license =~ s|artistic_2|Artistic-2.0|;
+    $license =~ s|artistic|Artistic-1.0|;
+    $license =~ s|lgpl_2_1|LGPL-2.1|;
+    $license =~ s|lgpl_3_0|LGPL-3.0|;
+    $license =~ s|gpl_2|GPL-2.0|;
+    $license =~ s|gpl_3|GPL-3.0|;
+    $license =~ s|mit|MIT|;
+    $license =~ s|mozilla_1_1|Mozilla-1.1|;
+    $license =~ s|openssl|OpenSSL|;
+    $license =~ s|perl_5|Artistic or GPL-1.0+|;
+    return $license;
+}
+
 while (my ($distname, $dist) = each %dist) {
     my $fsname = fsname( $distname );
     my $dirname = q{package/} . $fsname;
@@ -696,22 +714,9 @@ while (my ($distname, $dist) = each %dist) {
                                       map( { fsname( $_ ); } sort @{$deps_runtime{$distname}} );
         my $host_dependencies = join q{ }, map { q{host-} . fsname( $_ ); } sort( @{$deps_build{$distname}},
                                                                                   @{$deps_runtime{$distname}} );
-        my $license = ref $dist->{license} eq 'ARRAY'
-                    ? join q{ or }, @{$dist->{license}}
-                    : $dist->{license};
-        # BR requires license name as in http://spdx.org/licenses/
-        $license =~ s|apache_1_1|Apache-1.1|;
-        $license =~ s|apache_2_0|Apache-2.0|;
-        $license =~ s|artistic|Artistic-1.0|;
-        $license =~ s|artistic_2|Artistic-2.0|;
-        $license =~ s|lgpl_2_1|LGPL-2.1|;
-        $license =~ s|lgpl_3_0|LGPL-3.0|;
-        $license =~ s|gpl_2|GPL-2.0|;
-        $license =~ s|gpl_3|GPL-3.0|;
-        $license =~ s|mit|MIT|;
-        $license =~ s|mozilla_1_1|Mozilla-1.1|;
-        $license =~ s|openssl|OpenSSL|;
-        $license =~ s|perl_5|Artistic or GPL-1.0+|;
+        my $license = brlicense( ref $dist->{license} eq 'ARRAY'
+                               ? join q{ or }, @{$dist->{license}}
+                               : $dist->{license} );
         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};
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Buildroot] [PATCH] scancpan: refactor license name adjustment
  2018-09-22  6:53 [Buildroot] [PATCH] scancpan: refactor license name adjustment Francois Perrad
@ 2018-09-25 20:58 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2018-09-25 20:58 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 22 Sep 2018 08:53:23 +0200, Francois Perrad wrote:
> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
> ---
>  utils/scancpan | 37 +++++++++++++++++++++----------------
>  1 file changed, 21 insertions(+), 16 deletions(-)

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-09-25 20:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-22  6:53 [Buildroot] [PATCH] scancpan: refactor license name adjustment Francois Perrad
2018-09-25 20:58 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox