mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-13 12:22:05 +08:00
zenity 不再以root启动
This commit is contained in:
7
debian/changelog
vendored
7
debian/changelog
vendored
@@ -1,3 +1,10 @@
|
|||||||
|
spark-store (3.3.3~test1) stable; urgency=medium
|
||||||
|
|
||||||
|
* 3.3.3将会是修复大部分bug后的最终版本
|
||||||
|
* 图形环境中所有root权限的组件剥离到cli
|
||||||
|
|
||||||
|
-- shenmo <shenmo@spark-app.store> Fri, 30 Jan 2022 00:00:00 +0800
|
||||||
|
|
||||||
spark-store (3.3.1~test1) stable; urgency=medium
|
spark-store (3.3.1~test1) stable; urgency=medium
|
||||||
|
|
||||||
* 安装时不再需要联网
|
* 安装时不再需要联网
|
||||||
|
|||||||
@@ -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>
|
||||||
18
tool/update-upgrade/ss-do-upgrade-worker.sh
Executable file
18
tool/update-upgrade/ss-do-upgrade-worker.sh
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
if [ "$(id -u)" != "0" ];then
|
||||||
|
pkexec "$0" "$@"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
ssupdate)
|
||||||
|
aptss ssupdate
|
||||||
|
;;
|
||||||
|
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
|
||||||
|
|
||||||
|
esac
|
||||||
@@ -1,11 +1,8 @@
|
|||||||
#!/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 --no-cancel --pulsate --text=正在更新检查,请稍候... --height 70 --width 400 --title="星火商店更新模块"
|
||||||
|
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
|
||||||
@@ -28,7 +25,7 @@ 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 [ "$?" = "0" ];then
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user