浏览代码

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.

(From OE-Core rev: a5327fc16b76db28dd1da37463a046e69713dbac)

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>
Daniel McGregor 3 周之前
父节点
当前提交
2423dc098c
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      meta/classes-recipe/systemd.bbclass

+ 2 - 1
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
 }