Support multiple licenses

This commit is contained in:
Alexandre Aubin 2020-11-21 02:34:01 +01:00
parent ce36805ad5
commit 809232f8b3

View file

@ -881,19 +881,24 @@ class Manifest(TestSuite):
if "license" not in self.manifest: if "license" not in self.manifest:
return return
license = self.manifest["license"] # Turns out there may be multiple licenses ... (c.f. seafile)
licenses = self.manifest["license"].split(",")
if "nonfree" in license.replace("-", ""): for license in licenses:
yield Warning("'non-free' apps cannot be integrated in YunoHost's app catalog.")
return
code_license = '<code property="spdx:licenseId">' + license + '</code>' license = license.strip()
if code_license not in spdx_licenses(): if "nonfree" in license.replace("-", ""):
yield Warning( yield Warning("'non-free' apps cannot be integrated in YunoHost's app catalog.")
"The license id '%s' is not registered in https://spdx.org/licenses/." % license return
)
return code_license = '<code property="spdx:licenseId">' + license + '</code>'
if code_license not in spdx_licenses():
yield Warning(
"The license id '%s' is not registered in https://spdx.org/licenses/." % license
)
return
@test() @test()
def description(self): def description(self):