修复:安装状态判断错误的问题

This commit is contained in:
shenmo
2026-02-19 21:07:00 +08:00
committed by GitHub
parent a37ee1cd31
commit 95e22894a7

View File

@@ -5,7 +5,7 @@ readonly ACE_ENVIRONMENTS=(
"deepin23-run:amber-ce-deepin23" "deepin23-run:amber-ce-deepin23"
"sid-run:amber-ce-sid" "sid-run:amber-ce-sid"
) )
dpkg -s "$1" > /dev/null 2>&1 dpkg -s '$1' 2>/dev/null | grep -q 'Status: install ok installed' > /dev/null 2>&1
RET="$?" RET="$?"
if [[ "$RET" != "0" ]] && [[ "$IS_ACE_ENV" == "" ]];then ## 如果未在ACE环境中 if [[ "$RET" != "0" ]] && [[ "$IS_ACE_ENV" == "" ]];then ## 如果未在ACE环境中
@@ -18,7 +18,7 @@ if [[ "$RET" != "0" ]] && [[ "$IS_ACE_ENV" == "" ]];then ## 如果未在ACE环
# 在ACE环境中使用dpkg -s检查安装状态 # 在ACE环境中使用dpkg -s检查安装状态
# 使用dpkg -s并检查输出中是否包含"Status: install ok installed" # 使用dpkg -s并检查输出中是否包含"Status: install ok installed"
$ace_cmd bash -c "dpkg -s '$1' 2>/dev/null | grep -q 'Status: install ok installed'" $ace_cmd dpkg -s "$1" 2>/dev/null | grep -q 'Status: install ok installed'
try_run_ret="$?" try_run_ret="$?"
# 最终检测结果处理 # 最终检测结果处理