From: Daniel McGregor Date: Tue, 23 Sep 2025 19:01:46 +0000 (-0600) Subject: systemd: use if..then in prerm scriptlet X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a5327fc16b76db28dd1da37463a046e69713dbac;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git systemd: use if..then in prerm scriptlet Using the [ test ] && foo construct in the prerm scriptlet causes the prerm scriptlet to fail if the final test condition fails, which with rpm prevents the removal of the package. Switch to using if;then;fi instead, since it doesn't cause the scriptlet to fail. Signed-off-by: Daniel McGregor Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- diff --git a/meta/classes-recipe/systemd.bbclass b/meta/classes-recipe/systemd.bbclass index 4e687135f1..5a0550b287 100644 --- a/meta/classes-recipe/systemd.bbclass +++ b/meta/classes-recipe/systemd.bbclass @@ -74,8 +74,9 @@ if type systemctl >/dev/null 2>/dev/null; then fi # same as above, --global flag is not supported for stop so do disable only - [ -n "${@systemd_filter_services("${SYSTEMD_SERVICE_ESCAPED}", True, d)}" ] && \ + if [ -n "${@systemd_filter_services("${SYSTEMD_SERVICE_ESCAPED}", True, d)}" ]; then systemctl --global disable ${@systemd_filter_services("${SYSTEMD_SERVICE_ESCAPED}", True, d)} + fi fi fi }