From 812fb0c99684d6432308443c0db9170dbf26f7c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Wed, 6 Sep 2023 13:53:54 +0200 Subject: [PATCH] Allow packages to be a list. Also, use the same splitting logic as in yunohost source code. --- package_linter.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/package_linter.py b/package_linter.py index cbbebd5..66e9851 100755 --- a/package_linter.py +++ b/package_linter.py @@ -1964,7 +1964,11 @@ class Manifest(TestSuite): ) dbtype = resources["database"]["type"] - apt_packages = [p.strip(',') for p in resources["apt"].get("packages", "").split(" ")] + + apt_packages = resources["apt"].get("packages", []) + if isinstance(apt_packages, str): + apt_packages = [value.strip() for value in apt_packages.split(",")] + if dbtype == "mysql" and "mariadb-server" not in apt_packages: yield Warning( "When using a mysql database, you should add mariadb-server in apt dependencies. Even though it's currently installed by default in YunoHost installations, it might not be in the future !"