mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-09-04 02:12:21 +08:00
fix:更新和检查更新出错时不报错
This commit is contained in:
parent
0aeadb5526
commit
5411a832dc
@ -64,11 +64,10 @@ mkdir -p /tmp/aptss-conf/
|
||||
echo "从服务器获取配置和镜像列表..."
|
||||
echo "Getting server and mirror lists..."
|
||||
echo
|
||||
curl --progress-bar -o /tmp/aptss-conf/apt-fast.conf "https://gitee.com/deepin-community-store/repo_auto_update_script/raw/master/mirror-list-for-apt-fast/apt-fast.conf"
|
||||
curl --silent -o /tmp/aptss-conf/apt-fast.conf "https://gitee.com/deepin-community-store/repo_auto_update_script/raw/master/mirror-list-for-apt-fast/apt-fast.conf"
|
||||
chmod -R 755 /tmp/aptss-conf
|
||||
|
||||
sudo curl --progress-bar -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "https://gitee.com/deepin-community-store/repo_auto_update_script/raw/master/mirror-list-for-apt-fast/sources.list.d/sparkstore.list"
|
||||
### 额外一份拿来给aptss自动补全用
|
||||
sudo curl --silent -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "https://gitee.com/deepin-community-store/repo_auto_update_script/raw/master/mirror-list-for-apt-fast/sources.list.d/sparkstore.list"
|
||||
sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt update -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
|
||||
|
||||
#只更新星火源
|
||||
|
@ -7,12 +7,20 @@ fi
|
||||
|
||||
case $1 in
|
||||
ssupdate)
|
||||
aptss ssupdate
|
||||
aptss ssupdate 2>&1 | tee /tmp/spark-store-app-ssupdate-log.txt
|
||||
IS_SSUPDATE_ERROR=`cat /tmp/spark-store-app-ssupdate-log.txt | grep "E: "`
|
||||
echo "$IS_SSUPDATE_ERROR" > /tmp/spark-store-app-ssupdate-status.txt
|
||||
;;
|
||||
upgradable-list)
|
||||
bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt list --upgradable -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" | awk 'BEGIN {FS="/"} {print $1}' | awk NR\>1
|
||||
;;
|
||||
upgrade-app)
|
||||
aptss install "${@:2}" --only-upgrade
|
||||
aptss install "${@:2}" --only-upgrade 2>&1 | tee /tmp/spark-store-app-upgrade-log.txt
|
||||
IS_UPGRADE_ERROR=`cat /tmp/spark-store-app-upgrade-log.txt | grep "Package manager quit with exit code."`
|
||||
echo "$IS_UPGRADE_ERROR" > /tmp/spark-store-app-upgrade-status.txt
|
||||
;;
|
||||
|
||||
esac
|
||||
clean-log)
|
||||
rm -f /tmp/spark-store-app-ssupdate-status.txt /tmp/spark-store-app-ssupdate-log.txt /tmp/spark-store-app-upgrade-log.txt /tmp/spark-store-app-upgrade-status.txt
|
||||
;;
|
||||
esac
|
||||
|
@ -1,7 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
pkexec /opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh ssupdate | zenity --progress --auto-close --no-cancel --pulsate --text="正在检查更新,请稍候..." --height 70 --width 400 --title="星火商店更新模块"
|
||||
pkexec /opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh ssupdate | zenity --progress --auto-close --pulsate --no-cancel --text="正在检查更新,请稍候..." --height 70 --width 400 --title="星火商店更新模块"
|
||||
|
||||
if [ -z `cat /tmp/spark-store-app-ssupdate-status.txt` != "0" ];then
|
||||
echo "无错误"
|
||||
else
|
||||
zenity --error --text "检查更新进程出现错误!按确定查看报错,可用于反馈" --title "星火商店更新检测服务" --height 200 --width 350
|
||||
zenity --text-info --filename=/tmp/spark-store-app-ssupdate-log.txt --checkbox="我已复制了此文本框中的日志,且将会在反馈时附上 。反馈渠道可以在右上角菜单的设置中找到" --title="反馈渠道在商店右上角的设置里"
|
||||
pkexec /opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh clean-log
|
||||
exit
|
||||
fi
|
||||
pkexec /opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh clean-log
|
||||
|
||||
PKG_LIST="$(pkexec /opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh upgradable-list)"
|
||||
####如果没更新,就弹出不需要更新
|
||||
if [ -z "$PKG_LIST" ];then
|
||||
@ -12,12 +23,14 @@ do
|
||||
#### 检测是否是hold状态
|
||||
if [ "$(dpkg-query -W -f='${Status}' $PKG_NAME | grep hold)" = "" ];then
|
||||
echo "true"
|
||||
echo "$PKG_NAME"
|
||||
echo "$PKG_NAME"
|
||||
else
|
||||
echo "false"
|
||||
echo "$PKG_NAME (无法更新:已被标记为保留)"
|
||||
echo "$PKG_NAME(无法更新:已被标记为保留)"
|
||||
echo "$PKG_NAME"
|
||||
fi
|
||||
done | zenity --list --text="选择你想更新的应用" --column=是否更新 --column=应用包名 --separator=" " --checklist --print-column=2 --multiple --height 350 --width 550 `
|
||||
done | zenity --list --text="选择你想更新的应用" --column=是否更新 --column=应用包名 --column="真的应用包名" --separator=" " --checklist --print-column=3 --multiple --height 350 --width 550 --hide-column=3`
|
||||
|
||||
#### 如果没有选择,则直接退出
|
||||
|
||||
@ -27,14 +40,17 @@ else
|
||||
|
||||
pkexec /opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh upgrade-app $PKG_UPGRADE_LIST -y | zenity --progress --auto-close --no-cancel --pulsate --text=正在更新已选中的应用,请稍候... --height 70 --width 400 --title="星火商店更新模块"
|
||||
|
||||
if [ "$?" = "0" ];then
|
||||
if [ -z "`cat /tmp/spark-store-app-upgrade-status.txt`" ];then
|
||||
|
||||
zenity --info --icon-name=spark-store --text "已选中的软件已经更新完毕" --title "星火商店更新检测服务" --height 150 --width 300
|
||||
else
|
||||
zenity --error --text "更新出现错误!请手动执行 sudo aptss full-upgrade 查看问题" --title "星火商店更新检测服务" --height 150 --width 300
|
||||
zenity --error --text "更新出现错误!按确定查看报错,可用于反馈" --title "星火商店更新检测服务" --height 200 --width 350
|
||||
zenity --text-info --filename=/tmp/spark-store-app-upgrade-log.txt --checkbox="我已复制了此文本框中的日志,且将会在反馈时附上 。反馈渠道可以在右上角菜单的设置中找到" --title="反馈渠道在商店右上角的设置里"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
fi
|
||||
|
||||
fi
|
||||
####从最开头
|
||||
####从最开头
|
||||
|
Loading…
x
Reference in New Issue
Block a user