From 873a83e6b9bd80e997efc2c13d262cf0ea6143ff Mon Sep 17 00:00:00 2001 From: shenmo Date: Mon, 25 Apr 2022 13:34:25 +0800 Subject: [PATCH] =?UTF-8?q?=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20=20=20de?= =?UTF-8?q?bian/changelog=20=09=E6=96=B0=E6=96=87=E4=BB=B6=EF=BC=9A=20=20?= =?UTF-8?q?=20pkg/usr/share/polkit-1/actions/store.spark-app.ssinstall.pol?= =?UTF-8?q?icy=20=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20=20=20spark-store-?= =?UTF-8?q?project.pro=20=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20=20=20src/?= =?UTF-8?q?main.cpp=20=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20=20=20tool/ss?= =?UTF-8?q?install?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 9 +++++++++ .../actions/store.spark-app.ssinstall.policy | 18 +++++++++++++++++ spark-store-project.pro | 3 +++ src/main.cpp | 4 ++-- tool/ssinstall | 20 ++++++++++++++++++- 5 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 pkg/usr/share/polkit-1/actions/store.spark-app.ssinstall.policy diff --git a/debian/changelog b/debian/changelog index f606c07..fe908e3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +spark-store (3.0.3-14) stable; urgency=medium + + * Add pkexec policy: ssinstall + * Modify ssinistall script: Now will refuse run when no args are given or not run as root. + + -- shenmo Mon, 17 Jan 2022 00:00:00 +0800 + + + spark-store (3.0.3-13) stable; urgency=medium * Update the ssinstall script. Now support apt-fast and will temporarily increase the spark store source priority to 500 to make depends install correctly diff --git a/pkg/usr/share/polkit-1/actions/store.spark-app.ssinstall.policy b/pkg/usr/share/polkit-1/actions/store.spark-app.ssinstall.policy new file mode 100644 index 0000000..8bdc819 --- /dev/null +++ b/pkg/usr/share/polkit-1/actions/store.spark-app.ssinstall.policy @@ -0,0 +1,18 @@ + + + + Spark Store + x-package-repository + + 运行ssinstall需要权限 + 要使用ssinstall需要权限 + + yes + yes + yes + + /usr/local/bin/ssinstall + true + + diff --git a/spark-store-project.pro b/spark-store-project.pro index 6a23d9f..3c0945a 100644 --- a/spark-store-project.pro +++ b/spark-store-project.pro @@ -33,6 +33,9 @@ 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.path = /usr/share/polkit-1/actions/ + icon.files += pkg/usr/share/icons/hicolor/scalable/apps/spark-store.svg icon.path = /usr/share/icons/hicolor/scalable/apps diff --git a/src/main.cpp b/src/main.cpp index d2bdfba..affd38d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -30,7 +30,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.0.3-13")); + dialog.setVersion(DApplication::buildVersion("Version 3.0.3-14")); dialog.setProductIcon(QIcon::fromTheme("spark-store")); // 设置Logo dialog.setProductName(QLabel::tr("Spark Store")); dialog.setDescription( @@ -51,7 +51,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.0.3-13")); + a.setApplicationVersion(DApplication::buildVersion("3.0.3-14")); a.setApplicationAcknowledgementPage("https://gitee.com/deepin-community-store/spark-store"); a.setApplicationDescription( QObject::tr( diff --git a/tool/ssinstall b/tool/ssinstall index 68bf34e..52bf1f7 100755 --- a/tool/ssinstall +++ b/tool/ssinstall @@ -3,6 +3,24 @@ echo "Spark Store Install script.星火商店安装脚本" +if [ $# -eq 0 ];then +echo "没有接收到参数,退出" +echo "用法:$0 deb路径" +exit +fi + +if [ "$(id -u)" != "0" ] +then + echo "ssinstall需要在root下运行"; + exit +fi + +if [ ! -f "$1" ] +then + echo "文件不存在" + exit +fi + DEPEND=`which apt-fast` isuos=`cat /etc/os-release | grep UnionTech` #临时提升星火源的优先级 @@ -30,4 +48,4 @@ dpkg -i $1 || apt-fast install -yf || dpkg -P $1 fi sed -i 's/500/400/g' /etc/apt/preferences.d/sparkstore -#恢复优先级 \ No newline at end of file +#恢复优先级