From 4d6613b76da87457f2708dc759fb9a4298ed67fc Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 4 Dec 2022 03:47:09 +0100 Subject: [PATCH] packagingv2: also autocomment nginx reload lines which are superfluous --- packaging_v2/convert_app_to_packaging_v2.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packaging_v2/convert_app_to_packaging_v2.py b/packaging_v2/convert_app_to_packaging_v2.py index 6c98cff..a02ec65 100644 --- a/packaging_v2/convert_app_to_packaging_v2.py +++ b/packaging_v2/convert_app_to_packaging_v2.py @@ -272,6 +272,8 @@ def cleanup_scripts_and_conf(folder): "^.*ynh_script_progression.*Validating.*parameters", "^.*ynh_script_progression.*SQL database", "^.*ynh_script_progression.*Configuring permissions", + "^.*ynh_script_progression.*Reloading NGINX web server", + "^.*ynh_systemd_action --service_name=nginx --action=reload", ] patterns_to_remove_in_scripts = [re.compile(f"({p})", re.MULTILINE) for p in patterns_to_remove_in_scripts] @@ -294,6 +296,12 @@ def cleanup_scripts_and_conf(folder): content = open(script).read() for pattern in patterns_to_remove_in_scripts: + if "^.*ynh_script_progression.*Reloading NGINX web server" in pattern.pattern and s == "restore": + # This case is legit + continue + if "^.*ynh_systemd_action --service_name=nginx --action=reload" in pattern.pattern and s == "restore": + # This case is legit + continue content = pattern.sub(r"#REMOVEME? \1", content) for pattern, replace in replaces: