From 3583ca1bbc391240075d5aec298b855afd5954c9 Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Thu, 20 Jun 2024 22:57:14 +0200 Subject: [PATCH] Do not delete logs on app removal --- package_linter.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/package_linter.py b/package_linter.py index 3930567..f0996e0 100755 --- a/package_linter.py +++ b/package_linter.py @@ -3120,6 +3120,13 @@ class Script(TestSuite): "You should not use `ynh_script_progression` in _common.sh because it will produce warnings when trying to install the application." ) + @test(only=["remove"]) + def no_log_remove(self): + if self.containsregex("(ynh_secure_remove|ynh_safe_rm|rm).*(\/var\/log\/)"): + yield Warning( + "Do not delete logs on app removal, else they will be erased if the app upgrade fails. This is handled by the core." + ) + def main(): if len(sys.argv) < 2: