Skip to content

Commit 2548f43

Browse files
committed
Correct license mappings for Alpine
We were missing out certain openssl exception Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent 2b64449 commit 2548f43

File tree

7 files changed

+11
-8
lines changed

7 files changed

+11
-8
lines changed

src/packagedcode/alpine.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1442,6 +1442,7 @@ def normalize_and_cleanup_declared_license(declared):
14421442
'(gpl-2.0-only with licenseref-scancode-generic-exception '
14431443
'and lgpl-2.1-or-later with licenseref-scancode-generic-exception)',
14441444

1445+
# seen in https://github.com/alpinelinux/aports/blob/6052f331b316cf5366bd3db02af8400e9a34ab59/main/haproxy/APKBUILD
14451446
'(gpl-2.0-or-later and gpl-2.1-or-later) with openssl-exception':
14461447
'(gpl-2.0-or-later with licenseref-scancode-generic-exception '
14471448
'and lgpl-2.1-or-later with licenseref-scancode-generic-exception)',
@@ -1647,7 +1648,7 @@ def apply_syntax_fixes(s):
16471648

16481649
# "with" mishaps
16491650
'gpl-2.0 with classpath': 'gpl-2.0 with classpath-exception-2.0',
1650-
'gpl-2.0-only with openssl-exception': 'pl-2.0-only with licenseref-scancode-openssl-exception-gpl-2.0',
1651+
'gpl-2.0-only with openssl-exception': 'gpl-2.0-only with licenseref-scancode-openssl-exception-gpl-2.0-plus',
16511652
'gpl-2.0-or-later with openssl-exception': 'gpl-2.0-or-later with licenseref-scancode-openssl-exception-gpl-2.0-plus',
16521653

16531654
'gpl-3.0-only with openssl-exception': 'gpl-3.0-only with licenseref-scancode-openssl-exception-gpl-3.0-plus',
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
declared_license: GPL-2.0-only WITH OpenSSL-Exception
2-
license_expression: gpl-2.0
2+
license_expression: gpl-2.0 WITH openssl-exception-gpl-2.0-plus
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
declared_license: GPL-2.0-only WITH openssl-exception
2-
license_expression: gpl-2.0
2+
license_expression: gpl-2.0 WITH openssl-exception-gpl-2.0-plus
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
declared_license: GPL-2.0-only WITH OpenSSL-Exception
2+
license_expression: gpl-2.0 with openssl-exception-gpl-2.0-plus
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
declared_license: GPL-2.0-or-later WITH OpenSSL-Exception
2+
license_expression: gpl-2.0-plus with openssl-exception-gpl-2.0-plus
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
declared_license: (GPL-2.0-or-later AND GPL-2.1-or-later) WITH OpenSSL-Exception
2+
license_expression: gpl-2.0-plus with generic-exception and lgpl-2.1-plus with generic-exception

tests/packagedcode/test_alpine_license.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,7 @@ def closure_test_function(*args, **kwargs):
117117
license_test.dump()
118118
return
119119

120-
if detected != license_test.license_expression:
121-
# On failure, we compare against more result data to get additional
122-
# failure details, including the test_file
123-
expected = [license_test.to_dict(), f'file://{license_test.data_file}']
124-
raise Exception(expected, saneyaml.dump(_license_detections))
120+
assert detected == license_test.license_expression
125121

126122
return closure_test_function
127123

0 commit comments

Comments
 (0)