From 200fe99e1c691177fd14f394c3fdb3473e813a94 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 15 Aug 2022 18:23:42 +0200 Subject: [PATCH] Complain about ynh_setup_source --keep used with absolute paths ... --- package_linter.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package_linter.py b/package_linter.py index c19a3c0..039c771 100755 --- a/package_linter.py +++ b/package_linter.py @@ -2093,6 +2093,12 @@ class Script(TestSuite): if os.system(cmd) == 0: yield Info("(Requires Yunohost 4.3) When using ynh_exec_*, please don't wrap your command between quotes (typically DONT write ynh_exec_warn_less 'foo --bar --baz')") + @test() + def ynh_setup_source_keep_with_absolute_path(self): + cmd = 'grep -q -IhEro "ynh_setup_source.*keep.*final_path" %s' % self.path + if os.system(cmd) == 0: + yield Info("The --keep option of ynh_setup_source expects relative paths, not absolute path ... you do not need to prefix everything with '$final_path' in the --keep arg ...") + @test() def ynh_add_fpm_config_deprecated_package_option(self): if self.containsregex(r'ynh_add_fpm_config .*package=.*'):