默认免密码查看可更新应用

This commit is contained in:
shenmo 2022-10-21 14:56:31 +08:00
parent 8465c9ad2d
commit 5420bad0ee
7 changed files with 32 additions and 7 deletions

6
debian/changelog vendored

@ -1,3 +1,9 @@
spark-store (3.3~test3) stable; urgency=medium
* 把检查更新加入免密码
-- shenmo <shenmo@spark-app.store> Fri, 30 Jan 2022 00:00:00 +0800
spark-store (3.3~test2) stable; urgency=medium
* 更新检测功能全部更改到zenity

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>
<vendor>Spark Store</vendor>
<icon_name>x-package-repository</icon_name>
<action id="store.spark-app.ss-do-upgrade">
<description>运行ss-do-upgrade需要权限</description>
<message>要使用ss-do-upgrade需要权限</message>
<defaults>
<allow_any>yes</allow_any>
<allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active>
</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.allow_gui">true</annotate>
</action>
</policyconfig>

@ -36,7 +36,7 @@ desktop.path = /usr/share/applications
service.files += pkg/usr/lib/systemd/system/spark-update-notifier.service
service.path = /usr/lib/systemd/system/
polkit-1.files +=pkg/usr/share/polkit-1/actions/store.spark-app.ssinstall.policy
polkit-1.files +=pkg/usr/share/polkit-1/actions/store.spark-app.ss-do-upgrade.policy
polkit-1.path = /usr/share/polkit-1/actions/
@ -55,6 +55,6 @@ INSTALLS += \
preferences \
tmp \
service \
bash_completion
# polkit-1
bash_completion \
polkit-1
# 暂时不添加

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

@ -4,7 +4,7 @@
<policyconfig>
<vendor>Spark Store</vendor>
<icon_name>x-package-repository</icon_name>
<action id="org.maicss.dnf">
<action id="store.spark-app.ssinstall">
<description>运行ssinstall需要权限</description>
<message>要使用ssinstall需要权限</message>
<defaults>

@ -1,3 +1,4 @@
#!/bin/bash
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)"
####如果没更新,就弹出不需要更新
if [ -z "$PKG_LIST" ];then

@ -40,7 +40,7 @@ case $option in
;;
2)
pkexec bash /opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade.sh
pkexec /opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade.sh
;;
3)
if [ -f /usr/share/polkit-1/actions/store.spark-app.ssinstall.policy ];then