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 <daniel.mcgregor@vecima.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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
}