mirror of
https://gitee.com/amber-ce/amber-pm
synced 2026-05-14 02:00:20 +08:00
修复 安装异常时 卡住dpkg 的问题
This commit is contained in:
@@ -330,13 +330,24 @@ for dir in "$APM_BASE"/*/; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# 主命令处理
|
# 主命令处理
|
||||||
case "$1" in
|
case "$1" in
|
||||||
install|full-upgrade|upgrade|reinstall)
|
install|full-upgrade|upgrade|reinstall)
|
||||||
command=$1
|
command=$1
|
||||||
shift
|
shift
|
||||||
amber-pm-debug aptss "$command" "$@"
|
amber-pm-debug aptss "$command" "$@"
|
||||||
|
exit_code=$?
|
||||||
|
|
||||||
|
# 如果第一次执行失败,尝试修复并重试
|
||||||
|
if [ $exit_code -ne 0 ]; then
|
||||||
|
log.warn "Command failed, attempting to fix with dpkg --configure -a..."
|
||||||
|
amber-pm-debug dpkg --configure -a
|
||||||
|
log.info "Retrying $command..."
|
||||||
|
amber-pm-debug aptss "$command" "$@"
|
||||||
exit_code=$?
|
exit_code=$?
|
||||||
|
fi
|
||||||
|
|
||||||
if [ $exit_code -eq 0 ]; then
|
if [ $exit_code -eq 0 ]; then
|
||||||
log.info "Operation successful"
|
log.info "Operation successful"
|
||||||
else
|
else
|
||||||
@@ -455,6 +466,7 @@ case "$1" in
|
|||||||
debug_info $@
|
debug_info $@
|
||||||
;;
|
;;
|
||||||
ssaudit)
|
ssaudit)
|
||||||
|
amber-pm-debug dpkg --configure -a
|
||||||
amber-pm-debug ssaudit $@ --native
|
amber-pm-debug ssaudit $@ --native
|
||||||
exit_code=$?
|
exit_code=$?
|
||||||
if [ $exit_code -eq 0 ]; then
|
if [ $exit_code -eq 0 ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user