This commit is contained in:
shenmo 2025-04-13 19:55:27 +08:00
parent 819e680222
commit 90ad08a6f9
3 changed files with 175 additions and 114 deletions

3
debian/changelog vendored

@ -1,7 +1,8 @@
spark-store (4.6.5) UNRELEASED; urgency=medium spark-store (4.7.0) UNRELEASED; urgency=medium
* aptss 第二、三阶段加速 * aptss 第二、三阶段加速
* 修复部分应用无法启动的问题 * 修复部分应用无法启动的问题
* 支持使用 ACE deepin23 trixie
-- shenmo <shenmo@spark-app.store> Tue, 24 Sep 2024 11:27:08 +0800 -- shenmo <shenmo@spark-app.store> Tue, 24 Sep 2024 11:27:08 +0800

@ -170,7 +170,7 @@ if [ ! -z "$IS_SHA512SUM_CHECKED" ]; then
echo "Package name is $package_name" echo "Package name is $package_name"
try_run_output=$(/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh test-install-app "$DEBPATH") try_run_output=$(/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh test-install-app "$DEBPATH")
try_run_ret="$?" try_run_ret="$?"
# 安装失败后进行 aptss update 刷新,随后尝试在主机安装 # 安装失败后进行 aptss 刷新,随后尝试在主机安装
if [ "$try_run_ret" -ne 0 ]; then if [ "$try_run_ret" -ne 0 ]; then
aptss update aptss update
try_run_output=$(/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh test-install-app "$DEBPATH") try_run_output=$(/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh test-install-app "$DEBPATH")
@ -178,49 +178,79 @@ if [ ! -z "$IS_SHA512SUM_CHECKED" ]; then
fi fi
if [ "$try_run_ret" -ne 0 ]; then ## 若安装检测仍然失败 if [ "$try_run_ret" -ne 0 ]; then ## 若安装检测仍然失败
if [[ "$IS_ACE_ENV" == "" ]];then ## 如果未在ACE环境中
# 定义按顺序尝试的ACE环境命令:推荐安装包)
declare -a ace_commands_order=(
"bookworm-run:amber-ce-bookworm"
"trixie-run:amber-ce-trixie"
"deepin23-run:amber-ce-deepin23"
)
if [[ "$IS_ACE_ENV" == "" ]];then ## 如果已经在ACE里面则不进入分支 success=false
recommendation_msg=""
# 收集所有推荐信息
for ace_entry in "${ace_commands_order[@]}"; do
recommendation_msg+="您可安装 ${ace_entry%%:*} 兼容环境后重试: ${ace_entry#*:}\n"
done
if command -v bookworm-run ;then ## 如果 bookworm-run 可用则进行安装 # 按顺序尝试每个ACE环境
for ace_entry in "${ace_commands_order[@]}"; do
ace_cmd=${ace_entry%%:*}
if command -v "$ace_cmd" >/dev/null 2>&1; then
echo "----------------------------------------" echo "----------------------------------------"
echo "Attention: USING ACE BOOKWORM TO INSTALL" echo "正在尝试使用 $ace_cmd 环境安装..."
echo "----------------------------------------" echo "----------------------------------------"
bookworm-run ensure_aptss_exist
try_run_output=$(bookworm-run aptss install --dry-run "$DEBPATH") # 在ACE环境中执行安装检测
$ace_cmd ensure_aptss_exist
try_run_output=$($ace_cmd aptss install --dry-run "$DEBPATH" 2>&1)
try_run_ret="$?" try_run_ret="$?"
# 如果首次检测失败则更新后重试
if [ "$try_run_ret" -ne 0 ]; then if [ "$try_run_ret" -ne 0 ]; then
bookworm-run aptss update $ace_cmd aptss update
try_run_output=$(bookworm-run aptss install --dry-run "$DEBPATH") try_run_output=$($ace_cmd aptss install --dry-run "$DEBPATH" 2>&1)
try_run_ret="$?" try_run_ret="$?"
fi fi
if [ "$try_run_ret" -ne 0 ]; then
echo "OMG-IT-GOES-WRONG" # 最终检测结果处理
if [ "$try_run_ret" -eq 0 ]; then
echo "----------------------------------------"
echo "在 $ace_cmd 环境中预检成功,开始安装..."
echo "----------------------------------------"
$ace_cmd 'dpkg -i "$DEBPATH" || aptss install "$DEBPATH" -yf'
success=true
break # 跳出循环
else
echo "----------------------------------------"
echo "在 $ace_cmd 环境中安装预检失败,错误信息:"
echo -e "${try_run_output}" echo -e "${try_run_output}"
echo "----------------------------------------" echo "----------------------------------------"
echo "Attention: USING ACE BOOKWORM TO INSTALL"
echo "----------------------------------------"
exit "$try_run_ret"
fi fi
bookworm-run 'dpkg -i "$DEBPATH" || aptss install "$DEBPATH" -yf '
fi fi
done
else # 如果在主机安装失败且未安装ACE报错退出并推荐安装 ACE if ! $success; then
echo "OMG-IT-GOES-WRONG" echo "OMG-IT-GOES-WRONG"
echo -e "${try_run_output}" echo -e "${try_run_output}"
echo "您可在商店安装 ACE Bookworm 兼容环境后重试安装 https://bbs.deepin.org.cn/post/285056 " echo -e "所有ACE环境尝试失败推荐安装以下任一兼容环境:\n${recommendation_msg}"
exit "$try_run_ret" exit "$try_run_ret"
fi fi
else ## 如果主机安装检测成功了,进入主机安装分支 else # 已经在ACE环境中仍失败直接退出
echo "OMG-IT-GOES-WRONG"
echo -e "${try_run_output}"
exit "$try_run_ret"
fi
else ## 如果主机安装检测成功
dpkg -i "$DEBPATH" || aptss install "$DEBPATH" -yf dpkg -i "$DEBPATH" || aptss install "$DEBPATH" -yf
fi fi
### 退出阶段
### 退出阶段保持不变 ###
if [ "$?" = "0" ] && [ "$2" = "--delete-after-install" ]; then if [ "$?" = "0" ] && [ "$2" = "--delete-after-install" ]; then
if dpkg -s "$package_name" >/dev/null 2>&1; then if dpkg -s "$package_name" >/dev/null 2>&1; then
echo "软件包已安装:$package_name" echo "软件包已安装:$package_name"
create_desktop_file create_desktop_file
unlock_file $DEBPATH
rm "$DEBPATH" rm "$DEBPATH"
echo "${TRANSHELL_CONTENT_DEB_IS_DELETED}" echo "${TRANSHELL_CONTENT_DEB_IS_DELETED}"
else else

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
SPARK_DOWNLOAD_SERVER_URL="https://d.spark-app.store/"
SPARK_DOWNLOAD_SERVER_URL_NO_PROTOCOL="d.spark-app.store"
source /opt/durapps/spark-store/bin/bashimport/transhell.amber source /opt/durapps/spark-store/bin/bashimport/transhell.amber
load_transhell_debug load_transhell_debug
@ -61,15 +62,15 @@ function zenity() {
} }
function hash_check() { function hash_check() {
if [ ! -e "/var/lib/aptss/lists/d.spark-app.store_${STORE_URL}_Packages" ] && \ if [ ! -e "/var/lib/aptss/lists/${SPARK_DOWNLOAD_SERVER_URL_NO_PROTOCOL}_${STORE_URL}_Packages" ] && \
[ ! -e "/var/lib/aptss/lists/d.store.deepinos.org.cn_${STORE_URL}_Packages" ] && \ [ ! -e "/var/lib/aptss/lists/d.store.deepinos.org.cn_${STORE_URL}_Packages" ] && \
[ ! -e "/var/lib/aptss/lists/mirrors.sdu.edu.cn_spark-store_${STORE_URL}_Packages" ]; then [ ! -e "/var/lib/aptss/lists/mirrors.sdu.edu.cn_spark-store_${STORE_URL}_Packages" ]; then
echo "接收星火仓库软件信息中..." echo "接收星火仓库软件信息中..."
aptss ssupdate aptss ssupdate
fi fi
if [ -e "/var/lib/aptss/lists/d.spark-app.store_${STORE_URL}_Packages" ]; then if [ -e "/var/lib/aptss/lists/${SPARK_DOWNLOAD_SERVER_URL_NO_PROTOCOL}_${STORE_URL}_Packages" ]; then
PACKAGES_DATA_PATH="/var/lib/aptss/lists/d.spark-app.store_${STORE_URL}_Packages" PACKAGES_DATA_PATH="/var/lib/aptss/lists/${SPARK_DOWNLOAD_SERVER_URL_NO_PROTOCOL}_${STORE_URL}_Packages"
echo "星火仓库的Packages位置为 $PACKAGES_DATA_PATH是星火域名仓库配置" echo "星火仓库的Packages位置为 $PACKAGES_DATA_PATH是星火域名仓库配置"
elif [ -e "/var/lib/aptss/lists/d.store.deepinos.org.cn_${STORE_URL}_Packages" ]; then elif [ -e "/var/lib/aptss/lists/d.store.deepinos.org.cn_${STORE_URL}_Packages" ]; then
PACKAGES_DATA_PATH="/var/lib/aptss/lists/d.store.deepinos.org.cn_${STORE_URL}_Packages" PACKAGES_DATA_PATH="/var/lib/aptss/lists/d.store.deepinos.org.cn_${STORE_URL}_Packages"
@ -183,7 +184,7 @@ if [ ! -z "$IS_SHA512SUM_CHECKED" ]; then
echo "Package name is $package_name" echo "Package name is $package_name"
try_run_output=$(/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh test-install-app "$DEBPATH") try_run_output=$(/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh test-install-app "$DEBPATH")
try_run_ret="$?" try_run_ret="$?"
# 安装失败后进行 aptss update 刷新,随后尝试在主机安装 # 安装失败后进行 aptss 刷新,随后尝试在主机安装
if [ "$try_run_ret" -ne 0 ]; then if [ "$try_run_ret" -ne 0 ]; then
aptss update aptss update
try_run_output=$(/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh test-install-app "$DEBPATH") try_run_output=$(/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh test-install-app "$DEBPATH")
@ -191,45 +192,74 @@ if [ ! -z "$IS_SHA512SUM_CHECKED" ]; then
fi fi
if [ "$try_run_ret" -ne 0 ]; then ## 若安装检测仍然失败 if [ "$try_run_ret" -ne 0 ]; then ## 若安装检测仍然失败
if [[ "$IS_ACE_ENV" == "" ]];then ## 如果未在ACE环境中
# 定义按顺序尝试的ACE环境命令:推荐安装包)
declare -a ace_commands_order=(
"bookworm-run:amber-ce-bookworm"
"trixie-run:amber-ce-trixie"
"deepin23-run:amber-ce-deepin23"
)
if [[ "$IS_ACE_ENV" == "" ]];then ## 如果已经在ACE里面则不进入分支 success=false
recommendation_msg=""
# 收集所有推荐信息
for ace_entry in "${ace_commands_order[@]}"; do
recommendation_msg+="您可安装 ${ace_entry%%:*} 兼容环境后重试: ${ace_entry#*:}\n"
done
if command -v bookworm-run ;then ## 如果 bookworm-run 可用则进行安装 # 按顺序尝试每个ACE环境
for ace_entry in "${ace_commands_order[@]}"; do
ace_cmd=${ace_entry%%:*}
if command -v "$ace_cmd" >/dev/null 2>&1; then
echo "----------------------------------------" echo "----------------------------------------"
echo "Attention: USING ACE BOOKWORM TO INSTALL" echo "正在尝试使用 $ace_cmd 环境安装..."
echo "----------------------------------------" echo "----------------------------------------"
bookworm-run ensure_aptss_exist
try_run_output=$(bookworm-run aptss install --dry-run "$DEBPATH") # 在ACE环境中执行安装检测
$ace_cmd ensure_aptss_exist
try_run_output=$($ace_cmd aptss install --dry-run "$DEBPATH" 2>&1)
try_run_ret="$?" try_run_ret="$?"
# 如果首次检测失败则更新后重试
if [ "$try_run_ret" -ne 0 ]; then if [ "$try_run_ret" -ne 0 ]; then
bookworm-run aptss update $ace_cmd aptss update
try_run_output=$(bookworm-run aptss install --dry-run "$DEBPATH") try_run_output=$($ace_cmd aptss install --dry-run "$DEBPATH" 2>&1)
try_run_ret="$?" try_run_ret="$?"
fi fi
if [ "$try_run_ret" -ne 0 ]; then
echo "OMG-IT-GOES-WRONG" # 最终检测结果处理
if [ "$try_run_ret" -eq 0 ]; then
echo "----------------------------------------"
echo "在 $ace_cmd 环境中预检成功,开始安装..."
echo "----------------------------------------"
$ace_cmd 'dpkg -i "$DEBPATH" || aptss install "$DEBPATH" -yf'
success=true
break # 跳出循环
else
echo "----------------------------------------"
echo "在 $ace_cmd 环境中安装预检失败,错误信息:"
echo -e "${try_run_output}" echo -e "${try_run_output}"
echo "----------------------------------------" echo "----------------------------------------"
echo "Attention: USING ACE BOOKWORM TO INSTALL"
echo "----------------------------------------"
exit "$try_run_ret"
fi fi
bookworm-run 'dpkg -i "$DEBPATH" || aptss install "$DEBPATH" -yf '
fi fi
done
else # 如果在主机安装失败且未安装ACE报错退出并推荐安装 ACE if ! $success; then
echo "OMG-IT-GOES-WRONG" echo "OMG-IT-GOES-WRONG"
echo -e "${try_run_output}" echo -e "${try_run_output}"
echo "您可在商店安装 ACE Bookworm 兼容环境后重试安装 https://bbs.deepin.org.cn/post/285056 " echo -e "所有ACE环境尝试失败推荐安装以下任一兼容环境:\n${recommendation_msg}"
exit "$try_run_ret" exit "$try_run_ret"
fi fi
else ## 如果主机安装检测成功了,进入主机安装分支 else # 已经在ACE环境中仍失败直接退出
echo "OMG-IT-GOES-WRONG"
echo -e "${try_run_output}"
exit "$try_run_ret"
fi
else ## 如果主机安装检测成功
dpkg -i "$DEBPATH" || aptss install "$DEBPATH" -yf dpkg -i "$DEBPATH" || aptss install "$DEBPATH" -yf
fi fi
### 退出阶段
### 退出阶段保持不变 ###
if [ "$?" = "0" ] && [ "$2" = "--delete-after-install" ]; then if [ "$?" = "0" ] && [ "$2" = "--delete-after-install" ]; then
if dpkg -s "$package_name" >/dev/null 2>&1; then if dpkg -s "$package_name" >/dev/null 2>&1; then
echo "软件包已安装:$package_name" echo "软件包已安装:$package_name"