summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorStefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>2021-10-08 09:48:25 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-10-14 11:48:45 +0100
commit17798d21e025bbd0f24f4f587efd385c5f6bc607 (patch)
tree705aeee7d352536f3be84409a9bfe957eadb800a /scripts
parenta4acb5472e8ce50d6d9bf0750bb4773e7a4045e3 (diff)
downloadpoky-17798d21e025bbd0f24f4f587efd385c5f6bc607.tar.gz
recipetool: Move license md5sums into CSV files
(From OE-Core rev: 631f6b7d1856e0e4f2313703fa1162d05e5deea6) Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/recipetool/create.py52
-rw-r--r--scripts/lib/recipetool/licenses.csv37
2 files changed, 52 insertions, 37 deletions
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index 5cd72ea0a7..e88a4253da 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -1004,6 +1004,7 @@ def handle_license_vars(srctree, lines_before, handled, extravalues, d):
1004 1004
1005def get_license_md5sums(d, static_only=False): 1005def get_license_md5sums(d, static_only=False):
1006 import bb.utils 1006 import bb.utils
1007 import csv
1007 md5sums = {} 1008 md5sums = {}
1008 if not static_only: 1009 if not static_only:
1009 # Gather md5sums of license files in common license dir 1010 # Gather md5sums of license files in common license dir
@@ -1011,46 +1012,23 @@ def get_license_md5sums(d, static_only=False):
1011 for fn in os.listdir(commonlicdir): 1012 for fn in os.listdir(commonlicdir):
1012 md5value = bb.utils.md5_file(os.path.join(commonlicdir, fn)) 1013 md5value = bb.utils.md5_file(os.path.join(commonlicdir, fn))
1013 md5sums[md5value] = fn 1014 md5sums[md5value] = fn
1015
1014 # The following were extracted from common values in various recipes 1016 # The following were extracted from common values in various recipes
1015 # (double checking the license against the license file itself, not just 1017 # (double checking the license against the license file itself, not just
1016 # the LICENSE value in the recipe) 1018 # the LICENSE value in the recipe)
1017 md5sums['94d55d512a9ba36caa9b7df079bae19f'] = 'GPLv2' 1019
1018 md5sums['b234ee4d69f5fce4486a80fdaf4a4263'] = 'GPLv2' 1020 # Read license md5sums from csv file
1019 md5sums['59530bdf33659b29e73d4adb9f9f6552'] = 'GPLv2' 1021 scripts_path = os.path.dirname(os.path.realpath(__file__))
1020 md5sums['0636e73ff0215e8d672dc4c32c317bb3'] = 'GPLv2' 1022 for path in (d.getVar('BBPATH').split(':')
1021 md5sums['eb723b61539feef013de476e68b5c50a'] = 'GPLv2' 1023 + [os.path.join(scripts_path, '..', '..')]):
1022 md5sums['751419260aa954499f7abaabaa882bbe'] = 'GPLv2' 1024 csv_path = os.path.join(path, 'lib', 'recipetool', 'licenses.csv')
1023 md5sums['393a5ca445f6965873eca0259a17f833'] = 'GPLv2' 1025 if os.path.isfile(csv_path):
1024 md5sums['12f884d2ae1ff87c09e5b7ccc2c4ca7e'] = 'GPLv2' 1026 with open(csv_path, newline='') as csv_file:
1025 md5sums['8ca43cbc842c2336e835926c2166c28b'] = 'GPLv2' 1027 fieldnames = ['md5sum', 'license']
1026 md5sums['ebb5c50ab7cab4baeffba14977030c07'] = 'GPLv2' 1028 reader = csv.DictReader(csv_file, delimiter=',', fieldnames=fieldnames)
1027 md5sums['c93c0550bd3173f4504b2cbd8991e50b'] = 'GPLv2' 1029 for row in reader:
1028 md5sums['9ac2e7cff1ddaf48b6eab6028f23ef88'] = 'GPLv2' 1030 md5sums[row['md5sum']] = row['license']
1029 md5sums['4325afd396febcb659c36b49533135d4'] = 'GPLv2' 1031
1030 md5sums['18810669f13b87348459e611d31ab760'] = 'GPLv2'
1031 md5sums['d7810fab7487fb0aad327b76f1be7cd7'] = 'GPLv2' # the Linux kernel's COPYING file
1032 md5sums['bbb461211a33b134d42ed5ee802b37ff'] = 'LGPLv2.1'
1033 md5sums['7fbc338309ac38fefcd64b04bb903e34'] = 'LGPLv2.1'
1034 md5sums['4fbd65380cdd255951079008b364516c'] = 'LGPLv2.1'
1035 md5sums['2d5025d4aa3495befef8f17206a5b0a1'] = 'LGPLv2.1'
1036 md5sums['fbc093901857fcd118f065f900982c24'] = 'LGPLv2.1'
1037 md5sums['a6f89e2100d9b6cdffcea4f398e37343'] = 'LGPLv2.1'
1038 md5sums['d8045f3b8f929c1cb29a1e3fd737b499'] = 'LGPLv2.1'
1039 md5sums['fad9b3332be894bab9bc501572864b29'] = 'LGPLv2.1'
1040 md5sums['3bf50002aefd002f49e7bb854063f7e7'] = 'LGPLv2'
1041 md5sums['9f604d8a4f8e74f4f5140845a21b6674'] = 'LGPLv2'
1042 md5sums['5f30f0716dfdd0d91eb439ebec522ec2'] = 'LGPLv2'
1043 md5sums['55ca817ccb7d5b5b66355690e9abc605'] = 'LGPLv2'
1044 md5sums['252890d9eee26aab7b432e8b8a616475'] = 'LGPLv2'
1045 md5sums['3214f080875748938ba060314b4f727d'] = 'LGPLv2'
1046 md5sums['db979804f025cf55aabec7129cb671ed'] = 'LGPLv2'
1047 md5sums['d32239bcb673463ab874e80d47fae504'] = 'GPLv3'
1048 md5sums['f27defe1e96c2e1ecd4e0c9be8967949'] = 'GPLv3'
1049 md5sums['6a6a8e020838b23406c81b19c1d46df6'] = 'LGPLv3'
1050 md5sums['3b83ef96387f14655fc854ddc3c6bd57'] = 'Apache-2.0'
1051 md5sums['385c55653886acac3821999a3ccd17b3'] = 'Artistic-1.0 | GPL-2.0' # some perl modules
1052 md5sums['54c7042be62e169199200bc6477f04d1'] = 'BSD-3-Clause'
1053 md5sums['bfe1f75d606912a4111c90743d6c7325'] = 'MPL-1.1'
1054 return md5sums 1032 return md5sums
1055 1033
1056def crunch_license(licfile): 1034def crunch_license(licfile):
diff --git a/scripts/lib/recipetool/licenses.csv b/scripts/lib/recipetool/licenses.csv
new file mode 100644
index 0000000000..0d3fb0607b
--- /dev/null
+++ b/scripts/lib/recipetool/licenses.csv
@@ -0,0 +1,37 @@
10636e73ff0215e8d672dc4c32c317bb3,GPLv2
212f884d2ae1ff87c09e5b7ccc2c4ca7e,GPLv2
318810669f13b87348459e611d31ab760,GPLv2
4252890d9eee26aab7b432e8b8a616475,LGPLv2
52d5025d4aa3495befef8f17206a5b0a1,LGPLv2.1
63214f080875748938ba060314b4f727d,LGPLv2
7385c55653886acac3821999a3ccd17b3,Artistic-1.0 | GPL-2.0
8393a5ca445f6965873eca0259a17f833,GPLv2
93b83ef96387f14655fc854ddc3c6bd57,Apache-2.0
103bf50002aefd002f49e7bb854063f7e7,LGPLv2
114325afd396febcb659c36b49533135d4,GPLv2
124fbd65380cdd255951079008b364516c,LGPLv2.1
1354c7042be62e169199200bc6477f04d1,BSD-3-Clause
1455ca817ccb7d5b5b66355690e9abc605,LGPLv2
1559530bdf33659b29e73d4adb9f9f6552,GPLv2
165f30f0716dfdd0d91eb439ebec522ec2,LGPLv2
176a6a8e020838b23406c81b19c1d46df6,LGPLv3
18751419260aa954499f7abaabaa882bbe,GPLv2
197fbc338309ac38fefcd64b04bb903e34,LGPLv2.1
208ca43cbc842c2336e835926c2166c28b,GPLv2
2194d55d512a9ba36caa9b7df079bae19f,GPLv2
229ac2e7cff1ddaf48b6eab6028f23ef88,GPLv2
239f604d8a4f8e74f4f5140845a21b6674,LGPLv2
24a6f89e2100d9b6cdffcea4f398e37343,LGPLv2.1
25b234ee4d69f5fce4486a80fdaf4a4263,GPLv2
26bbb461211a33b134d42ed5ee802b37ff,LGPLv2.1
27bfe1f75d606912a4111c90743d6c7325,MPL-1.1
28c93c0550bd3173f4504b2cbd8991e50b,GPLv2
29d32239bcb673463ab874e80d47fae504,GPLv3
30d7810fab7487fb0aad327b76f1be7cd7,GPLv2
31d8045f3b8f929c1cb29a1e3fd737b499,LGPLv2.1
32db979804f025cf55aabec7129cb671ed,LGPLv2
33eb723b61539feef013de476e68b5c50a,GPLv2
34ebb5c50ab7cab4baeffba14977030c07,GPLv2
35f27defe1e96c2e1ecd4e0c9be8967949,GPLv3
36fad9b3332be894bab9bc501572864b29,LGPLv2.1
37fbc093901857fcd118f065f900982c24,LGPLv2.1