Skip to content

Commit eb8524c

Browse files
vermaeterobwoolley
authored andcommitted
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 658a131 commit eb8524c

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

superflore/generators/bitbake/yocto_recipe.py

Lines changed: 13 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,18 @@ 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+
_concat = "AND"
428+
if self.release:
429+
if Version(self._get_yocto_version(self.release)) < \
430+
Version(yocto_releases['blacksail']):
431+
_concat = "&"
432+
oe_lic = f' {_concat} '.join([get_license(lic)
433+
for lic in self.license])
434+
if oe_lic != f' {_concat} '.join(self.license):
427435
ret += '# Original license in package.xml, joined with '
428-
ret += '"&" when multiple license tags were used:\n'
429-
ret += '# "' + ' & '.join(self.license) + '"\n'
436+
ret += f'"{_concat}" when multiple license tags were used:\n'
437+
ret += '# "' + f' {_concat} '.join(self.license) + '"'
438+
ret += '\n'
430439
ret += 'LICENSE = "' + oe_lic + '"\n'
431440
ret += 'LIC_FILES_CHKSUM = "file://package.xml;beginline='
432441
ret += str(self.license_line)

0 commit comments

Comments
 (0)