Skip to content

Commit bb287d6

Browse files
committed
SPDX: use 'AND' instead of '&' for master or >= blacksail
The SPDX specification no longer accepts '&' as a license operator. Replace it with 'AND' to comply with the SPDX rules used by Yocto. Signed-off-by: Jan Vermaete <jan.vermaete@gmail.com>
1 parent b10efe8 commit bb287d6

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

superflore/generators/bitbake/yocto_recipe.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@
5656
'walnascar': '5.2',
5757
'whinlatter': '5.3',
5858
'wrynose': '6.0',
59+
'wrynose': '6.0',
60+
'blacksail': '6.1',
5961
}
6062

6163

@@ -422,11 +424,15 @@ def get_recipe_text(self, distributor):
422424
ret += '# Original license in package.xml:\n'
423425
ret += '# "' + self.license + '"\n'
424426
elif isinstance(self.license, list):
425-
oe_lic = ' & '.join([get_license(lic) for lic in self.license])
426-
if oe_lic != ' & '.join(self.license):
427+
if Version(self._get_yocto_version(self.release)) < Version(yocto_releases['blacksail']):
428+
_concat = "AND"
429+
else:
430+
_concat = "&"
431+
oe_lic = f' {_concat} '.join([get_license(lic) for lic in self.license])
432+
if oe_lic != f' {_concat} '.join(self.license):
427433
ret += '# Original license in package.xml, joined with '
428-
ret += '"&" when multiple license tags were used:\n'
429-
ret += '# "' + ' & '.join(self.license) + '"\n'
434+
ret += f'"{_concat}" when multiple license tags were used:\n'
435+
ret += '# "' + f' {_concat} '.join(self.license) + '"\n'
430436
ret += 'LICENSE = "' + oe_lic + '"\n'
431437
ret += 'LIC_FILES_CHKSUM = "file://package.xml;beginline='
432438
ret += str(self.license_line)

0 commit comments

Comments
 (0)