core: 不显示 which stderr

This commit is contained in:
bin456789 2023-09-28 23:51:28 +08:00
parent f9937a0660
commit 1f34697f56
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B

View File

@ -577,10 +577,10 @@ install_pkg() {
for cmd in "$@"; do for cmd in "$@"; do
# 用 which 而不是 command -v因为 command -v 把脚本中的function也算在内 # 用 which 而不是 command -v因为 command -v 把脚本中的function也算在内
if ! which $cmd >/dev/null || if ! which $cmd >/dev/null 2>&1 ||
# gentoo 默认编译的 unsquashfs 不支持 xz # gentoo 默认编译的 unsquashfs 不支持 xz
{ [ "$cmd" = unsquashfs ] && { [ "$cmd" = unsquashfs ] &&
which emerge >/dev/null && which emerge >/dev/null 2>&1 &&
! unsquashfs |& grep -w xz && ! unsquashfs |& grep -w xz &&
echo "unsquashfs not supported xz. need rebuild."; }; then echo "unsquashfs not supported xz. need rebuild."; }; then