Merge pull request !141 from shenmo/dev
This commit is contained in:
2022-10-27 16:58:38 +00:00
committed by Gitee
10 changed files with 86 additions and 27 deletions

20
debian/changelog vendored
View File

@@ -1,3 +1,23 @@
spark-store (3.3.3~test2) stable; urgency=medium
* bug fix: 更新和检查更新出错时不报错.此更新需要一个推送
-- shenmo <shenmo@spark-app.store> Fri, 30 Jan 2022 00:00:00 +0800
spark-store (3.3.3~test1) stable; urgency=medium
* 3.3.3将会是修复大部分bug后的最终版本
* 图形环境中所有root权限的组件剥离到cli(可用于deepin 23 daily只保证商店本体正常运作不处理安装依赖不满足)
* 文案更改:更新检查-->检查更新
-- shenmo <shenmo@spark-app.store> Fri, 30 Jan 2022 00:00:00 +0800
spark-store (3.3.1~test1) stable; urgency=medium
* 安装时不再需要联网
-- shenmo <shenmo@spark-app.store> Fri, 30 Jan 2022 00:00:00 +0800
spark-store (3.3.0.4) stable; urgency=medium spark-store (3.3.0.4) stable; urgency=medium
* 为减轻服务器压力,不再单独更新某一个应用,而是作为整体更新 * 为减轻服务器压力,不再单独更新某一个应用,而是作为整体更新

View File

@@ -30,7 +30,7 @@ case "$1" in
gcc /opt/durapps/spark-store/bin/ss-feedback/sender-d.sh.c -o /opt/durapps/spark-store/bin/ss-feedback/sender-d gcc /opt/durapps/spark-store/bin/ss-feedback/sender-d.sh.c -o /opt/durapps/spark-store/bin/ss-feedback/sender-d
# Download and install key # Install key
mkdir -p /tmp/spark-store-install/ mkdir -p /tmp/spark-store-install/
cp -f /opt/durapps/spark-store/bin/spark-store.asc /tmp/spark-store-install/spark-store.asc cp -f /opt/durapps/spark-store/bin/spark-store.asc /tmp/spark-store-install/spark-store.asc
gpg --dearmor /tmp/spark-store-install/spark-store.asc gpg --dearmor /tmp/spark-store-install/spark-store.asc
@@ -39,8 +39,8 @@ case "$1" in
# Run apt update to avoid users being fucked up by the non-exist dependency problem # Run apt update to avoid users being fucked up by the non-exist dependency problem
# Now abandoned as aptss now run ssupdate everytime
aptss ssupdate #aptss ssupdate
# Start upgrade detect service # Start upgrade detect service

View File

@@ -24,4 +24,5 @@ function network-check()
} }
network-check #network-check
echo "不再检测网络"

View File

@@ -4,15 +4,15 @@
<policyconfig> <policyconfig>
<vendor>Spark Store</vendor> <vendor>Spark Store</vendor>
<icon_name>x-package-repository</icon_name> <icon_name>x-package-repository</icon_name>
<action id="store.spark-app.ss-do-upgrade"> <action id="store.spark-app.ss-do-upgrade-worker">
<description>运行ss-do-upgrade需要权限</description> <description>运行ss-do-upgrade-worker需要权限</description>
<message>要使用ss-do-upgrade需要权限</message> <message>要使用ss-do-upgrade-worker需要权限</message>
<defaults> <defaults>
<allow_any>yes</allow_any> <allow_any>yes</allow_any>
<allow_inactive>yes</allow_inactive> <allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active> <allow_active>yes</allow_active>
</defaults> </defaults>
<annotate key="org.freedesktop.policykit.exec.path">/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade.sh</annotate> <annotate key="org.freedesktop.policykit.exec.path">/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate> <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
</action> </action>
</policyconfig> </policyconfig>

View File

@@ -36,7 +36,7 @@ desktop.path = /usr/share/applications
service.files += pkg/usr/lib/systemd/system/spark-update-notifier.service service.files += pkg/usr/lib/systemd/system/spark-update-notifier.service
service.path = /usr/lib/systemd/system/ service.path = /usr/lib/systemd/system/
polkit-1.files +=pkg/usr/share/polkit-1/actions/store.spark-app.ss-do-upgrade.policy polkit-1.files +=pkg/usr/share/polkit-1/actions/store.spark-app.ss-do-upgrade-worker.policy
polkit-1.path = /usr/share/polkit-1/actions/ polkit-1.path = /usr/share/polkit-1/actions/

View File

@@ -37,7 +37,7 @@ int main(int argc, char *argv[])
DAboutDialog dialog; DAboutDialog dialog;
a.setAboutDialog(&dialog); a.setAboutDialog(&dialog);
dialog.setLicense(QObject::tr("We publish this program under GPL V3")); dialog.setLicense(QObject::tr("We publish this program under GPL V3"));
dialog.setVersion(DApplication::buildVersion("Version 3.3.0.4")); dialog.setVersion(DApplication::buildVersion("Version 3.3.3~test2"));
dialog.setProductIcon(QIcon::fromTheme("spark-store")); // 设置Logo dialog.setProductIcon(QIcon::fromTheme("spark-store")); // 设置Logo
dialog.setProductName(QLabel::tr("Spark Store")); dialog.setProductName(QLabel::tr("Spark Store"));
dialog.setDescription( dialog.setDescription(
@@ -58,7 +58,7 @@ int main(int argc, char *argv[])
a.setOrganizationName("spark-union"); a.setOrganizationName("spark-union");
a.setOrganizationDomain("https://www.deepinos.org/"); a.setOrganizationDomain("https://www.deepinos.org/");
a.setApplicationName("Spark Store"); //不需要翻译,否则 ~/.local/share/ 下文件夹名称也被翻译为中文 a.setApplicationName("Spark Store"); //不需要翻译,否则 ~/.local/share/ 下文件夹名称也被翻译为中文
a.setApplicationVersion(DApplication::buildVersion("3.3.0.4")); a.setApplicationVersion(DApplication::buildVersion("3.3.3~test2"));
a.setApplicationAcknowledgementPage("https://gitee.com/deepin-community-store/spark-store"); a.setApplicationAcknowledgementPage("https://gitee.com/deepin-community-store/spark-store");
a.setApplicationDescription( a.setApplicationDescription(
QObject::tr( QObject::tr(

View File

@@ -64,11 +64,10 @@ mkdir -p /tmp/aptss-conf/
echo "从服务器获取配置和镜像列表..." echo "从服务器获取配置和镜像列表..."
echo "Getting server and mirror lists..." echo "Getting server and mirror lists..."
echo 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 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" 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"
### 额外一份拿来给aptss自动补全用
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" 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"
#只更新星火源 #只更新星火源

View File

@@ -0,0 +1,26 @@
#!/bin/bash
if [ "$(id -u)" != "0" ];then
pkexec "$0" "$@"
exit
fi
case $1 in
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 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
;;
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

View File

@@ -1,11 +1,19 @@
#!/bin/bash #!/bin/bash
if [ "$(id -u)" != "0" ];then
pkexec $0
exit
fi
bash aptss ssupdate | zenity --progress --auto-close --no-cancel --pulsate --text=正在更新检查,请稍候... --height 70 --width 400 --title="星火商店更新模块"
PKG_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)" 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 if [ -z "$PKG_LIST" ];then
zenity --info --icon-name=spark-store --text "没有软件需要更新\n但是你并没有站在世界之巅" --title "星火商店更新检测服务" --height 150 --width 300 zenity --info --icon-name=spark-store --text "没有软件需要更新\n但是你并没有站在世界之巅" --title "星火商店更新检测服务" --height 150 --width 300
@@ -15,12 +23,14 @@ do
#### 检测是否是hold状态 #### 检测是否是hold状态
if [ "$(dpkg-query -W -f='${Status}' $PKG_NAME | grep hold)" = "" ];then if [ "$(dpkg-query -W -f='${Status}' $PKG_NAME | grep hold)" = "" ];then
echo "true" echo "true"
echo "$PKG_NAME"
echo "$PKG_NAME" echo "$PKG_NAME"
else else
echo "false" echo "false"
echo "$PKG_NAME (无法更新:已被标记为保留)" echo "$PKG_NAME无法更新:已被标记为保留"
echo "$PKG_NAME"
fi 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`
#### 如果没有选择,则直接退出 #### 如果没有选择,则直接退出
@@ -28,16 +38,19 @@ if [ "$PKG_UPGRADE_LIST" = "" ];then
zenity --info --icon-name=spark-store --text "没有选中任何软件\n但是你并没有站在世界之巅" --title "星火商店更新检测服务" --height 150 --width 300 zenity --info --icon-name=spark-store --text "没有选中任何软件\n但是你并没有站在世界之巅" --title "星火商店更新检测服务" --height 150 --width 300
else else
bash aptss install $PKG_UPGRADE_LIST -y | 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 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 zenity --info --icon-name=spark-store --text "已选中的软件已经更新完毕" --title "星火商店更新检测服务" --height 150 --width 300
else 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 fi
fi fi
####从最开头 ####从最开头

View File

@@ -19,7 +19,7 @@ function notify-send() {
function network() function network()
{ {
#超时时间 #超时时间
local timeout=5 local timeout=15
#目标网站 #目标网站
local target=www.baidu.com local target=www.baidu.com