systemd: use if..then in prerm scriptlet
PATCH 1/1 systemd: use if..then in prerm scriptlet
From: Daniel McGregor <[email protected]>
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 <[email protected]>
--- meta/classes-recipe/systemd.bbclass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes-recipe/systemd.bbclass +2 -1
@@ -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 }