From 6ce44da797edbfe91eab9fc86cb77e9ee72beee4 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 11 Mar 2021 19:50:01 +0100 Subject: [PATCH] Fix forbidden data location test.. --- package_linter.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package_linter.py b/package_linter.py index 3f4e04d..c61ae63 100755 --- a/package_linter.py +++ b/package_linter.py @@ -584,10 +584,11 @@ class App(TestSuite): @test() def app_data_in_unofficial_dir(self): - allowed_locations = ["yunohost.app", "yunohost.conf", "yunohost.backup", "yunohost.multimedia"] + allowed_locations = ["/home/yunohost.app", "/home/yunohost.conf", "/home/yunohost.backup", "/home/yunohost.multimedia"] cmd = "grep -IhEro '/home/yunohost[^/ ]*/' %s/scripts || true" % self.path home_locations = subprocess.check_output(cmd, shell=True).decode('utf-8').strip().split("\n") - forbidden_locations = set([location for location in home_locations if location and location not in allowed_locations]) + + forbidden_locations = set([location for location in home_locations if location and location.rstrip('/') not in allowed_locations]) if forbidden_locations: yield Warning("The app seems to be storing data in the 'forbidden' locations %s. The recommended pratice is rather to store data in /home/yunohost.app/$app or /home/yunohost.multimedia (depending on the use case)" % ', '.join(forbidden_locations))