From 809232f8b386c7f21a718b41debccbe714067bea Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 21 Nov 2020 02:34:01 +0100 Subject: [PATCH] Support multiple licenses --- package_linter.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/package_linter.py b/package_linter.py index 6ab8a5a..81e3cd2 100755 --- a/package_linter.py +++ b/package_linter.py @@ -881,19 +881,24 @@ class Manifest(TestSuite): if "license" not in self.manifest: 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("-", ""): - yield Warning("'non-free' apps cannot be integrated in YunoHost's app catalog.") - return + for license in licenses: - code_license = '' + license + '' + license = license.strip() - if code_license not in spdx_licenses(): - yield Warning( - "The license id '%s' is not registered in https://spdx.org/licenses/." % license - ) - return + if "nonfree" in license.replace("-", ""): + yield Warning("'non-free' apps cannot be integrated in YunoHost's app catalog.") + return + + code_license = '' + license + '' + + if code_license not in spdx_licenses(): + yield Warning( + "The license id '%s' is not registered in https://spdx.org/licenses/." % license + ) + return @test() def description(self):