Compare commits
103 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 88a157dd45 | |||
| 34b8670a40 | |||
| d5b2d4ddf4 | |||
| 01bb90879b | |||
| 1c64278723 | |||
| 17c90c5d07 | |||
| 539607553d | |||
| 85daec6428 | |||
| e38d23dba0 | |||
| 9593ebb813 | |||
| fd1f13f59d | |||
| c5b5b6d3ba | |||
| ef4b21fb8c | |||
| 72e3d54f8d | |||
| 50fd18fbe4 | |||
| e98def4839 | |||
| da65d3b90e | |||
| 33c892b39d | |||
| ca6e47e9a3 | |||
| 0ca73a2a28 | |||
| 9493f0738a | |||
| 688ed679b5 | |||
| 233b5e8c76 | |||
| 4fc8ef3f48 | |||
| cd4f104e1a | |||
| 9b92894e4f | |||
| 05a5b89464 | |||
| fb6446292c | |||
| 5bc65827b2 | |||
| c0b2edf1b0 | |||
| f08366a3d5 | |||
| 8cb92d9972 | |||
| 6640dc9bba | |||
| 3c2a6ac635 | |||
| ea6e7a19bd | |||
| 930111f2df | |||
| b708b63113 | |||
| 74cc0fbce9 | |||
| bbc4d27d7a | |||
| dc28c2e9d1 | |||
| b4935edf0a | |||
| 4f294cee8f | |||
| 45c52d7755 | |||
| 90ad08a6f9 | |||
| 819e680222 | |||
| 6697bd04f1 | |||
| 2a6e9046e7 | |||
| 460d965ac1 | |||
| 2b929f8a06 | |||
| f2cafe0567 | |||
| 564966daef | |||
| 668e5dc28d | |||
| 7ae592776d | |||
| 6f3980e6cb | |||
| e2a0079c6e | |||
| 73f84a2861 | |||
| 8218080f40 | |||
| 264b0ba8da | |||
| b114db583b | |||
| 832b53dfc9 | |||
| 244f58ecce | |||
| 470666cf41 | |||
| 4abfc19399 | |||
| e3e8684f18 | |||
|
|
c60399df0b | ||
|
|
9036140ceb | ||
|
|
da7e8ea9fc | ||
| a158966e2d | |||
| 105c7f3751 | |||
|
|
aa3f2fbce4 | ||
| 1ab8da0e1a | |||
| 072be29804 | |||
| 8e7aa445cf | |||
| f5faebe91e | |||
| 5bcf2ce4f5 | |||
| 992d1e7023 | |||
| 86f8a3b501 | |||
| 46a1daeafc | |||
| 0566d546df | |||
| b3eb13ada5 | |||
| 19bfd4031c | |||
| d2844b8b8a | |||
| f02c279c8a | |||
|
|
6fa0e11927 | ||
| f0830822c7 | |||
| 7c9b503b0e | |||
|
|
5a248859ec | ||
| f03e032a1b | |||
| 9657c13106 | |||
| a3355516cf | |||
|
|
eb88fc85c5 | ||
|
|
5dc0d52530 | ||
| c8cbaa9c8b | |||
| 11d7073905 | |||
| 5e55607dbf | |||
|
|
761f67f02c | ||
| 97755980bc | |||
| beaa19e9e5 | |||
| 8cfd219d67 | |||
| b153edf8dc | |||
| 90ed903197 | |||
| 4c59762086 | |||
| a49c35dbcb |
@@ -7,7 +7,7 @@ import json
|
||||
sha = os.getenv("GIT_COMMIT")
|
||||
# sha = '48fed26c51a8c42554e45f72f43e49703e04c97f'
|
||||
#get sha from environment
|
||||
url = "https://gitee.com/api/v5/repos/deepin-community-store/spark-store/commits/{}/comments".format(sha)
|
||||
url = "https://gitee.com/api/v5/repos/spark-store-project/spark-store/commits/{}/comments".format(sha)
|
||||
|
||||
token = os.getenv("gitee_token")
|
||||
|
||||
|
||||
2
.gitignore
vendored
@@ -53,4 +53,4 @@ debian/*.substvars
|
||||
debian/spark-store
|
||||
|
||||
.vscode/*
|
||||
src/spark-store
|
||||
obj-*
|
||||
|
||||
@@ -34,7 +34,7 @@ stages:
|
||||
- tar -xf DEBIANARM.tar.xz
|
||||
- mkdir -p DEBIAN/root/build-spark
|
||||
- mv ../spark-store-git DEBIAN/root/build-spark/spark-store
|
||||
- wget https://gitee.com/deepin-community-store/repo_auto_update_script/raw/master/spark-build-aarch64.sh && mv spark-build-aarch64.sh DEBIAN/root
|
||||
- wget https://gitee.com/spark-store-project/repo_auto_update_script/raw/master/spark-build-aarch64.sh && mv spark-build-aarch64.sh DEBIAN/root
|
||||
- mv /usr/bin/qemu-aarch64-static DEBIAN/
|
||||
- chroot DEBIAN /qemu-aarch64-static /bin/bash /root/spark-build-aarch64.sh
|
||||
- ''
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
`{SOURCE_URL}/{ARCH}/{CATOGARY}/applist.json`
|
||||
说明:SOURCE_URL:线路链接,目前推荐 https://cdn.d.store.deepinos.org.cn,你也可以使用其他的星火线路
|
||||
ARCH:架构文件夹 x86是store或amd64-store,arm是aarch64-store。特别的,如果你使用非https://cdn.d.store.deepinos.org.cn的线路,你可能会发现amd64-store会返回404,因为不是所有的服务器都支持软连接
|
||||
CATOGARY:分类目录。参考 https://gitee.com/deepin-community-store/spark-store/blob/dev/DOCS/spk-doc.md 中 store 直达的对应关系
|
||||
CATOGARY:分类目录。参考 https://gitee.com/spark-store-project/spark-store/blob/dev/DOCS/spk-doc.md 中 store 直达的对应关系
|
||||
|
||||
例子:https://cdn.d.store.deepinos.org.cn/aarch64-store/tools/applist.json
|
||||
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
|
||||
为方便使用(其实是早期屎山使然),请将仓库放置于 `/home/ftp/spark-store`
|
||||
|
||||
仓库管理相关代码请移步 [这里](https://gitee.com/deepin-community-store/repo_auto_update_script),update.sh请联系 @shenmo 获取
|
||||
仓库管理相关代码请移步 [这里](https://gitee.com/spark-store-project/repo_auto_update_script),update.sh请联系 @shenmo 获取
|
||||
6
FAQ.md
@@ -8,7 +8,7 @@ The Spark App Store is an application store aimed at Linux users and supports mu
|
||||
|
||||
### Communication and Feedback
|
||||
**Q: Where can I join the community group?**
|
||||
**A:** You can click [here](https://www.deepinos.org/) to enter the main communication platform of the Spark Store.
|
||||
**A:** You can click [here](https://bbs.spark-app.store/) to enter the main communication platform of the Spark Store.
|
||||
> ⚠️ If the above link doesn't work, you can also join our QQ groups as an alternative. The group numbers are 872690351 and 865927727. We also offer forums for communication.
|
||||
|
||||
#### Differences Between arm64 and amd64
|
||||
@@ -79,12 +79,12 @@ Linux:
|
||||
|
||||
### Reporting Issues and Removing Apps
|
||||
**Q: Some apps are outdated or inactive, and I want them removed**
|
||||
**A:** You can report issues [here](https://gitee.com/deepin-community-store/software_-issue).
|
||||
**A:** You can report issues [here](https://gitee.com/spark-store-project/software_-issue).
|
||||
|
||||
---
|
||||
|
||||
### Installing Spark App Store
|
||||
If you wish to install the Spark App Store, please visit the [Release page](https://gitee.com/deepin-community-store/spark-store/releases), find the latest version, and choose the package suitable for your current system.
|
||||
If you wish to install the Spark App Store, please visit the [Release page](https://gitee.com/spark-store-project/spark-store/releases), find the latest version, and choose the package suitable for your current system.
|
||||
|
||||
> ⚠️ Special Note: If you are using Debian10/Debian11 or Ubuntu 20.04, you may need to download additional dependency packages. After downloading, unzip multiple times until you see the software user guide. For operating systems later than Ubuntu 22.04, you do not need to install dependency packages. Just follow the steps above to install the main program directly.
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
### 交流与反馈
|
||||
**Q: 在哪进交流群?**
|
||||
**A:** 你可以点击[这里](https://www.deepinos.org/)进入星火商店的主交流平台。
|
||||
**A:** 你可以点击[这里](https://bbs.spark-app.store/)进入星火商店的主交流平台。
|
||||
> ⚠️ 如果上面的链接无法使用,你还可以加入我们的 QQ 群作为备选方案,群号是 872690351 和 865927727。我们还提供论坛作为交流平台。
|
||||
|
||||
arm64与amd64的区别
|
||||
@@ -78,12 +78,12 @@ Linux:
|
||||
|
||||
### 报告问题和应用下架
|
||||
**Q: 有些应用已经过时或者失效了,我想让他下架**
|
||||
**A:** 你可以前往 [这里](https://gitee.com/deepin-community-store/software_-issue) 报告问题。
|
||||
**A:** 你可以前往 [这里](https://gitee.com/spark-store-project/software_-issue) 报告问题。
|
||||
|
||||
---
|
||||
|
||||
### 安装星火应用商店
|
||||
如果你想安装星火应用商店,请打开[Release页面](https://gitee.com/deepin-community-store/spark-store/releases),找到最新版本,并选择适用于当前系统的安装包下载。
|
||||
如果你想安装星火应用商店,请打开[Release页面](https://gitee.com/spark-store-project/spark-store/releases),找到最新版本,并选择适用于当前系统的安装包下载。
|
||||
|
||||
> ⚠️ 特别提示: 如果你在使用 Debian10/Debian11 或 Ubuntu 20.04,你可能额外下载依赖补充包。您需要在下载完依赖包后,解压多次一直到看到内部的软件使用说明,对于 Ubuntu22.04 以后的操作系统版本,您无需安装依赖包,您需要按照上面的操作直接安装本体程序。
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ To improve this situation, we have launched this app store. We have broadly incl
|
||||
|
||||
We warmly welcome you to join our development team. Whether you want to participate in development or submit applications, you can find your place here to jointly promote the development of the Linux application ecosystem.
|
||||
|
||||
You can track our Issue handling status in real-time through the following link: [Gitee Issue Board](https://gitee.com/spark-store-project/spark-store/board).
|
||||
You can track our Issue handling status in real-time through the following link: [Issue Board](https://gitee.com/spark-store-project/spark-store/board).
|
||||
|
||||
If you have a software package you'd like to submit, please [click here to submit](https://upload.deepinos.org.cn/index).
|
||||
|
||||
@@ -152,13 +152,13 @@ You will see an output, and that's your system architecture.
|
||||
|
||||
Please refer to the [Spark App Store FAQ and Support Guide](https://gitee.com/spark-store-project/spark-store/blob/dev/FAQ.md).
|
||||
|
||||
You can also check the [Chinese version](https://gitee.com/spark-store-project/spark-store/blob/dev/FAQ.zh.md) here.
|
||||
To customly configure aptss, refer to [aptss](https://gitee.com/GXDE-OS/aptss)
|
||||
|
||||
---
|
||||
|
||||
## Contact and Feedback
|
||||
|
||||
- If you have any questions or suggestions, please submit them via email or on our [Gitee page](https://gitee.com/spark-store-project/spark-store/issues).
|
||||
- If you have any questions or suggestions, please submit them via email or on our [Issue Page](https://gitee.com/spark-store-project/spark-store/issues).
|
||||
- If you want to follow our development progress, you can go to the [Spark App Store Board](https://gitee.com/spark-store-project/spark-store/board) for more information.
|
||||
- Our [Forum](https://bbs.spark-app.store/)
|
||||
- Our [QQ Group](https://blog.shenmo.tech/post/%E6%95%85%E9%9A%9C%E5%85%AC%E5%91%8A/)
|
||||
|
||||
12
README.zh.md
@@ -1,6 +1,6 @@
|
||||
# 星火应用商店
|
||||
[](https://gitee.com/spark-store-project/spark-store/stargazers) [](https://gitee.com/spark-store-project/spark-store/members)
|
||||
|
||||

|
||||
|
||||
|
||||
## 简介
|
||||
@@ -39,7 +39,7 @@ https://github.com/spark-store-project/spark-store
|
||||
|
||||
我们热忱欢迎您加入我们的开发团队。无论您是想参与开发,还是想提交应用,都能在这里找到属于您的一席之地,共同推动Linux应用生态的发展。
|
||||
|
||||
您可以通过以下链接,实时跟踪我们的Issue处理状态:[Gitee Issue看板](https://gitee.com/spark-store-project/spark-store/board)。
|
||||
您可以通过以下链接,实时跟踪我们的Issue处理状态:[Issue看板](https://gitee.com/spark-store-project/spark-store/board)。
|
||||
|
||||
若您有软件包想要提交,敬请 [点击此处进行投稿](https://wiki.spark-app.store/#/Submit/Submit)。
|
||||
|
||||
@@ -171,15 +171,17 @@ https://github.com/spark-store-project/spark-store
|
||||
|
||||
## 常见问题(FAQ)
|
||||
|
||||
请参见[星火应用商店FAQ与支持指南](https://gitee.com/spark-store-project/spark-store/blob/dev/FAQ.md)。
|
||||
请参见[星火应用商店FAQ与支持指南](https://gitee.com/spark-store-project/spark-store/blob/dev/FAQ.zh.md)。
|
||||
|
||||
自定义配置 aptss config 请参阅 [aptss](https://gitee.com/GXDE-OS/aptss)
|
||||
|
||||
|
||||
在这里可以查阅[中文版本](https://gitee.com/spark-store-project/spark-store/blob/dev/FAQ.zh.md)。
|
||||
|
||||
---
|
||||
|
||||
## 联系与反馈
|
||||
|
||||
- 如果您有任何问题或建议,请通过邮件或在[Gitee页面](https://gitee.com/spark-store-project/spark-store/issues)上提交问题。
|
||||
- 如果您有任何问题或建议,请通过邮件或在[Issue 页面](https://gitee.com/spark-store-project/spark-store/issues)上提交问题。
|
||||
- 如果你想关注我们的开发进度,可以跳转[星火应用商店Board](https://gitee.com/spark-store-project/spark-store/board)获取更多信息。
|
||||
- 我们的[论坛](https://bbs.spark-app.store/)
|
||||
- 我们的QQ群 872690351
|
||||
|
||||
48
debian/changelog
vendored
@@ -1,3 +1,37 @@
|
||||
spark-store (4.8.0) UNRELEASED; urgency=medium
|
||||
|
||||
* ssinstall重写,支持安装到ACE和自动安装到ACE,支持只允许安装到本地
|
||||
* 商店支持展示ACE标识,支持识别 native amber-ce-bookworm amber-ce-trixie amber-ce-sid amber-ce-deepin23
|
||||
* 投稿器支持新版spec
|
||||
|
||||
-- shenmo <shenmo@spark-app.store> Tue, 24 Sep 2024 11:27:08 +0800
|
||||
|
||||
spark-store (4.5.2) UNRELEASED; urgency=medium
|
||||
|
||||
* 支持安装到 ACE Bookworm
|
||||
|
||||
-- shenmo <shenmo@spark-app.store> Tue, 24 Sep 2024 11:27:08 +0800
|
||||
|
||||
spark-store (4.5.1) UNRELEASED; urgency=medium
|
||||
|
||||
* 修复 aptss 部分报错
|
||||
* 重新设计了 Tag 区的展示方式
|
||||
* 新增 Fish 补全
|
||||
|
||||
-- shenmo <shenmo@spark-app.store> Tue, 24 Sep 2024 11:27:08 +0800
|
||||
|
||||
spark-store (4.5.0) UNRELEASED; urgency=medium
|
||||
|
||||
* 支持从商店中直接启动应用
|
||||
* ssinstall 修复安装时不再指定版本号以避免出现问题
|
||||
* aptss支持fish补全
|
||||
* 修复: distrobox下无法正常校验应用hash
|
||||
* aptss 4.5.0
|
||||
* 应用更新新增进度条
|
||||
* 支持识别Debian
|
||||
|
||||
-- shenmo <shenmo@spark-app.store> Tue, 24 Sep 2024 11:27:08 +0800
|
||||
|
||||
spark-store (4.3.3.2) UNRELEASED; urgency=medium
|
||||
|
||||
* 提升升级工具体验,不再反复弹窗
|
||||
@@ -180,7 +214,7 @@ spark-store (4.2.7.3) stable; urgency=medium
|
||||
|
||||
* 修复:aptss现在会正确地透传错误码而不是exit 0
|
||||
* 修复:下载时如果卡0%(无法下载metalink),会在超时后报错中断而不是一直傻等
|
||||
* 修复:排队下载时CPU占满单核的bug https://gitee.com/deepin-community-store/spark-store/issues/I7B91V
|
||||
* 修复:排队下载时CPU占满单核的bug https://gitee.com/spark-store-project/spark-store/issues/I7B91V
|
||||
* 修复:在终端中打开的icon过大导致无法投稿到UOS
|
||||
* 修复:v23下编译出错
|
||||
* 薪怎:支持崩溃日志收集系统
|
||||
@@ -417,7 +451,7 @@ spark-store (4.2.3~test2) stable; urgency=medium
|
||||
spark-store (4.2.3~test1) stable; urgency=medium
|
||||
|
||||
* 修复:因判断安装状态错误创建多个相同任务的bug
|
||||
* 测试中:尝试修复安装结束的闪退问题 https://gitee.com/deepin-community-store/spark-store/commit/cb093dcc2bb0a193db89aa0ce5f20ea9cc5d56eb
|
||||
* 测试中:尝试修复安装结束的闪退问题 https://gitee.com/spark-store-project/spark-store/commit/cb093dcc2bb0a193db89aa0ce5f20ea9cc5d56eb
|
||||
* 修复:Deepin 显示开发者模式未开启
|
||||
* 修复:从托盘打开主窗口时透明度动画不流畅
|
||||
* 修复:主窗口关闭后,从托盘打开关于窗口会被主窗口遮挡
|
||||
@@ -499,8 +533,8 @@ spark-store (4.1.2) stable; urgency=medium
|
||||
* chore: 去除安装依赖:g++
|
||||
* fix: 修复下载列表中进度提示文字显示不完整的问题
|
||||
* feat: ssinstall支持从单独文件夹中校验软件包
|
||||
* feat: 支持分单文件夹下载。具体内容参见:https://gitee.com/deepin-community-store/repo_auto_update_script/blob/master/mirror-list-for-apt-fast/sources.list.d/sparkstore.list
|
||||
* info: 非常感谢 @jwyh 对星火商店代码仓库设计了很多标准,参见 https://deepin-community-store.gitee.io/spark-wiki/#/Dev/Spark-Store-Git-Repo?id=%e6%9b%b4%e6%96%b0%e6%97%a5%e5%bf%97%e8%a7%84%e5%88%99 ,不过shenmo是自由的
|
||||
* feat: 支持分单文件夹下载。具体内容参见:https://gitee.com/spark-store-project/repo_auto_update_script/blob/master/mirror-list-for-apt-fast/sources.list.d/sparkstore.list
|
||||
* info: 非常感谢 @jwyh 对星火商店代码仓库设计了很多标准,参见 https://wiki.spark-app.store/#/Dev/Spark-Store-Git-Repo?id=%e6%9b%b4%e6%96%b0%e6%97%a5%e5%bf%97%e8%a7%84%e5%88%99 ,不过shenmo是自由的
|
||||
|
||||
|
||||
* chore: 添加 Application 类,继承 DApplication,将 main 函数中设置属性、关于信息等操作移至 Application 构造函数中进行
|
||||
@@ -519,8 +553,8 @@ spark-store (4.1.2) stable; urgency=medium
|
||||
spark-store (4.1.2~test2) stable; urgency=medium
|
||||
|
||||
* feat: ssinstall支持从单独文件夹中校验软件包
|
||||
* feat: 支持分单文件夹下载。具体内容参见:https://gitee.com/deepin-community-store/repo_auto_update_script/blob/master/mirror-list-for-apt-fast/sources.list.d/sparkstore.list
|
||||
* info: 非常感谢 @jwyh 对星火商店代码仓库设计了很多标准,参见 https://deepin-community-store.gitee.io/spark-wiki/#/Dev/Spark-Store-Git-Repo ,不过shenmo是自由的
|
||||
* feat: 支持分单文件夹下载。具体内容参见:https://gitee.com/spark-store-project/repo_auto_update_script/blob/master/mirror-list-for-apt-fast/sources.list.d/sparkstore.list
|
||||
* info: 非常感谢 @jwyh 对星火商店代码仓库设计了很多标准,参见 https://wiki.spark-app.store/#/Dev/Spark-Store-Git-Repo ,不过shenmo是自由的
|
||||
|
||||
-- shenmo <shenmo@spark-app.store> Fri, 30 Jan 2022 00:00:00 +0800
|
||||
|
||||
@@ -731,7 +765,7 @@ spark-store (3.2.4) stable; urgency=medium
|
||||
|
||||
spark-store (3.2.4~test4) stable; urgency=medium
|
||||
|
||||
* 现在在商店启动后点击spk链接仍会正常启动 https://gitee.com/deepin-community-store/spark-store/commit/dd6780d636042bf12d77414e6f1552cc7d1ed24c
|
||||
* 现在在商店启动后点击spk链接仍会正常启动 https://gitee.com/spark-store-project/spark-store/commit/dd6780d636042bf12d77414e6f1552cc7d1ed24c
|
||||
|
||||
-- shenmo <shenmo@spark-app.store> Fri, 30 Jan 2022 00:00:00 +0800
|
||||
|
||||
|
||||
2
debian/copyright
vendored
@@ -1,6 +1,6 @@
|
||||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: spark-store
|
||||
Source: https://gitee.com/deepin-community-store/spark-store
|
||||
Source: https://gitee.com/spark-store-project/spark-store
|
||||
|
||||
Files: *
|
||||
Copyright: The Spark Project Developers
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
> 用于 zinface-community-cmake-build-system.patch 补丁化构建方式
|
||||
|
||||
```shell
|
||||
git clone https://gitee.com/deepin-community-store/spark-store
|
||||
git clone https://gitee.com/spark-store-project/spark-store
|
||||
cd spark-store
|
||||
git am < patchs/zinface-community-cmake-build-system.patch
|
||||
make package
|
||||
|
||||
@@ -40,7 +40,7 @@ _aptss()
|
||||
"list"
|
||||
"search"
|
||||
"show" "showsrc"
|
||||
"install" "remove" "purge" "autoremove"
|
||||
"install" "remove" "purge" "autoremove" "autopurge"
|
||||
"update"
|
||||
"upgrade" "full-upgrade" "dist-upgrade"
|
||||
"edit-sources"
|
||||
|
||||
242
pkg/usr/share/fish/completions/aptss.fish
Normal file
@@ -0,0 +1,242 @@
|
||||
# 清除已有的 aptss 补全(如果有的话)
|
||||
complete -c aptss -e
|
||||
|
||||
# 禁用默认的文件补全(避免显示当前目录文件)
|
||||
complete -c aptss -f
|
||||
|
||||
########################################################################
|
||||
# aptss Fish 补全脚本(中文说明版,软件包补全显示简介)
|
||||
#
|
||||
# 说明:
|
||||
# 1. 子命令和选项的说明采用中文显示。
|
||||
# 2. 软件包补全部分不再调用 apt-cache,而是解析 aptss 自有的软件源索引文件,
|
||||
# 从 /var/lib/aptss/lists/*Packages(或 *Sources)中提取软件包名称及简介信息。
|
||||
#
|
||||
# 注意:如果你的 aptss 软件源索引文件位置或格式有变化,请相应修改下面的 awk 命令。
|
||||
########################################################################
|
||||
|
||||
### 辅助函数
|
||||
|
||||
# 解析 /var/lib/aptss/lists/*Packages 文件,输出符合当前输入前缀的“软件包<TAB>简介”
|
||||
function __fish_aptss_print_packages
|
||||
set cur (commandline -ct)
|
||||
# 将所有匹配的 Packages 文件拼接后,用 awk 分段解析(RS="" 表示以空行为分段)
|
||||
awk -v cur="$cur" '
|
||||
BEGIN { RS=""; FS="\n" }
|
||||
{
|
||||
pkg = ""; desc = "";
|
||||
for(i=1; i<=NF; i++){
|
||||
if($i ~ /^Package: /) { pkg = substr($i, 10) } # “Package: ”共9个字符
|
||||
else if($i ~ /^Description: /) { desc = substr($i, 14) } # “Description: ”共13个字符
|
||||
}
|
||||
if(pkg != "" && (cur == "" || pkg ~ ("^" cur))) {
|
||||
print pkg "\t" desc
|
||||
}
|
||||
}
|
||||
' /var/lib/aptss/lists/*Packages 2>/dev/null
|
||||
end
|
||||
|
||||
# 解析已安装软件包(这里仍使用 dpkg-query,如果需要使用 aptss 数据,可另外构造)
|
||||
function __fish_aptss_print_installed_packages
|
||||
set cur (commandline -ct)
|
||||
dpkg-query -W -f='${Package}\t${Description}\n' 2>/dev/null | grep -i "^$cur"
|
||||
end
|
||||
|
||||
# 解析 /var/lib/aptss/lists/*Sources 文件,输出源代码包信息(如果存在)
|
||||
function __fish_aptss_print_source_packages
|
||||
set cur (commandline -ct)
|
||||
awk -v cur="$cur" '
|
||||
BEGIN { RS=""; FS="\n" }
|
||||
{
|
||||
pkg = ""; desc = "";
|
||||
for(i=1; i<=NF; i++){
|
||||
if($i ~ /^Package: /) { pkg = substr($i, 10) }
|
||||
else if($i ~ /^Description: /) { desc = substr($i, 14) }
|
||||
}
|
||||
if(pkg != "" && (cur == "" || pkg ~ ("^" cur))) {
|
||||
print pkg "\t" desc
|
||||
}
|
||||
}
|
||||
' /var/lib/aptss/lists/*Sources 2>/dev/null
|
||||
end
|
||||
|
||||
# 翻译子命令为中文说明(用于补全时显示在括号内)
|
||||
function __fish_translate_aptss_cmd
|
||||
switch $argv[1]
|
||||
case ssupdate
|
||||
echo "更新软件源"
|
||||
case list
|
||||
echo "列出软件包"
|
||||
case search
|
||||
echo "搜索软件包"
|
||||
case show
|
||||
echo "显示软件包信息"
|
||||
case showsrc
|
||||
echo "显示源包信息"
|
||||
case install
|
||||
echo "安装软件包"
|
||||
case remove
|
||||
echo "移除软件包"
|
||||
case purge
|
||||
echo "彻底移除软件包"
|
||||
case autoremove
|
||||
echo "自动移除不必要的软件包"
|
||||
case update
|
||||
echo "更新软件包列表"
|
||||
case upgrade
|
||||
echo "升级软件包"
|
||||
case full-upgrade
|
||||
echo "完全升级(可能移除其他软件包)"
|
||||
case dist-upgrade
|
||||
echo "发行版升级"
|
||||
case edit-sources
|
||||
echo "编辑软件源列表"
|
||||
case help
|
||||
echo "显示帮助信息"
|
||||
case source
|
||||
echo "下载源代码包"
|
||||
case build-dep
|
||||
echo "安装构建依赖"
|
||||
case clean
|
||||
echo "清除软件包缓存"
|
||||
case autoclean
|
||||
echo "自动清理旧缓存"
|
||||
case download
|
||||
echo "下载软件包"
|
||||
case changelog
|
||||
echo "显示更新日志"
|
||||
case moo
|
||||
echo "彩蛋"
|
||||
case depends
|
||||
echo "显示软件包依赖"
|
||||
case rdepends
|
||||
echo "显示软件包逆向依赖"
|
||||
case policy
|
||||
echo "显示软件包策略"
|
||||
case '*'
|
||||
echo $argv[1]
|
||||
end
|
||||
end
|
||||
|
||||
### 定义各类子命令组
|
||||
|
||||
# 所有子命令列表
|
||||
set -g __aptss_commands ssupdate list search show showsrc install remove purge autoremove update upgrade full-upgrade dist-upgrade edit-sources help source build-dep clean autoclean download changelog moo depends rdepends policy
|
||||
|
||||
# 需要补全二进制软件包名称的子命令(例如 install、show、search、download、changelog、depends、rdepends)
|
||||
set -l __aptss_pkg_subcmds install show search download changelog depends rdepends
|
||||
|
||||
# 需要补全已安装软件包的子命令(例如 remove、purge、autoremove)
|
||||
set -l __aptss_installed_pkg_subcmds remove purge autoremove
|
||||
|
||||
# 需要补全源代码包的子命令(例如 source、build-dep、showsrc、policy)
|
||||
set -l __aptss_src_pkg_subcmds source build-dep showsrc policy
|
||||
|
||||
### 子命令补全
|
||||
# 未输入子命令时,显示所有候选子命令,并在括号中显示中文说明
|
||||
for cmd in $__aptss_commands
|
||||
set desc (__fish_translate_aptss_cmd $cmd)
|
||||
complete -c aptss -a $cmd -d "$desc" -n "not __fish_seen_subcommand_from $__aptss_commands"
|
||||
end
|
||||
|
||||
### 公共选项(适用于一组子命令)
|
||||
set -l group1 "install remove purge upgrade dist-upgrade full-upgrade autoremove"
|
||||
|
||||
complete -c aptss -n "__fish_seen_subcommand_from $group1" -l show-progress -d '显示进度'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from $group1" -l fix-broken -d '修复损坏的依赖'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from $group1" -l purge -d '清除配置文件'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from $group1" -l verbose-versions -d '显示详细版本'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from $group1" -l auto-remove -d '自动移除依赖'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from $group1" -s s -l simulate -d '模拟/试运行'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from $group1" -l download -d '下载软件包'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from $group1" -l fix-missing -d '修复丢失文件'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from $group1" -l fix-policy -d '修复策略'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from $group1" -l ignore-hold -d '忽略锁定'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from $group1" -l force-yes -d '强制确认'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from $group1" -l trivial-only -d '仅处理简单情况'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from $group1" -l reinstall -d '重新安装'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from $group1" -l solver -d '使用求解器'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from $group1" -s t -l target-release -d '目标版本'
|
||||
|
||||
# 附加的 GENERIC 选项
|
||||
complete -c aptss -n "__fish_seen_subcommand_from $group1" -s d -l download-only -d '仅下载'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from $group1" -s y -l assume-yes -d '默认确认'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from $group1" -l assume-no -d '默认否定'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from $group1" -s u -l show-upgraded -d '显示升级情况'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from $group1" -s m -l ignore-missing -d '忽略缺失'
|
||||
|
||||
### 针对各个子命令的专用选项
|
||||
|
||||
# update 命令
|
||||
complete -c aptss -n "__fish_seen_subcommand_from update" -l list-cleanup -d '清理列表'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from update" -l print-uris -d '显示 URI'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from update" -l allow-insecure-repositories -d '允许不安全的仓库'
|
||||
|
||||
# list 命令
|
||||
complete -c aptss -n "__fish_seen_subcommand_from list" -l installed -d '已安装的软件包'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from list" -l upgradable -d '可升级的软件包'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from list" -l manual-installed -d '手动安装的软件包'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from list" -s v -l verbose -d '详细模式'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from list" -s a -l all-versions -d '显示所有版本'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from list" -s t -l target-release -d '目标版本'
|
||||
|
||||
# show 命令
|
||||
complete -c aptss -n "__fish_seen_subcommand_from show" -s a -l all-versions -d '显示所有版本'
|
||||
|
||||
# depends 和 rdepends 命令(逐项添加各选项)
|
||||
for opt in i important installed pre-depends depends recommends suggests replaces breaks conflicts enhances recurse implicit
|
||||
complete -c aptss -n "__fish_seen_subcommand_from depends rdepends" -l $opt -d $opt
|
||||
end
|
||||
complete -c aptss -n "__fish_seen_subcommand_from depends rdepends" -s i -d '选项 -i'
|
||||
|
||||
# search 命令
|
||||
complete -c aptss -n "__fish_seen_subcommand_from search" -s n -l names-only -d '仅匹配名称'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from search" -s f -l full -d '全文搜索'
|
||||
|
||||
# showsrc 命令
|
||||
complete -c aptss -n "__fish_seen_subcommand_from showsrc" -l only-source -d '仅显示源代码'
|
||||
|
||||
# source 命令
|
||||
complete -c aptss -n "__fish_seen_subcommand_from source" -s s -l simulate -d '模拟'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from source" -s b -l compile -d '编译/构建'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from source" -s P -l build-profiles -d '构建配置'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from source" -l diff-only -d '仅显示差异'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from source" -l debian-only -d '仅限 Debian'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from source" -l tar-only -d '仅打包 tar'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from source" -l dsc-only -d '仅下载 DSC'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from source" -s t -l target-release -d '目标版本'
|
||||
|
||||
# build-dep 命令
|
||||
complete -c aptss -n "__fish_seen_subcommand_from build-dep" -s a -l host-architecture -d '主机架构'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from build-dep" -s s -l simulate -d '模拟'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from build-dep" -s P -l build-profiles -d '构建配置'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from build-dep" -s t -l target-release -d '目标版本'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from build-dep" -l purge -d '清除'
|
||||
complete -c aptss -n "__fish_seen_subcommand_from build-dep" -l solver -d '求解依赖'
|
||||
|
||||
# moo 命令
|
||||
complete -c aptss -n "__fish_seen_subcommand_from moo" -l color -d '彩蛋模式'
|
||||
|
||||
# clean 和 autoclean 命令
|
||||
complete -c aptss -n "__fish_seen_subcommand_from clean autoclean" -s s -l simulate -d '模拟'
|
||||
|
||||
### 针对 -t/--target-release 的特殊补全
|
||||
complete -c aptss -n '
|
||||
begin
|
||||
set -l prev (commandline -poc | string trim)
|
||||
test "$prev" = "-t" -o "$prev" = "--target-release"
|
||||
end
|
||||
' -a '(__fish_aptss_target_release)' -d '目标版本'
|
||||
|
||||
### 软件包补全
|
||||
# 对于需要二进制软件包名称的子命令,调用 __fish_aptss_print_packages,
|
||||
# 输出的每一行格式为 "包名<TAB>简介",Fish 会将 TAB 后内容显示为注释。
|
||||
complete -c aptss -n "__fish_seen_subcommand_from $__aptss_pkg_subcmds" -a '(__fish_aptss_print_packages)'
|
||||
|
||||
# 对于 remove、purge、autoremove 命令,补全已安装的软件包(使用 dpkg-query 输出)
|
||||
complete -c aptss -n "__fish_seen_subcommand_from $__aptss_installed_pkg_subcmds" -a '(__fish_aptss_print_installed_packages)' -d '已安装软件包'
|
||||
|
||||
# 对于 source、build-dep、showsrc、policy 命令,补全源代码包,
|
||||
# 如果存在对应的 Sources 索引文件,则调用 __fish_aptss_print_source_packages,
|
||||
# 否则可考虑默认使用二进制包的索引。
|
||||
complete -c aptss -n "__fish_seen_subcommand_from $__aptss_src_pkg_subcmds" -a '(__fish_aptss_print_source_packages)' -d '源代码包'
|
||||
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
TRANSHELL_CONTENT_HASH_CHECK_FAILED="Failed in checking package hash! \nPossibly reason can be the package is broken, laggy in sync of Spark Store repository, or, there is a malware attempt to attack. \nIf you don't know what happend, please try install again after execute the command below\n sudo aptss update\n\nIf the problem still happen, please click APP Feedback button in the APP information page to feedback to us.\n\n If you are in the Audition Group,Please use ssaudit instead of ssinstall to audit APPs,for ssinstall is used for password-free install now.\nIf you want to install an app that is removed from Spark Store repository,you can also use ssaudit."
|
||||
TRANSHELL_CONTENT_PLEASE_RUN_AS_ROOT="Please run ssinstall as root"
|
||||
TRANSHELL_CONTENT_FILE_NOT_EXIST="File not exist"
|
||||
TRANSHELL_CONTENT_WILL_NOT_DELETE_DEB="No delete after install option given, will not delete the deb"
|
||||
TRANSHELL_CONTENT_DEB_IS_DELETED="--delete-after-install option is given and the installation is succeeded, delete the deb file."
|
||||
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
TRANSHELL_CONTENT_HASH_CHECK_FAILED="软件包校验失败!这不应该发生!\n可能是因为软件包已损坏,星火仓库未同步,或者最坏的情况:恶意软件尝试利用自动安装来入侵系统!\n如果你不清楚发生了什么,请执行 sudo aptss update 后再尝试安装。\n如果问题仍然存在,请在应用信息界面点击 应用反馈 来提交反馈给我们!\n\n 如果你是审核人员,请使用 ssaudit来替代ssinstall进行审核工作,因为现在ssinstall已经被用于免密安装。\n如果你正在尝试安装已经下架的星火应用,也可用ssaudit来替代ssinstall"
|
||||
TRANSHELL_CONTENT_PLEASE_RUN_AS_ROOT="请使用root启动ssinstall"
|
||||
TRANSHELL_CONTENT_FILE_NOT_EXIST="文件不存在"
|
||||
TRANSHELL_CONTENT_WILL_NOT_DELETE_DEB="未指定安装后删除或安装出错,不删除deb包"
|
||||
TRANSHELL_CONTENT_DEB_IS_DELETED="使用了--delete-after-install选项且安装未出错,删除deb包"
|
||||
@@ -40,6 +40,9 @@ qm.path = /usr/share/spark-store/translations
|
||||
bash_completion.files += pkg/usr/share/bash-completion/completions/aptss
|
||||
bash_completion.path = /usr/share/bash-completion/completions
|
||||
|
||||
fish_completion.files += pkg/usr/share/fish/completions/aptss.fish
|
||||
fish_completion.path = /usr/share/fish/completions/
|
||||
|
||||
desktop.files += pkg/usr/share/applications/*.desktop
|
||||
desktop.path = /usr/share/applications
|
||||
|
||||
@@ -73,5 +76,6 @@ INSTALLS += \
|
||||
tmp \
|
||||
service \
|
||||
bash_completion \
|
||||
fish_completion \
|
||||
polkit-1
|
||||
# 暂时不添加
|
||||
|
||||
@@ -35,14 +35,13 @@ Application::Application(int &argc, char **argv)
|
||||
setApplicationName("spark-store"); // 影响 ~/.config/spark-union ~/.local/share/spark-union 下文件夹名称
|
||||
setApplicationDisplayName(QObject::tr("Spark Store")); // 设置窗口显示标题 (Wayland 下会显示 Qt 原生标题栏)
|
||||
setProductName(QObject::tr("Spark Store"));
|
||||
setProductIcon(QIcon::fromTheme("spark-store"));
|
||||
setProductIcon(QIcon(":/icon/sparky.png"));
|
||||
setApplicationHomePage("https://gitee.com/spark-store-project");
|
||||
setApplicationDescription(
|
||||
QObject::tr(
|
||||
"<span style=' font-size:10pt;font-weight:60;'>An appstore powered by community</span><br/>"
|
||||
"<a href='https://www.spark-app.store/'>https://www.spark-app.store</a><br/>"
|
||||
"<span style=' font-size:12pt;'>Spark developers</span>"));
|
||||
setApplicationLicense(" <a href='https://gitee.com/spark-store-project/spark-store/blob/Flamescion/LICENSE'>Spark Opensource License</a> ");
|
||||
"<span style=' font-size:10pt;font-weight:60;'>Sparky is our mascot, designed by <a href='https://tai3.cn/'>Tyson Tan</a></span><br/>"));
|
||||
setApplicationLicense(" <a href='https://gitee.com/spark-store-project/spark-store/blob/Flamescion/LICENSE'>GPL V3</a> ");
|
||||
|
||||
// 检查 ~/.config/spark-union/spark-store 文件夹是否存在
|
||||
checkAppConfigLocation();
|
||||
|
||||
@@ -44,24 +44,50 @@
|
||||
<file>icon/light/text.svg</file>
|
||||
<file>icon/light/update.svg</file>
|
||||
<file>icon/logo.svg</file>
|
||||
<file>icon/sparky.png</file>
|
||||
<file>json/features.json</file>
|
||||
<file>tags/a2d-small.png</file>
|
||||
<file>tags/a2d_full.svg</file>
|
||||
<file>tags/a2d.png</file>
|
||||
<file>tags/community-small.png</file>
|
||||
<file>tags/a2d.svg</file>
|
||||
<file>tags/community_full.svg</file>
|
||||
<file>tags/community.png</file>
|
||||
<file>tags/community.svg</file>
|
||||
<file>tags/deepin-small.png</file>
|
||||
<file>tags/debian_full.svg</file>
|
||||
<file>tags/debian.png</file>
|
||||
<file>tags/debian.svg</file>
|
||||
<file>tags/deepin_full.svg</file>
|
||||
<file>tags/deepin.png</file>
|
||||
<file>tags/deepin.svg</file>
|
||||
<file>tags/dtk-small.png</file>
|
||||
<file>tags/dwine2-small.png</file>
|
||||
<file>tags/dwine5-small.png</file>
|
||||
<file>tags/dtk_full.svg</file>
|
||||
<file>tags/dtk.png</file>
|
||||
<file>tags/dtk.svg</file>
|
||||
<file>tags/dwine2_full.svg</file>
|
||||
<file>tags/dwine2.png</file>
|
||||
<file>tags/dwine2.svg</file>
|
||||
<file>tags/dwine5_full.svg</file>
|
||||
<file>tags/dwine5.png</file>
|
||||
<file>tags/dwine5.svg</file>
|
||||
<file>tags/logo_icon.svg</file>
|
||||
<file>tags/ubuntu-small.png</file>
|
||||
<file>tags/ubuntu_full.svg</file>
|
||||
<file>tags/ubuntu.png</file>
|
||||
<file>tags/uos-authorize.svg</file>
|
||||
<file>tags/uos-small.png</file>
|
||||
<file>tags/ubuntu.svg</file>
|
||||
<file>tags/uos_full.svg</file>
|
||||
<file>tags/uos.png</file>
|
||||
<file>tags/uos.svg</file>
|
||||
<file>tags/amber-ce-bookworm_full.svg</file>
|
||||
<file>tags/amber-ce-bookworm.png</file>
|
||||
<file>tags/amber-ce-bookworm.svg</file>
|
||||
<file>tags/amber-ce-sid_full.svg</file>
|
||||
<file>tags/amber-ce-sid.png</file>
|
||||
<file>tags/amber-ce-sid.svg</file>
|
||||
<file>tags/amber-ce-trixie_full.svg</file>
|
||||
<file>tags/amber-ce-trixie.png</file>
|
||||
<file>tags/amber-ce-trixie.svg</file>
|
||||
<file>tags/native_full.svg</file>
|
||||
<file>tags/native.png</file>
|
||||
<file>tags/native.svg</file>
|
||||
<file>translations/qtwebengine_zh.qm</file>
|
||||
<file>tags/amber-ce-deepin_full.svg</file>
|
||||
<file>tags/amber-ce-deepin.svg</file>
|
||||
<file>tags/amber-ce-deepin.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
BIN
src/assets/icon/logo.xcf
Normal file
BIN
src/assets/icon/sparky.png
Normal file
|
After Width: | Height: | Size: 401 KiB |
@@ -20,6 +20,6 @@
|
||||
"description": "Fix 1 detailed description..."
|
||||
}
|
||||
],
|
||||
"linkUrl": "https://gitee.com/deepin-community-store/spark-store/releases/",
|
||||
"linkUrl": "https://gitee.com/spark-store-project/spark-store/releases/",
|
||||
"linkButtonVisible": true
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 248 KiB After Width: | Height: | Size: 7.3 KiB |
1
src/assets/tags/a2d.svg
Normal file
|
After Width: | Height: | Size: 12 KiB |
1
src/assets/tags/a2d_full.svg
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
src/assets/tags/amber-ce-bookworm.png
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
1
src/assets/tags/amber-ce-bookworm.svg
Normal file
|
After Width: | Height: | Size: 22 KiB |
1
src/assets/tags/amber-ce-bookworm_full.svg
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
src/assets/tags/amber-ce-deepin.png
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
1
src/assets/tags/amber-ce-deepin.svg
Normal file
|
After Width: | Height: | Size: 18 KiB |
1
src/assets/tags/amber-ce-deepin_full.svg
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
src/assets/tags/amber-ce-sid.png
Normal file
|
After Width: | Height: | Size: 7.9 KiB |
1
src/assets/tags/amber-ce-sid.svg
Normal file
|
After Width: | Height: | Size: 18 KiB |
1
src/assets/tags/amber-ce-sid_full.svg
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
src/assets/tags/amber-ce-trixie.png
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
1
src/assets/tags/amber-ce-trixie.svg
Normal file
|
After Width: | Height: | Size: 18 KiB |
1
src/assets/tags/amber-ce-trixie_full.svg
Normal file
|
After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 178 KiB |
1
src/assets/tags/community_full.svg
Normal file
|
After Width: | Height: | Size: 738 KiB |
BIN
src/assets/tags/debian.png
Normal file
|
After Width: | Height: | Size: 7.9 KiB |
1
src/assets/tags/debian.svg
Normal file
|
After Width: | Height: | Size: 26 KiB |
1
src/assets/tags/debian_full.svg
Normal file
|
After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
BIN
src/assets/tags/deepin.png
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 17 KiB |
1
src/assets/tags/deepin_full.svg
Normal file
|
After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 954 B |
BIN
src/assets/tags/dtk.png
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
1
src/assets/tags/dtk.svg
Normal file
|
After Width: | Height: | Size: 13 KiB |
1
src/assets/tags/dtk_full.svg
Normal file
|
After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 5.7 KiB |
BIN
src/assets/tags/dwine2.png
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
1
src/assets/tags/dwine2.svg
Normal file
|
After Width: | Height: | Size: 16 KiB |
1
src/assets/tags/dwine2_full.svg
Normal file
|
After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
BIN
src/assets/tags/dwine5.png
Normal file
|
After Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 16 KiB |
1
src/assets/tags/dwine5_full.svg
Normal file
|
After Width: | Height: | Size: 17 KiB |
@@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="32px" height="32px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>logo icon</title>
|
||||
<defs>
|
||||
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-1">
|
||||
<stop stop-color="#00F1FF" offset="0%"></stop>
|
||||
<stop stop-color="#008AFF" offset="100%"></stop>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<g id="light" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="1" transform="translate(-460.000000, -159.000000)">
|
||||
<g id="tittlebar" transform="translate(450.000000, 150.000000)">
|
||||
<g id="logo-icon" transform="translate(10.000000, 9.000000)">
|
||||
<g>
|
||||
<rect id="矩形" fill="url(#linearGradient-1)" x="0" y="0" width="32" height="32" rx="8"></rect>
|
||||
<path d="M23,25 L23,24.0002278 C21.6666667,24.0002278 21,24.0002278 21,24.0002278 L21,20 L22,20 L22,19 L21,19 L21,17 L20,17.5 L20,19 L19,19 L19,20 L20,20 L20,24.0002278 C20,24.0002278 20,24.0002278 20,24.0002278 C20,24.5523868 20.4476132,25 20.9997722,25 C20.9998481,25 20.9999241,25 21,25 L23,25 Z M24.0210414,23.9789586 L24.0210414,22.2215556 L24.0210414,22.2215556 L24.6565969,21.6226667 L27.2207674,25 L29.0052118,25 L25.6099302,20.7304444 L28.4678057,18.0074755 L26.6711391,18.0074755 L24.0210414,20.6204444 L24,15.5 L23,15 L23,25 C23.5639056,25 24.0210414,24.5428642 24.0210414,23.9789586 Z" id="tk" fill="#FFFFFF" fill-rule="nonzero"></path>
|
||||
<path d="M10.275,24 C13.175,24 15.35,23.2 16.85,21.6 C18.275,20.075 19,17.825 19,15 C19,12.15 18.275,10.05 16.85,8.55 C15.35,6.95 13.175,6 10.275,6 L4,6 L4,24 L10.275,24 Z M9.725,21 L7,21 L7,9 L9.725,9 C11.95,9 13.575,9.15 14.6,10.175 C15.6,11.175 16,12.75 16,15 C16,17.2 15.6,18.9 14.6,19.95 C13.575,20.975 11.95,21 9.725,21 Z" id="D" fill="#FFFFFF" fill-rule="nonzero"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.0 KiB |
BIN
src/assets/tags/native.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
1
src/assets/tags/native.svg
Normal file
|
After Width: | Height: | Size: 11 KiB |
1
src/assets/tags/native_full.svg
Normal file
|
After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 7.7 KiB |
1
src/assets/tags/ubuntu.svg
Normal file
|
After Width: | Height: | Size: 19 KiB |
1
src/assets/tags/ubuntu_full.svg
Normal file
|
After Width: | Height: | Size: 31 KiB |
@@ -1,13 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
||||
<defs>
|
||||
<linearGradient id="uos-托盘1-a" x1="15.968%" x2="100%" y1="14.224%" y2="60.554%">
|
||||
<stop offset="0%" stop-color="#0071FF"/>
|
||||
<stop offset="48.72%" stop-color="#00E8FC"/>
|
||||
<stop offset="100%" stop-color="#00A2FF"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<g fill="none" transform="translate(1 1)">
|
||||
<circle cx="9" cy="9" r="9" fill="url(#uos-托盘1-a)"/>
|
||||
<path fill="#FFF" d="M13,4.5 C13.5128358,4.5 13.9355072,4.88604019 13.9932723,5.38337887 L14,5.5 L14,9.5 C14,12.5 12,14.5 9,14.5 C6,14.5 4,12.5 4.0043492,9.70016408 L4,9.5 L4,5.5 C4,4.94771525 4.44771525,4.5 5,4.5 C5.51283584,4.5 5.93550716,4.88604019 5.99327227,5.38337887 L6,5.5 L6,9.5 C6,11.5 7.5,12.5 9,12.5 C10.5,12.5 12,11.5 12,9.5 L12,5.5 C12,4.94771525 12.4477153,4.5 13,4.5 Z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 873 B |
|
Before Width: | Height: | Size: 1.1 KiB |
BIN
src/assets/tags/uos.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 873 B After Width: | Height: | Size: 18 KiB |
1
src/assets/tags/uos_full.svg
Normal file
|
After Width: | Height: | Size: 18 KiB |
@@ -8,6 +8,8 @@
|
||||
#include <QSettings>
|
||||
#include <QProcess>
|
||||
#include <QDebug>
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
|
||||
DataCollectorAndUploader::DataCollectorAndUploader(QObject *parent) : QObject(parent)
|
||||
{
|
||||
@@ -23,25 +25,26 @@ void DataCollectorAndUploader::collectData()
|
||||
QString distributor_id;
|
||||
QString release;
|
||||
QString architecture;
|
||||
|
||||
|
||||
QSettings config(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/config.ini", QSettings::IniFormat);
|
||||
QString version = config.value("build/version").toString();
|
||||
QString uuid = config.value("info/uuid").toString();
|
||||
|
||||
|
||||
// Execute lsb_release --all and capture the output
|
||||
QProcess lsbProcess;
|
||||
lsbProcess.start("lsb_release", QStringList() << "--all");
|
||||
lsbProcess.waitForFinished();
|
||||
QString lsbOutput = lsbProcess.readAllStandardOutput();
|
||||
|
||||
QStringList lines = lsbOutput.split('\n');
|
||||
for (const QString &line : lines) {
|
||||
if (line.contains("Distributor ID:")) {
|
||||
distributor_id = line.split(":").last().trimmed();
|
||||
} else if (line.contains("Release:")) {
|
||||
release = line.split(":").last().trimmed();
|
||||
// Read /etc/os-release file
|
||||
QFile osReleaseFile("/etc/os-release");
|
||||
if (osReleaseFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
QTextStream in(&osReleaseFile);
|
||||
while (!in.atEnd()) {
|
||||
QString line = in.readLine();
|
||||
if (line.startsWith("ID=")) {
|
||||
distributor_id = line.mid(3).remove('"').trimmed();
|
||||
} else if (line.startsWith("VERSION_ID=")) {
|
||||
release = line.mid(11).remove('"').trimmed();
|
||||
}
|
||||
}
|
||||
osReleaseFile.close();
|
||||
} else {
|
||||
qWarning() << "Could not open /etc/os-release file";
|
||||
}
|
||||
|
||||
// Execute uname -m to get the architecture
|
||||
@@ -58,8 +61,6 @@ void DataCollectorAndUploader::collectData()
|
||||
json.insert("Store_Version", version);
|
||||
json.insert("UUID", uuid);
|
||||
|
||||
|
||||
|
||||
// Convert to byte array
|
||||
QJsonDocument doc(json);
|
||||
QByteArray jsonData = doc.toJson();
|
||||
|
||||
18
src/main.cpp
@@ -142,18 +142,18 @@ int main(int argc, char *argv[])
|
||||
// 龙芯机器配置,使得 DApplication 能正确加载 QtWebEngine
|
||||
qputenv("DTK_FORCE_RASTER_WIDGETS", "FALSE");
|
||||
|
||||
// 设置 QtWebEngine 环境变量
|
||||
QStringList chromium_flags;
|
||||
// 浏览器开启 GPU 支持
|
||||
// qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--disable-features=UseModernMediaControls");
|
||||
// qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--disable-web-security");
|
||||
// chromium_flags.append("--disable-features=UseModernMediaControls");
|
||||
// chromium_flags.append("--disable-web-security");
|
||||
// 全平台软件渲染Webkit
|
||||
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--disable-gpu");
|
||||
#ifdef __sw_64__
|
||||
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--no-sandbox");
|
||||
chromium_flags.append("--disable-gpu");
|
||||
#if defined __sw_64__ || __loongarch__
|
||||
chromium_flags.append("--no-sandbox");
|
||||
#endif
|
||||
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", chromium_flags.join(" ").toUtf8());
|
||||
|
||||
#ifdef __loongarch__
|
||||
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--no-sandbox");
|
||||
#endif
|
||||
/**
|
||||
* NOTE: https://zhuanlan.zhihu.com/p/550285855
|
||||
* 避免 wayland 环境下从 QtWebEngine 后退回到 QWidget 时黑屏闪烁
|
||||
@@ -163,8 +163,6 @@ int main(int argc, char *argv[])
|
||||
DApplication::setAttribute(Qt::AA_UseSoftwareOpenGL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
|
||||
// 开启 Hidpi 支持
|
||||
qDebug() << "Enable HiDPI Support.";
|
||||
|
||||
@@ -151,24 +151,25 @@ void AppIntoPage::openUrl(const QUrl &url)
|
||||
{
|
||||
isInstalled = true;
|
||||
|
||||
QProcess isUpdate;
|
||||
isUpdate.start("dpkg-query", QStringList() << "--showformat='${Version}'"
|
||||
<< "--show" << info["Pkgname"].toString());
|
||||
isUpdate.waitForFinished(180 * 1000); // 默认超时 3 分钟
|
||||
QString localVersion = isUpdate.readAllStandardOutput();
|
||||
localVersion.replace("'", "");
|
||||
// QProcess isUpdate;
|
||||
// isUpdate.start("dpkg-query", QStringList() << "--showformat='${Version}'"
|
||||
// << "--show" << info["Pkgname"].toString());
|
||||
// isUpdate.waitForFinished(180 * 1000); // 默认超时 3 分钟
|
||||
// QString localVersion = isUpdate.readAllStandardOutput();
|
||||
// localVersion.replace("'", "");
|
||||
|
||||
isUpdate.start("dpkg", QStringList() << "--compare-versions" << localVersion << "ge" << info["Version"].toString());
|
||||
isUpdate.waitForFinished(180 * 1000); // 默认超时 3 分钟
|
||||
if (isUpdate.exitCode() == 0 && isUpdate.exitStatus() == QProcess::NormalExit)
|
||||
{
|
||||
isUpdated = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
isUpdated = false;
|
||||
}
|
||||
isUpdate.close();
|
||||
// isUpdate.start("dpkg", QStringList() << "--compare-versions" << localVersion << "ge" << info["Version"].toString());
|
||||
// isUpdate.waitForFinished(180 * 1000); // 默认超时 3 分钟
|
||||
// if (isUpdate.exitCode() == 0 && isUpdate.exitStatus() == QProcess::NormalExit)
|
||||
// {
|
||||
// isUpdated = true;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// isUpdated = false;
|
||||
// }
|
||||
// isUpdate.close();
|
||||
isUpdated = true; //去掉直接点击升级的功能
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -180,7 +181,19 @@ void AppIntoPage::openUrl(const QUrl &url)
|
||||
{
|
||||
if (isUpdated)
|
||||
{
|
||||
ui->downloadButton->setText(tr("Reinstall"));
|
||||
QProcess process;
|
||||
QStringList arguments;
|
||||
arguments << "check" << info["Pkgname"].toString();
|
||||
process.start("/opt/durapps/spark-store/bin/store-helper/ss-launcher", arguments);
|
||||
if (process.waitForFinished()) {
|
||||
exitCode = process.exitCode();
|
||||
exitStatus = process.exitStatus();
|
||||
if (exitCode != 0){
|
||||
ui->downloadButton->setText(tr("Reinstall"));
|
||||
}else{
|
||||
ui->downloadButton->setText(tr("Launch"));
|
||||
}
|
||||
}
|
||||
ui->downloadButton->setEnabled(true);
|
||||
ui->downloadButton->show();
|
||||
ui->pushButton_3->show();
|
||||
@@ -219,8 +232,15 @@ void AppIntoPage::clear()
|
||||
ui->tag_deepin->hide();
|
||||
ui->tag_dwine2->hide();
|
||||
ui->tag_dwine5->hide();
|
||||
ui->tag_debian->hide();
|
||||
ui->tag_ubuntu->hide();
|
||||
ui->tag_community->hide();
|
||||
ui->tag_native->hide();
|
||||
ui->tag_amber_ce_bookworm->hide();
|
||||
ui->tag_amber_ce_trixie->hide();
|
||||
ui->tag_amber_ce_sid->hide();
|
||||
ui->tag_amber_ce_deepin23->hide();
|
||||
|
||||
ui->icon->clear();
|
||||
ui->title->clear();
|
||||
ui->version->clear();
|
||||
@@ -357,14 +377,25 @@ void AppIntoPage::isDownloading(const QUrl &url)
|
||||
|
||||
int exitCode = process.exitCode();
|
||||
QProcess::ExitStatus exitStatus = process.exitStatus();
|
||||
process.close();
|
||||
|
||||
if (exitCode == 0 && exitStatus == QProcess::NormalExit)
|
||||
{
|
||||
QStringList arguments;
|
||||
arguments << "check" << info["Pkgname"].toString();
|
||||
process.start("/opt/durapps/spark-store/bin/store-helper/ss-launcher", arguments);
|
||||
if (process.waitForFinished()) {
|
||||
exitCode = process.exitCode();
|
||||
exitStatus = process.exitStatus();
|
||||
if (exitCode != 0){
|
||||
ui->downloadButton->setText(tr("Reinstall"));
|
||||
}else{
|
||||
ui->downloadButton->setText(tr("Launch"));
|
||||
}
|
||||
}
|
||||
ui->downloadButton->setEnabled(true);
|
||||
ui->downloadButton->setText(tr("Reinstall"));
|
||||
ui->downloadButton->show();
|
||||
ui->pushButton_3->show();
|
||||
process.close();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -379,49 +410,89 @@ void AppIntoPage::setAppinfoTags(const QStringList &tagList)
|
||||
bool ubuntuSupport = false;
|
||||
bool deepinSupport = false;
|
||||
bool uosSupport = false;
|
||||
bool debianSupport = false;
|
||||
bool hasAmberTag = false;
|
||||
|
||||
// First pass: Check if any Amber tags exist
|
||||
foreach (const QString &tag, tagList)
|
||||
{
|
||||
if (tag == "community")
|
||||
if (tag.startsWith("amber-ce-"))
|
||||
{
|
||||
ui->tag_community->show();
|
||||
}
|
||||
else if (tag == "ubuntu")
|
||||
{
|
||||
ui->tag_ubuntu->show();
|
||||
ubuntuSupport = true;
|
||||
}
|
||||
else if (tag == "deepin")
|
||||
{
|
||||
ui->tag_deepin->show();
|
||||
deepinSupport = true;
|
||||
}
|
||||
else if (tag == "uos")
|
||||
{
|
||||
ui->tag_uos->show();
|
||||
uosSupport = true;
|
||||
|
||||
}
|
||||
else if (tag == "dtk5")
|
||||
{
|
||||
ui->tag_dtk5->show();
|
||||
}
|
||||
else if (tag == "dwine2")
|
||||
{
|
||||
ui->tag_dwine2->show();
|
||||
}
|
||||
else if (tag == "dwine5")
|
||||
{
|
||||
ui->tag_dwine5->show();
|
||||
}
|
||||
else if (tag == "a2d")
|
||||
{
|
||||
ui->tag_a2d->show();
|
||||
hasAmberTag = true;
|
||||
break; // No need to continue checking
|
||||
}
|
||||
}
|
||||
notifyUserUnsupportedTags(ubuntuSupport, deepinSupport, uosSupport);
|
||||
|
||||
|
||||
// Second pass: Apply tags based on whether we have Amber tags
|
||||
foreach (const QString &tag, tagList)
|
||||
{
|
||||
if (tag.isEmpty())
|
||||
continue;
|
||||
|
||||
if (tag == "native")
|
||||
ui->tag_native->show();
|
||||
|
||||
else if (tag == "community")
|
||||
ui->tag_community->show();
|
||||
|
||||
else if (tag == "dtk5")
|
||||
ui->tag_dtk5->show();
|
||||
|
||||
else if (tag == "dwine2")
|
||||
ui->tag_dwine2->show();
|
||||
|
||||
else if (tag == "dwine5")
|
||||
ui->tag_dwine5->show();
|
||||
|
||||
else if (tag == "a2d")
|
||||
ui->tag_a2d->show();
|
||||
|
||||
else if (tag == "amber-ce-bookworm")
|
||||
ui->tag_amber_ce_bookworm->show();
|
||||
|
||||
else if (tag == "amber-ce-trixie")
|
||||
ui->tag_amber_ce_trixie->show();
|
||||
|
||||
else if (tag == "amber-ce-deepin23")
|
||||
ui->tag_amber_ce_deepin23->show();
|
||||
|
||||
else if (tag == "amber-ce-sid")
|
||||
ui->tag_amber_ce_sid->show();
|
||||
|
||||
// Only process distro tags if there are no Amber tags
|
||||
else if (!hasAmberTag)
|
||||
{
|
||||
if (tag == "debian")
|
||||
{
|
||||
ui->tag_debian->show();
|
||||
debianSupport = true;
|
||||
}
|
||||
else if (tag == "ubuntu")
|
||||
{
|
||||
ui->tag_ubuntu->show();
|
||||
ubuntuSupport = true;
|
||||
}
|
||||
else if (tag == "deepin")
|
||||
{
|
||||
ui->tag_deepin->show();
|
||||
deepinSupport = true;
|
||||
}
|
||||
else if (tag == "uos")
|
||||
{
|
||||
ui->tag_uos->show();
|
||||
uosSupport = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasAmberTag)
|
||||
notifyUserUnsupportedTags(ubuntuSupport, deepinSupport, uosSupport, debianSupport);
|
||||
}
|
||||
|
||||
void AppIntoPage::notifyUserUnsupportedTags(bool ubuntuSupport, bool deepinSupport, bool uosSupport)
|
||||
|
||||
|
||||
void AppIntoPage::notifyUserUnsupportedTags(bool ubuntuSupport, bool deepinSupport, bool uosSupport, bool debianSupport)
|
||||
{
|
||||
if (!SettingsPage::needUncompatibleNotification) {
|
||||
return;
|
||||
@@ -432,30 +503,21 @@ void AppIntoPage::notifyUserUnsupportedTags(bool ubuntuSupport, bool deepinSuppo
|
||||
bool checkdeepin = (isDeepin && !deepinSupport);
|
||||
bool checkuos = (isUOS && !uosSupport);
|
||||
bool isUbuntu = false;
|
||||
bool isDebian = false;
|
||||
if (!checkdeepin && !checkuos)
|
||||
{
|
||||
// 检查是否为 ubuntu 系统
|
||||
QFile lsb("/etc/lsb-release");
|
||||
if (!lsb.open(QIODevice::ReadOnly))
|
||||
{
|
||||
qDebug() << "打开 /etc/lsb-release 失败";
|
||||
}
|
||||
else {
|
||||
QString lsbInfo = lsb.readAll(); // 因为使用 readAll 读取后会默认跳转到文件末尾导致读出的数据为空,所以用单独一个 string 存储
|
||||
if (lsbInfo.contains("Ubuntu"))
|
||||
{
|
||||
isUbuntu = true;
|
||||
lsb.close();
|
||||
}
|
||||
else if (lsbInfo.contains("GXDE"))
|
||||
{
|
||||
// GXDE 使用 Ubuntu 的 tag
|
||||
isUbuntu = true;
|
||||
lsb.close();
|
||||
}
|
||||
// 使用更可靠的/etc/os-release检测
|
||||
QFile osRelease("/etc/os-release");
|
||||
if (osRelease.open(QIODevice::ReadOnly)) {
|
||||
QString content = osRelease.readAll();
|
||||
isUbuntu = content.contains("ID=ubuntu");
|
||||
isDebian = content.contains("ID=debian") || content.contains("ID_LIKE=debian"); // 合并Debian系检测
|
||||
osRelease.close();
|
||||
}
|
||||
}
|
||||
|
||||
bool checkubuntu = (isUbuntu && !ubuntuSupport);
|
||||
bool checkdebian = (isDebian && !debianSupport);
|
||||
|
||||
if (checkdeepin)
|
||||
{
|
||||
@@ -469,12 +531,17 @@ void AppIntoPage::notifyUserUnsupportedTags(bool ubuntuSupport, bool deepinSuppo
|
||||
{
|
||||
Utils::sendNotification("spark-store", tr("Warning"), tr("The current application does not support or tested on Ubuntu, there may be problems"));
|
||||
}
|
||||
else if (!isUbuntu && !isDeepin && !isUOS)
|
||||
else if (checkdebian)
|
||||
{
|
||||
Utils::sendNotification("spark-store", tr("Warning"), tr("The current application does not support or tested on Debian, there may be problems"));
|
||||
}
|
||||
if (!isUbuntu && !isDeepin && !isUOS && !isDebian)
|
||||
{
|
||||
Utils::sendNotification("spark-store", tr("Warning"), tr("The current application does not support or tested on current platform, there may be problems"));
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
void AppIntoPage::on_downloadButton_clicked()
|
||||
@@ -498,15 +565,43 @@ void AppIntoPage::on_downloadButton_clicked()
|
||||
|
||||
return;
|
||||
}
|
||||
else if (ui->downloadButton->text() == tr("Launch"))
|
||||
{
|
||||
QString scriptPath = "/opt/durapps/spark-store/bin/store-helper/ss-launcher";
|
||||
QStringList arguments;
|
||||
arguments << "launch" << info["Pkgname"].toString();
|
||||
QProcess process;
|
||||
process.startDetached(scriptPath, arguments);
|
||||
return;
|
||||
}
|
||||
|
||||
emit clickedDownloadBtn();
|
||||
|
||||
DownloadItem *item = dw->addItem(info["Name"].toString(), info["Filename"].toString(), info["Pkgname"].toString(), iconpixmap, downloadUrl);
|
||||
// 处理 tags,设置 installExtraArg
|
||||
QString installExtraArg;
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
|
||||
QStringList taglist = info["Tags"].toString().split(";", Qt::SkipEmptyParts);
|
||||
#else
|
||||
QStringList taglist = info["Tags"].toString().split(";", QString::SkipEmptyParts);
|
||||
#endif
|
||||
if (taglist.contains("native")) {
|
||||
installExtraArg = "--native";
|
||||
} else if (taglist.contains("amber-ce-bookworm")) {
|
||||
installExtraArg = "--amber-ce-bookworm";
|
||||
} else if (taglist.contains("amber-ce-trixie")) {
|
||||
installExtraArg = "--amber-ce-trixie";
|
||||
} else if (taglist.contains("amber-ce-sid")) {
|
||||
installExtraArg = "--amber-ce-sid";
|
||||
} else if (taglist.contains("amber-ce-deepin23")) {
|
||||
installExtraArg = "--amber-ce-deepin23";
|
||||
}
|
||||
|
||||
DownloadItem *item = dw->addItem(info["Name"].toString(), info["Filename"].toString(), info["Pkgname"].toString(),
|
||||
iconpixmap, downloadUrl, installExtraArg);
|
||||
if (item == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (ui->downloadButton->text() == tr("Reinstall"))
|
||||
{
|
||||
item->reinstall = true;
|
||||
@@ -528,15 +623,15 @@ void AppIntoPage::on_pushButton_3_clicked()
|
||||
ui->pushButton_3->setEnabled(false);
|
||||
|
||||
QProcess uninstall;
|
||||
uninstall.start("pkexec", QStringList() << "apt" << "autopurge" << "-y" << info["Pkgname"].toString().toLower());
|
||||
uninstall.start("pkexec", QStringList() << "/opt/durapps/spark-store/bin/store-helper/uninstaller" << info["Pkgname"].toString().toLower());
|
||||
uninstall.waitForFinished(-1);
|
||||
uninstall.close();
|
||||
|
||||
QProcess check;
|
||||
check.start("dpkg", QStringList() << "-s" << info["Pkgname"].toString().toLower());
|
||||
check.waitForFinished(-1);
|
||||
// QProcess check;
|
||||
// check.start("dpkg", QStringList() << "-s" << info["Pkgname"].toString().toLower());
|
||||
// check.waitForFinished(-1);
|
||||
|
||||
if (check.exitCode() != 0 || check.exitStatus() != QProcess::NormalExit)
|
||||
if (uninstall.exitCode() != 0 || uninstall.exitStatus() != QProcess::NormalExit)
|
||||
{
|
||||
ui->downloadButton->setText(tr("Download and Install"));
|
||||
ui->pushButton_3->hide();
|
||||
@@ -547,7 +642,7 @@ void AppIntoPage::on_pushButton_3_clicked()
|
||||
ui->downloadButton->setEnabled(true);
|
||||
ui->pushButton_3->setEnabled(true);
|
||||
|
||||
check.close();
|
||||
// check.close();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -561,16 +656,6 @@ void AppIntoPage::on_shareButton_clicked()
|
||||
|
||||
void AppIntoPage::on_updateButton_clicked()
|
||||
{
|
||||
QString feedbackSpk = "spk://store/chat/store.spark-app.feedback";
|
||||
QFileInfo actionSubmissionClientStatus("/opt/durapps/store.spark-app.feedback");
|
||||
if (actionSubmissionClientStatus.exists() && actionSubmissionClientStatus.isDir())
|
||||
{
|
||||
qDebug() << "反馈器存在";
|
||||
QProcess::startDetached("sh", QStringList() << "/opt/durapps/store.spark-app.feedback/launch.sh");
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << "反馈器不存在,跳转页面";
|
||||
openUrl(feedbackSpk);
|
||||
}
|
||||
QString feedbackURL = "https://bbs.spark-app.store/";
|
||||
QProcess::startDetached("xdg-open", QStringList{feedbackURL});
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ private:
|
||||
void initConnections();
|
||||
void isDownloading(const QUrl &url);
|
||||
void setAppinfoTags(const QStringList &tagList);
|
||||
void notifyUserUnsupportedTags(bool ubuntuSupport, bool deepinSupport, bool uosSupport);
|
||||
void notifyUserUnsupportedTags(bool ubuntuSupport, bool deepinSupport, bool uosSupport, bool debianSupport);
|
||||
|
||||
signals:
|
||||
void clickedDownloadBtn();
|
||||
|
||||
@@ -160,7 +160,6 @@
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>14</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
@@ -369,24 +368,273 @@
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>13</width>
|
||||
<height>37</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="CustomLabel" name="tag_ubuntu">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Capable to Ubuntu 22.04</p></body></html></string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string><html><head/><body><p>Capable to Ubuntu 22.04</p></body></html></string>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../assets/assets.qrc">:/tags/ubuntu.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="CustomLabel" name="tag_uos">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Capable to UOS home 20</p></body></html></string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string><html><head/><body><p>Capable to UOS home 20</p></body></html></string>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../assets/assets.qrc">:/tags/uos.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="CustomLabel" name="tag_deepin">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Capable to deepin 23</p></body></html></string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string><html><head/><body><p>Capable to deepin 23</p></body></html></string>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../assets/assets.qrc">:/tags/deepin.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="CustomLabel" name="tag_debian">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Capable to Debian Stable</p></body></html></string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string><html><head/><body><p>Capable to Debian Stable</p></body></html></string>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../assets/assets.qrc">:/tags/debian.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="CustomLabel" name="tag_native">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>This app can only be installed natively</p></body></html></string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string><html><head/><body><p>This app can only be installed natively</p></body></html></string>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../assets/assets.qrc">:/tags/native.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="CustomLabel" name="tag_amber_ce_bookworm">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>This app will be installed to debian12 ACE</p></body></html></string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string><html><head/><body><p>This app will be installed to debian12 ACE</p></body></html></string>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../assets/assets.qrc">:/tags/amber-ce-bookworm.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="CustomLabel" name="tag_amber_ce_trixie">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>This app will be installed to debian13 ACE</p></body></html></string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string><html><head/><body><p>This app will be installed to debian13 ACE</p></body></html></string>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../assets/assets.qrc">:/tags/amber-ce-trixie.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="CustomLabel" name="tag_amber_ce_sid">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>This app will be installed to debian SID ACE</p></body></html></string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string><html><head/><body><p>This app will be installed to debian SID ACE</p></body></html></string>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../assets/assets.qrc">:/tags/amber-ce-sid.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="CustomLabel" name="tag_amber_ce_deepin23">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>This app will be installed to deepin23 ACE</p></body></html></string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string><html><head/><body><p>This app will be installed to deepin23 ACE</p></body></html></string>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../assets/assets.qrc">:/tags/amber-ce-deepin.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>18</width>
|
||||
<height>37</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_13">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_13">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
@@ -399,125 +647,17 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="tag_community">
|
||||
<property name="maximumSize">
|
||||
<widget class="CustomLabel" name="tag_a2d">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>16777215</height>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>This app is developed by community user,we give this tag to honor those who contribute to the Linux Ecology</p></body></html></string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string><html><head/><body><p>This app is developed by community user,we give this tag to honor those who contribute to the Linux Ecology</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><img src=":/tags/community-small.png"/></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="tag_ubuntu">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Capable to Ubuntu 22.04</p></body></html></string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string><html><head/><body><p>Capable to Ubuntu 22.04</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><img src=":/tags/ubuntu-small.png"/></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="tag_uos">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Capable to UOS home 20</p></body></html></string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string><html><head/><body><p>Capable to UOS home 20</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><img src=":/tags/uos-small.png"/></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="tag_dwine2">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>A deepin-wine2 app. Spark Store will automatically configure the wine kit for you.</p></body></html></string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string><html><head/><body><p>A deepin-wine2 app. Spark Store will automatically configure the wine kit for you.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><img src=":/tags/dwine2-small.png"/></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="tag_dtk5">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>This is a DTK5 app,which means it would have better effect on Deepin Desktop Environment</p></body></html></string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string><html><head/><body><p>This is a DTK5 app,which means it would have better effect on Deepin Desktop Environment</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><img src=":/tags/dtk-small.png"/></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="tag_deepin">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Capable to deepin 20</p></body></html></string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string><html><head/><body><p>Capable to deepin 20</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><img src=":/tags/deepin-small.png"/></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="tag_a2d">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>16777215</height>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
@@ -526,17 +666,98 @@
|
||||
<property name="whatsThis">
|
||||
<string><html><head/><body><p>An Appimage to deb app.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><img src=":/tags/a2d-small.png"/></p></body></html></string>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../assets/assets.qrc">:/tags/a2d.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="tag_dwine5">
|
||||
<widget class="CustomLabel" name="tag_community">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>16777215</height>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>This app is developed by community user,we give this tag to honor those who contribute to the Linux Ecology</p></body></html></string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string><html><head/><body><p>This app is developed by community user,we give this tag to honor those who contribute to the Linux Ecology</p></body></html></string>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../assets/assets.qrc">:/tags/community.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="CustomLabel" name="tag_dtk5">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>This is a DTK5 app,which means it would have better effect on Deepin Desktop Environment</p></body></html></string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string><html><head/><body><p>This is a DTK5 app,which means it would have better effect on Deepin Desktop Environment</p></body></html></string>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../assets/assets.qrc">:/tags/dtk.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="CustomLabel" name="tag_dwine2">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>A deepin-wine2 app. Spark Store will automatically configure the wine kit for you.</p></body></html></string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string><html><head/><body><p>A deepin-wine2 app. Spark Store will automatically configure the wine kit for you.</p></body></html></string>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../assets/assets.qrc">:/tags/dwine2.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="CustomLabel" name="tag_dwine5">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
@@ -545,13 +766,13 @@
|
||||
<property name="whatsThis">
|
||||
<string><html><head/><body><p>A Wine app.Spark Store will automatically configure the wine kit for you</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><img src=":/tags/dwine5-small.png"/></p></body></html></string>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../assets/assets.qrc">:/tags/dwine5.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_6">
|
||||
<spacer name="horizontalSpacer_14">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
@@ -757,7 +978,6 @@
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
@@ -895,7 +1115,6 @@
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
@@ -1060,7 +1279,6 @@ QListWidget::item::selected
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
@@ -1413,6 +1631,15 @@ QListWidget::item::selected
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>CustomLabel</class>
|
||||
<extends>QLabel</extends>
|
||||
<header>widgets/common/customlabel.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../assets/assets.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -47,6 +47,7 @@ SOURCES += \
|
||||
utils/utils.cpp \
|
||||
utils/widgetanimation.cpp \
|
||||
widgets/base/basewidgetopacity.cpp \
|
||||
widgets/common/customlabel.cpp \
|
||||
widgets/common/downloaditem.cpp \
|
||||
widgets/common/progressbutton.cpp \
|
||||
widgets/common/smoothlistwidget.cpp \
|
||||
@@ -73,6 +74,7 @@ HEADERS += \
|
||||
utils/utils.h \
|
||||
utils/widgetanimation.h \
|
||||
widgets/base/basewidgetopacity.h \
|
||||
widgets/common/customlabel.h \
|
||||
widgets/common/downloaditem.h \
|
||||
widgets/common/progressbutton.h \
|
||||
widgets/common/smoothlistwidget.h \
|
||||
@@ -106,3 +108,5 @@ TRANSLATIONS += \
|
||||
qnx: target.path = /tmp/$${TARGET}/bin
|
||||
else: unix:!android: target.path = /opt/durapps/$${TARGET}/bin
|
||||
!isEmpty(target.path): INSTALLS += target
|
||||
|
||||
DISTFILES +=
|
||||
|
||||
@@ -198,7 +198,7 @@ void Utils::setQPAPlatform()
|
||||
// }
|
||||
else
|
||||
{
|
||||
qputenv("QT_QPA_PLATFORM", "dxcb");
|
||||
qputenv("QT_QPA_PLATFORM", "dxcb;xcb");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
24
src/widgets/common/customlabel.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "customlabel.h"
|
||||
#include <QGuiApplication>
|
||||
|
||||
CustomLabel::CustomLabel(QWidget *parent, Qt::WindowFlags f)
|
||||
: QLabel(parent, f)
|
||||
{
|
||||
}
|
||||
|
||||
QPixmap CustomLabel::pixmap() const
|
||||
{
|
||||
const QPixmap *p = QLabel::pixmap();
|
||||
return p ? *p : QPixmap();
|
||||
}
|
||||
|
||||
void CustomLabel::setPixmap(const QPixmap &pixmap)
|
||||
{
|
||||
QPixmap _pixmap = pixmap;
|
||||
_pixmap.setDevicePixelRatio(qApp->devicePixelRatio());
|
||||
_pixmap = _pixmap.scaled(size() * _pixmap.devicePixelRatio(),
|
||||
Qt::KeepAspectRatio,
|
||||
Qt::SmoothTransformation);
|
||||
|
||||
QLabel::setPixmap(_pixmap);
|
||||
}
|
||||
19
src/widgets/common/customlabel.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef CUSTOMLABEL_H
|
||||
#define CUSTOMLABEL_H
|
||||
|
||||
#include <QLabel>
|
||||
|
||||
class CustomLabel : public QLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap)
|
||||
|
||||
public:
|
||||
explicit CustomLabel(QWidget *parent = nullptr,
|
||||
Qt::WindowFlags f = Qt::WindowFlags());
|
||||
|
||||
virtual QPixmap pixmap() const;
|
||||
virtual void setPixmap(const QPixmap &pixmap);
|
||||
};
|
||||
|
||||
#endif // CUSTOMLABEL_H
|
||||
@@ -175,8 +175,16 @@ void DownloadItem::slotAsyncInstall(int t)
|
||||
switch (t)
|
||||
{
|
||||
case 0:
|
||||
installer.start("pkexec", QStringList() << "/usr/local/bin/ssinstall"
|
||||
<< "/tmp/spark-store/" + ui->label_filename->text().toUtf8() << "--delete-after-install");
|
||||
{
|
||||
QStringList args;
|
||||
args << "/usr/local/bin/ssinstall"
|
||||
<< "/tmp/spark-store/" + ui->label_filename->text().toUtf8();
|
||||
if (!installExtraArg.isEmpty()) {
|
||||
args << installExtraArg;
|
||||
}
|
||||
args << "--delete-after-install";
|
||||
installer.start("pkexec", args);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
installer.start("deepin-deb-installer", QStringList() << "/tmp/spark-store/" + ui->label_filename->text().toUtf8());
|
||||
@@ -208,11 +216,11 @@ void DownloadItem::slotAsyncInstall(int t)
|
||||
}
|
||||
}
|
||||
|
||||
QProcess isInstall;
|
||||
isInstall.start("dpkg", QStringList() << "-s" << pkgName);
|
||||
isInstall.waitForFinished(180 * 1000); // 默认超时 3 分钟
|
||||
int error = QString::fromStdString(isInstall.readAllStandardError().toStdString()).length();
|
||||
if (error == 0 && !haveError)
|
||||
// QProcess isInstall;
|
||||
// isInstall.start("dpkg", QStringList() << "-s" << pkgName);
|
||||
// isInstall.waitForFinished(180 * 1000); // 默认超时 3 分钟
|
||||
// int error = QString::fromStdString(isInstall.readAllStandardError().toStdString()).length();
|
||||
if ( !haveError)
|
||||
{
|
||||
ui->pushButton_install->hide();
|
||||
Utils::sendNotification("spark-store", tr("Spark Store"), ui->label->text() + " " + tr("Installation complete."));
|
||||
@@ -244,8 +252,5 @@ void DownloadItem::slotAsyncInstall(int t)
|
||||
ui->widget_spinner->hide();
|
||||
DownloadItem::isInstall = false;
|
||||
|
||||
installer.deleteLater();
|
||||
isInstall.deleteLater();
|
||||
|
||||
emit finished(error == 0 && !haveError && !notRoot);
|
||||
emit finished(!haveError && !notRoot);
|
||||
}
|
||||
|
||||
@@ -43,6 +43,9 @@ public:
|
||||
|
||||
void install(int);
|
||||
|
||||
// 新增:安装时额外参数
|
||||
QString installExtraArg;
|
||||
|
||||
private:
|
||||
Ui::DownloadItem *ui;
|
||||
|
||||
|
||||
@@ -85,7 +85,9 @@ void DownloadListWidget::clearItem()
|
||||
ui->listWidget->clear();
|
||||
}
|
||||
|
||||
DownloadItem* DownloadListWidget::addItem(QString name, QString fileName, QString pkgName, const QPixmap icon, QString downloadurl)
|
||||
DownloadItem* DownloadListWidget::addItem(QString name, QString fileName, QString pkgName,
|
||||
const QPixmap icon, QString downloadurl,
|
||||
const QString &installExtraArg)
|
||||
{
|
||||
if (fileName.isEmpty())
|
||||
{
|
||||
@@ -104,6 +106,7 @@ DownloadItem* DownloadListWidget::addItem(QString name, QString fileName, QStrin
|
||||
di->setName(name);
|
||||
di->setFileName(fileName);
|
||||
di->pkgName = pkgName;
|
||||
di->installExtraArg = installExtraArg;
|
||||
di->seticon(icon);
|
||||
QListWidgetItem *pItem = new QListWidgetItem();
|
||||
pItem->setSizeHint(QSize(240, 56)); // ui 中单个 downloaditem 高度固定 56px(上下 margin 8px,图片固定 48x48)
|
||||
|
||||
@@ -19,7 +19,9 @@ class DownloadListWidget : public DBlurEffectWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DownloadItem *addItem(QString name, QString fileName, QString pkgName, const QPixmap icon, QString downloadurl);
|
||||
DownloadItem *addItem(QString name, QString fileName, QString pkgName,
|
||||
const QPixmap icon, QString downloadurl,
|
||||
const QString &installExtraArg);
|
||||
int nowDownload = 0;
|
||||
int allDownload = 0;
|
||||
int toDownload = 0;
|
||||
|
||||
@@ -7,6 +7,8 @@ Dir::State::lists "/var/lib/aptss/lists/";
|
||||
APT::Get::Fix-Broken true;
|
||||
APT::Get::List-Cleanup="0";
|
||||
|
||||
Acquire::GzipIndexes "false";
|
||||
|
||||
#clear APT::Update::Post-Invoke-Success;
|
||||
|
||||
#clear DPkg::Post-Invoke;
|
||||
|
||||
@@ -1,21 +1,25 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# apt-fast v1.9
|
||||
#
|
||||
# apt-fast v1.10.0
|
||||
# Use this just like aptitude or apt-get for faster package downloading.
|
||||
#
|
||||
# Copyright: 2008-2012 Matt Parnell, http://www.mattparnell.com
|
||||
# Improvements, maintenance, revisions - 2012, 2017-2018 Dominique Lasserre
|
||||
# Improvements, maintenance, revisions - 2012, 2017-2019 Dominique Lasserre
|
||||
#
|
||||
# You may distribute this file under the terms of the GNU General
|
||||
# Public License as published by the Free Software Foundation; either
|
||||
# version 3 of the License, or (at your option) any later version.
|
||||
#
|
||||
|
||||
shopt -s nullglob
|
||||
[ -n "$DEBUG" ] && set -xv
|
||||
|
||||
# Print colored messages.
|
||||
# Usage: msg "message text" "message type" "optional: err"
|
||||
# Message types are 'normal', 'hint' or 'warning'. Warnings and messages with a
|
||||
# third argument are piped to stderr.
|
||||
|
||||
THREADS=$(nproc 2>/dev/null || echo 4)
|
||||
msg(){
|
||||
msg_options=()
|
||||
case "$2" in
|
||||
@@ -34,7 +38,7 @@ msg(){
|
||||
}
|
||||
|
||||
# Search for known options and decide if root privileges are needed.
|
||||
root=1 # default value: we need root privileges
|
||||
root=$#
|
||||
option=
|
||||
for argument in "$@"; do
|
||||
case "$argument" in
|
||||
@@ -52,7 +56,7 @@ for argument in "$@"; do
|
||||
option="source"
|
||||
root=0
|
||||
;;
|
||||
changelog|search|policy|show)
|
||||
*)
|
||||
root=0
|
||||
;;
|
||||
esac
|
||||
@@ -70,7 +74,6 @@ TMP__APTMGR="${_APTMGR-${TMP_RANDOM}}"
|
||||
TMP_APTCACHE="${APTCACHE-${TMP_RANDOM}}"
|
||||
TMP_DLDIR="${DLDIR-${TMP_RANDOM}}"
|
||||
TMP_DLLIST="${DLLIST-${TMP_RANDOM}}"
|
||||
TMP_LISTDIR="${LISTDIR-${TMP_RANDOM}}"
|
||||
TMP__MAXNUM="${MAXNUM-${TMP_RANDOM}}"
|
||||
TMP__MAXCONPERSRV="${MAXCONPERSRV-${TMP_RANDOM}}"
|
||||
TMP__SPLITCON="${SPLITCON-${TMP_RANDOM}}"
|
||||
@@ -78,6 +81,7 @@ TMP__MINSPLITSZ=${MINSPLITSZ-${TMP_RANDOM}}
|
||||
TMP__PIECEALGO=${PIECEALGO-${TMP_RANDOM}}
|
||||
TMP_aptfast_prefix="${aptfast_prefix-${TMP_RANDOM}}"
|
||||
TMP_APT_FAST_TIMEOUT="${APT_FAST_TIMEOUT-${TMP_RANDOM}}"
|
||||
TMP_APT_FAST_APT_AUTH="${APT_FAST_APT_AUTH-${TMP_RANDOM}}"
|
||||
TMP_VERBOSE_OUTPUT="${VERBOSE_OUTPUT-${TMP_RANDOM}}"
|
||||
TMP_ftp_proxy="${ftp_proxy-${TMP_RANDOM}}"
|
||||
TMP_http_proxy="${http_proxy-${TMP_RANDOM}}"
|
||||
@@ -85,7 +89,7 @@ TMP_https_proxy="${https_proxy-${TMP_RANDOM}}"
|
||||
|
||||
# Check for proper privileges.
|
||||
# Call explicitly with environment variables to get them into root conext.
|
||||
if [ "$root" = 1 ] && [ "$UID" != 0 ]; then
|
||||
if [ "$root" -ne 0 ] && [ "$UID" != 0 ]; then
|
||||
exec sudo DEBUG="$DEBUG" \
|
||||
LCK_FILE="$TMP_LCK_FILE" \
|
||||
DOWNLOADBEFORE="$TMP_DOWNLOADBEFORE" \
|
||||
@@ -93,7 +97,6 @@ if [ "$root" = 1 ] && [ "$UID" != 0 ]; then
|
||||
APTCACHE="$TMP_APTCACHE" \
|
||||
DLDIR="$TMP_DLDIR" \
|
||||
DLLIST="$TMP_DLLIST" \
|
||||
LISTDIR="$TMP_LISTDIR" \
|
||||
_MAXNUM="$TMP__MAXNUM" \
|
||||
_MAXCONPERSRV="$TMP__MAXCONPERSRV" \
|
||||
_SPLITCON="$TMP__SPLITCON" \
|
||||
@@ -101,6 +104,7 @@ if [ "$root" = 1 ] && [ "$UID" != 0 ]; then
|
||||
_PIECEALGO="$TMP__PIECEALGO" \
|
||||
aptfast_prefix="$TMP_aptfast_prefix" \
|
||||
APT_FAST_TIMEOUT="$TMP_APT_FAST_TIMEOUT" \
|
||||
APT_FAST_APT_AUTH="$TMP_APT_FAST_APT_AUTH" \
|
||||
VERBOSE_OUTPUT="$TMP_VERBOSE_OUTPUT" \
|
||||
ftp_proxy="$TMP_ftp_proxy" \
|
||||
http_proxy="$TMP_http_proxy" \
|
||||
@@ -108,7 +112,6 @@ if [ "$root" = 1 ] && [ "$UID" != 0 ]; then
|
||||
"$0" "$@"
|
||||
fi
|
||||
|
||||
|
||||
# Define lockfile.
|
||||
# Use /tmp as directory because everybody (not only root) has to have write
|
||||
# permissions.
|
||||
@@ -123,27 +126,39 @@ LCK_FD=99
|
||||
|
||||
# Set default package manager, APT cache, temporary download dir,
|
||||
# temporary download list file, and maximal parallel downloads
|
||||
_APTMGR=apt-get
|
||||
_APTMGR=apt-get
|
||||
eval "$(apt-config shell APTCACHE Dir::Cache::archives/d)"
|
||||
# Check if APT config option Dir::Cache::archives::apt-fast-partial is set.
|
||||
eval "$(apt-config shell apt_fast_partial Dir::Cache::archives::apt-fast-partial/d)"
|
||||
if [ -z "$apt_fast_partial" ]; then
|
||||
eval "$(apt-config -o Dir::Cache::archives::apt-fast-partial=apt-fast shell DLDIR Dir::Cache::archives::apt-fast-partial/d)"
|
||||
DLDIR="$(realpath "${APTCACHE}/../apt-fast")"
|
||||
else
|
||||
eval "$(apt-config shell DLDIR Dir::Cache::archives::apt-fast-partial/d)"
|
||||
DLDIR="${apt_fast_partial}"
|
||||
fi
|
||||
# Currently not needed.
|
||||
eval "$(apt-config shell LISTDIR Dir::State::lists/d)"
|
||||
|
||||
# Check for apt auth files
|
||||
eval "$(apt-config shell NETRC Dir::Etc::netrc/f)"
|
||||
eval "$(apt-config shell NETRCDIR Dir::Etc::netrcparts/d)"
|
||||
APTAUTHFILES=()
|
||||
if [ -f "$NETRC" ]; then
|
||||
APTAUTHFILES=("$NETRC")
|
||||
fi
|
||||
APTAUTHFILES+=("$NETRCDIR"*)
|
||||
|
||||
if [ "$IS_ACE_ENV" != "" ];then
|
||||
DLLIST="/tmp/apt-fast-in-container.list"
|
||||
else
|
||||
DLLIST="/tmp/apt-fast.list"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
_MAXNUM=5
|
||||
_MAXCONPERSRV=10
|
||||
_SPLITCON=8
|
||||
_MINSPLITSZ="1M"
|
||||
_PIECEALGO="default"
|
||||
MIRRORS=()
|
||||
|
||||
# Prefix in front of apt-fast output:
|
||||
aptfast_prefix=
|
||||
@@ -162,18 +177,30 @@ APT_FAST_TIMEOUT=60
|
||||
# Ask for download confirmation if unset
|
||||
DOWNLOADBEFORE=
|
||||
|
||||
# Enable APT authentication support
|
||||
APT_FAST_APT_AUTH=1
|
||||
|
||||
# Formatted package list in download confirmation if unset
|
||||
VERBOSE_OUTPUT=
|
||||
|
||||
# Download command.
|
||||
_DOWNLOADER='aria2c --no-conf -c -j ${_MAXNUM} -x ${_MAXCONPERSRV} -s ${_SPLITCON} -i ${DLLIST} --min-split-size=${_MINSPLITSZ} --stream-piece-selector=${_PIECEALGO} --connect-timeout=60 --timeout=600 -m0'
|
||||
|
||||
# Load config file.
|
||||
CONFFILE="/tmp/aptss-conf/apt-fast.conf"
|
||||
#### Spark Store apt-fast conf is in /tmp
|
||||
if [ -e "$CONFFILE" ]; then
|
||||
source "$CONFFILE"
|
||||
fi
|
||||
# 定义默认的配置文件列表(按加载顺序排列)
|
||||
CONFIG_FILES=(
|
||||
"/tmp/aptss-conf/apt-fast.conf" # 原始配置文件位置
|
||||
"/etc/aptss/apt-fast.conf" # 系统级配置
|
||||
)
|
||||
|
||||
|
||||
# 按顺序加载所有配置文件
|
||||
for conf_file in "${CONFIG_FILES[@]}"; do
|
||||
if [ -e "$conf_file" ]; then
|
||||
source "$conf_file"
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
|
||||
# no proxy as default
|
||||
ftp_proxy=
|
||||
@@ -188,7 +215,6 @@ https_proxy=
|
||||
[ "$TMP_APTCACHE" = "$TMP_RANDOM" ] || APTCACHE="$TMP_APTCACHE"
|
||||
[ "$TMP_DLDIR" = "$TMP_RANDOM" ] || DLDIR="$TMP_DLDIR"
|
||||
[ "$TMP_DLLIST" = "$TMP_RANDOM" ] || DLLIST="$TMP_DLLIST"
|
||||
[ "$TMP_LISTDIR" = "$TMP_RANDOM" ] || LISTDIR="$TMP_LISTDIR"
|
||||
[ "$TMP__MAXNUM" = "$TMP_RANDOM" ] || _MAXNUM="$TMP__MAXNUM"
|
||||
[ "$TMP__MAXCONPERSRV" = "$TMP_RANDOM" ] || _MAXCONPERSRV="$TMP__MAXCONPERSRV"
|
||||
[ "$TMP__SPLITCON" = "$TMP_RANDOM" ] || _SPLITCON="$TMP__SPLITCON"
|
||||
@@ -196,6 +222,7 @@ https_proxy=
|
||||
[ "$TMP__PIECEALGO" = "$TMP_RANDOM" ] || _PIECEALGO="$TMP__PIECEALGO"
|
||||
[ "$TMP_aptfast_prefix" = "$TMP_RANDOM" ] || aptfast_prefix="$TMP_aptfast_prefix"
|
||||
[ "$TMP_APT_FAST_TIMEOUT" = "$TMP_RANDOM" ] || APT_FAST_TIMEOUT="$TMP_APT_FAST_TIMEOUT"
|
||||
[ "$TMP_APT_FAST_APT_AUTH" = "$TMP_RANDOM" ] || APT_FAST_APT_AUTH="$TMP_APT_FAST_APT_AUTH"
|
||||
[ "$TMP_VERBOSE_OUTPUT" = "$TMP_RANDOM" ] || VERBOSE_OUTPUT="$TMP_VERBOSE_OUTPUT"
|
||||
[ "$TMP_ftp_proxy" = "$TMP_RANDOM" ] || ftp_proxy="$TMP_ftp_proxy"
|
||||
[ "$TMP_http_proxy" = "$TMP_RANDOM" ] || http_proxy="$TMP_http_proxy"
|
||||
@@ -231,17 +258,25 @@ _create_lock()
|
||||
{
|
||||
eval "exec $LCK_FD>\"$LCK_FILE.lock\""
|
||||
|
||||
# trap "cleanup_aptfast; exit_cleanup_state" EXIT
|
||||
# This will hide the exit code
|
||||
# 设置 trap 来清理资源
|
||||
trap "cleanup_aptfast" EXIT
|
||||
trap "cleanup_aptfast; exit 1" INT TERM
|
||||
timer=0
|
||||
until $(flock -xn $LCK_FD);do
|
||||
msg_already_running
|
||||
sleep 1
|
||||
let timer+=1
|
||||
done
|
||||
unset timer
|
||||
|
||||
timer=0
|
||||
max_wait=180 # 最大等待时间为180秒(3分钟)
|
||||
|
||||
until $(flock -xn $LCK_FD); do
|
||||
msg_already_running
|
||||
sleep 1
|
||||
let timer+=1
|
||||
|
||||
if [ $timer -ge $max_wait ]; then
|
||||
echo "timeout"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
unset timer
|
||||
}
|
||||
|
||||
# unlock and remove the lock file
|
||||
@@ -271,7 +306,8 @@ cleanup_dllist()
|
||||
|
||||
cleanup_aptfast()
|
||||
{
|
||||
[ "$CLEANUP_STATE" -eq 0 ] && CLEANUP_STATE=$?
|
||||
local last_exit_code=$?
|
||||
[ "$CLEANUP_STATE" -eq 0 ] && CLEANUP_STATE=$last_exit_code
|
||||
cleanup_dllist
|
||||
_remove_lock
|
||||
}
|
||||
@@ -300,7 +336,7 @@ get_mirrors(){
|
||||
for mirror in "${mirrors[@]}"; do
|
||||
# Real expension.
|
||||
if [[ "$1" == "$mirror"* ]]; then
|
||||
filepath=${1#${mirror}}
|
||||
filepath="${1#"${mirror}"}"
|
||||
# Build list for aria download list.
|
||||
list="${mirrors[*]:1}"
|
||||
echo -e "${list// /${filepath}\\t}$filepath\n"
|
||||
@@ -311,75 +347,132 @@ get_mirrors(){
|
||||
# No other mirrors found.
|
||||
echo "$1"
|
||||
}
|
||||
|
||||
##########SPARK ADJUST: END
|
||||
|
||||
AUTH_INFO_PARSED=()
|
||||
# Parse apt authentication files.
|
||||
# Undefined behavior on whitespaces in host, username or password.
|
||||
prepare_auth(){
|
||||
if [ "$APT_FAST_APT_AUTH" -eq 0 ]; then
|
||||
return
|
||||
fi
|
||||
for auth_file in "${APTAUTHFILES[@]}"; do
|
||||
# auth files have netrc syntax, possible multiline entries starting with "machine"
|
||||
auth_info="$(tr '\n' ' ' < "$auth_file" | sed 's/\(\<machine\>\)/\n\1/g' | sed '1d')"
|
||||
while IFS= read -r auth; do
|
||||
machine="$(echo "$auth" | sed 's/.*\<machine\>[ \t]\+\([^ \t]\+\).*/\1/')"
|
||||
login="$(echo "$auth" | sed 's/.*\<login\>[ \t]\+\([^ \t]\+\).*/\1/')"
|
||||
password="$(echo "$auth" | sed 's/.*\<password\>[ \t]\+\([^ \t]\+\).*/\1/')"
|
||||
# if machine does not have protocol, try https://
|
||||
if ! [[ "$machine" =~ ^.*:// ]]; then
|
||||
machine="https://$machine"
|
||||
fi
|
||||
if [ -z "$machine" ] || [ -z "$login" ] || [ -z "$password" ]; then
|
||||
msg "Could not parse apt authentication (skipping): $auth ($auth_file)" "warning"
|
||||
continue
|
||||
fi
|
||||
# use space separated string to convert back to array later
|
||||
AUTH_INFO_PARSED+=("$machine $login $password")
|
||||
done <<< "$auth_info"
|
||||
done
|
||||
if [ "${#AUTH_INFO_PARSED[@]}" -eq 0 ]; then
|
||||
# acts like auth disabled when no auth info is provided to improve performance
|
||||
APT_FAST_APT_AUTH=0
|
||||
fi
|
||||
}
|
||||
|
||||
# Gets URI as parameter and tries to add basic http credentials. Will fail on
|
||||
# credentials that contain characters that need URL-encoding.
|
||||
get_auth(){
|
||||
for auth_info in "${AUTH_INFO_PARSED[@]}"; do
|
||||
# convert to array, don't escape variable here
|
||||
auth_info_arr=($auth_info)
|
||||
machine="${auth_info_arr[0]}"
|
||||
# takes first match
|
||||
if [[ "$1" == "$machine"* ]]; then
|
||||
login="${auth_info_arr[1]}"
|
||||
password="${auth_info_arr[2]}"
|
||||
uri="$(echo "$1" | sed "s|^\([^:]\+://\)|\1$login:$password@|")"
|
||||
echo "$uri"
|
||||
return
|
||||
fi
|
||||
done
|
||||
echo "$1"
|
||||
}
|
||||
|
||||
# Globals to save package name, version, size and overall size.
|
||||
DOWNLOAD_DISPLAY=
|
||||
DOWNLOAD_SIZE=0
|
||||
|
||||
# 获取包的URI
|
||||
# Get the package URLs.
|
||||
get_uris(){
|
||||
|
||||
if [ ! -d "$(dirname "$DLLIST")" ]
|
||||
then
|
||||
if ! mkdir -p -- "$(dirname "$DLLIST")"
|
||||
then
|
||||
msg "Could not create download file directory." "warning"
|
||||
msg "无法创建下载文件夹" "warning"
|
||||
exit 1
|
||||
msg "无法创建下载目录" "warning"
|
||||
CLEANUP_STATE=1
|
||||
exit
|
||||
fi
|
||||
elif [ -f "$DLLIST" ]; then
|
||||
if ! rm -f -- "$DLLIST" 2>/dev/null && ! touch -- "$DLLIST" 2>/dev/null
|
||||
then
|
||||
msg "Unable to write to download file. Try restarting with root permissions or run 'aptss clean' first." "warning"
|
||||
msg "Unable to write to download file. Try restarting with root permissions or run 'apt-fast clean' first." "warning"
|
||||
msg "无法下载文件。尝试使用root权限,或者运行 'aptss clean'" "warning"
|
||||
exit 1
|
||||
CLEANUP_STATE=1
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
|
||||
# Add header to overwrite file.
|
||||
echo "# apt-fast mirror list: $(date)" > "$DLLIST"
|
||||
#NOTE: aptitude doesn't have this functionality, so we use apt-get to get
|
||||
# package URIs.
|
||||
# case "$_APTMGR" in
|
||||
# apt|apt-get) uri_mgr=$_APTMGR;;
|
||||
# *) uri_mgr=apt-get;;
|
||||
# esac
|
||||
# NOTE:apt可能出现变动,不建议在脚本中使用,因此在此统一改用apt-get
|
||||
uri_mgr=apt-get
|
||||
# NOTE: "aptitude" doesn't have this functionality
|
||||
# so we use "${_APTMGR}" to get package URI's
|
||||
case "$(basename "${_APTMGR}")" in
|
||||
'apt'|'apt-get') uri_mgr="${_APTMGR}";;
|
||||
*) uri_mgr='apt-get';;
|
||||
esac
|
||||
uris_full="$("$uri_mgr" "${APT_SCRIPT_WARNING[@]}" -y --print-uris "$@")"
|
||||
uris_full_ret="$?"
|
||||
if [ "$uris_full_ret" -ne 0 ]
|
||||
CLEANUP_STATE="$?"
|
||||
if [ "$CLEANUP_STATE" -ne 0 ]
|
||||
then
|
||||
msg "Package manager quit with exit code.Here is the log" "warning"
|
||||
msg "Package manager quit with exit code. Here is the log" "warning"
|
||||
msg "包管理器以错误代码退出.日志如下" "warning"
|
||||
msg "${uris_full}"
|
||||
exit "$uris_full_ret"
|
||||
exit "$CLEANUP_STATE"
|
||||
fi
|
||||
while read -r pkg_uri_info
|
||||
do
|
||||
[ -z "$pkg_uri_info" ] && continue
|
||||
## --print-uris format is:
|
||||
# 'fileurl' filename filesize checksum_hint:filechecksum
|
||||
uri="$(echo "$pkg_uri_info" | cut -d' ' -f1 | tr -d "'")"
|
||||
filename="$(echo "$pkg_uri_info" | cut -d' ' -f2)"
|
||||
filesize="$(echo "$pkg_uri_info" | cut -d' ' -f3)"
|
||||
checksum_string="$(echo "$pkg_uri_info" | cut -d' ' -f4)"
|
||||
hash_algo="$(echo "$checksum_string" | cut -d':' -f1)"
|
||||
checksum="$(echo "$checksum_string" | cut -d':' -f2)"
|
||||
|
||||
filename_decoded="$(urldecode "$filename")"
|
||||
DOWNLOAD_DISPLAY="${DOWNLOAD_DISPLAY}$(echo "$filename_decoded" | cut -d'_' -f1)"
|
||||
DOWNLOAD_DISPLAY="${DOWNLOAD_DISPLAY} $(echo "$filename_decoded" | cut -d'_' -f2)"
|
||||
DOWNLOAD_DISPLAY="${DOWNLOAD_DISPLAY} $(echo "$filesize" | numfmt --to=iec-i --suffix=B)\n"
|
||||
DOWNLOAD_SIZE=$((DOWNLOAD_SIZE + filesize))
|
||||
|
||||
## whole uri comes encoded (urlencoded). Filename must NOT be decoded because
|
||||
# plain aptitude do not decode it when download and install it. Therefore, we
|
||||
# will have ugly named packages at /var/cache/apt/archives but is the standard
|
||||
# behavior.
|
||||
# But package version must be decoded, otherways package=version calls will
|
||||
# not work.
|
||||
prepare_auth
|
||||
local tmpdir
|
||||
tmpdir=$(mktemp -d) || {
|
||||
msg "Failed to create tmp dir" "warning"
|
||||
msg "无法创建临时目录" "warning"
|
||||
exit 1
|
||||
}
|
||||
## --print-uris format is:
|
||||
# 'fileurl' filename filesize checksum_hint:filechecksum
|
||||
# 修改:process_package函数增加第二个参数表示当前线程的临时输出文件
|
||||
process_package() {
|
||||
local pkg_uri_info="$1"
|
||||
local thread_file="$2"
|
||||
local display_line="" # 初始化显示信息为空
|
||||
IFS=' ' read -r uri filename filesize checksum_string _ <<<"$pkg_uri_info"
|
||||
[ -z "$uri" ] && return
|
||||
uri="${uri//"'"/}"
|
||||
[ "$APT_FAST_APT_AUTH" -ne 0 ] && uri="$(get_auth "$uri")"
|
||||
IFS=':' read -r hash_algo checksum _ <<<"$checksum_string"
|
||||
|
||||
if [[ "$filename" == *%* ]]; then
|
||||
# decode url string
|
||||
filename_decoded="$(printf '%b' "${filename//%/\\x}")"
|
||||
else
|
||||
filename_decoded="$filename"
|
||||
fi
|
||||
IFS='_' read -r pkg_name_decoded pkg_version_decoded _ <<<"$filename_decoded"
|
||||
|
||||
display_line+="$pkg_name_decoded $pkg_version_decoded $filesize\n"
|
||||
if [ -n "$HASH_SUPPORTED" ]; then
|
||||
case "$hash_algo" in
|
||||
SHA512) [ -z "$SHA512_SUPPORTED" ] && hash_algo= || hash_algo=sha-512 ;;
|
||||
@@ -389,40 +482,44 @@ uri_mgr=apt-get
|
||||
*) hash_algo=
|
||||
esac
|
||||
|
||||
# Using apt-cache show package=version to ensure recover single and
|
||||
|
||||
# Using apt-cache show package=version to ensure recover single and
|
||||
# correct package version.
|
||||
# Warning: assuming that package naming uses '_' as field separator.
|
||||
# Therefore, this code expects package-name_version_arch.deb Otherways
|
||||
# Therefore, this code expects package-name_version_arch.deb Otherwise
|
||||
# below code will fail resoundingly
|
||||
if [ -z "$hash_algo" ]; then
|
||||
pkg_name="$(echo "$filename" | cut -d'_' -f1)"
|
||||
pkg_version="$(echo "$filename" | cut -d'_' -f2)"
|
||||
pkg_version="$(urldecode "$pkg_version")"
|
||||
package_info="$(apt-cache show "$pkg_name=$pkg_version")"
|
||||
IFS='_' read -r pkg_name _ <<<"$filename"
|
||||
pkg_version="$pkg_version_decoded"
|
||||
# Transform multi-line field output from apt-cache to single line and sort checksums, strongest first
|
||||
package_info="$(apt-cache show "$pkg_name=$pkg_version" | sed ':r;$!{N;br};s/\n / /g' | sort -r)"
|
||||
|
||||
patch_checksum=
|
||||
if [ -n "$SHA512_SUPPORTED" ]; then
|
||||
patch_checksum="$(echo "$package_info" | grep SHA512 | head -n 1)"
|
||||
[ -n "$patch_checksum" ] && hash_algo="sha-512"
|
||||
fi
|
||||
if [ -z "$patch_checksum" ] && [ -n "$SHA256_SUPPORTED" ]; then
|
||||
patch_checksum="$(echo "$package_info" | grep SHA256 | head -n 1)"
|
||||
[ -n "$patch_checksum" ] && hash_algo="sha-256"
|
||||
fi
|
||||
if [ -z "$patch_checksum" ] && [ -n "$SHA1_SUPPORTED" ]; then
|
||||
patch_checksum="$(echo "$package_info" | grep SHA1 | head -n 1)"
|
||||
[ -n "$patch_checksum" ] && hash_algo="sha-1"
|
||||
fi
|
||||
if [ -z "$patch_checksum" ] && [ -n "$MD5sum_SUPPORTED" ]; then
|
||||
patch_checksum="$(echo "$package_info" | grep MD5sum | head -n 1)"
|
||||
[ -n "$patch_checksum" ] && hash_algo="md5"
|
||||
fi
|
||||
while IFS=': ' read -r field checksum _
|
||||
do
|
||||
case "$field" in
|
||||
SHA512)
|
||||
[ -n "$SHA512_SUPPORTED" ] || continue
|
||||
hash_algo="sha-512"
|
||||
break ;;
|
||||
SHA256)
|
||||
[ -n "$SHA256_SUPPORTED" ] || continue
|
||||
hash_algo="sha-256"
|
||||
break ;;
|
||||
SHA1)
|
||||
[ -n "$SHA1_SUPPORTED" ] || continue
|
||||
hash_algo="sha-1"
|
||||
break ;;
|
||||
MD5sum)
|
||||
[ -n "$MD5sum_SUPPORTED" ] || continue
|
||||
hash_algo="md5"
|
||||
break ;;
|
||||
esac
|
||||
done <<<"$package_info"
|
||||
|
||||
if [ -n "$patch_checksum" ]; then
|
||||
checksum="$(echo "$patch_checksum" | cut -d' ' -f2)"
|
||||
else
|
||||
if [ -z "$hash_algo" ]; then
|
||||
checksum=
|
||||
msg "Couldn't get supported checksum for $pkg_name ($pkg_version)." "warning"
|
||||
msg "无法获得 $pkg_name ($pkg_version) 的受支持的散列验证值" "warning"
|
||||
msg "无法获得 $pkg_name ($pkg_version) 版本受到支持的散列验证值" "warning"
|
||||
REMOVE_WORKING_MESSAGE=
|
||||
fi
|
||||
fi
|
||||
@@ -430,21 +527,68 @@ uri_mgr=apt-get
|
||||
hash_algo=
|
||||
fi
|
||||
|
||||
# 原来利用文件锁写入,现在改为写入当前线程的临时文件
|
||||
{
|
||||
get_mirrors "$uri"
|
||||
#echo " dir=$DLDIR"
|
||||
if [ -n "$hash_algo" ]; then
|
||||
echo " checksum=$hash_algo=$checksum"
|
||||
fi
|
||||
[ -n "$hash_algo" ] && echo " checksum=$hash_algo=$checksum"
|
||||
echo " out=$filename"
|
||||
} >> "$DLLIST"
|
||||
done <<<"$(echo "$uris_full" | grep -E "^'(http(s|)|(s|)ftp)://")"
|
||||
} >> "$thread_file"
|
||||
|
||||
#cat "$DLLIST"
|
||||
#LCK_RM
|
||||
#exit
|
||||
echo -e "$display_line" >> "$tmpdir/display"
|
||||
echo "$filesize" >> "$tmpdir/sizes"
|
||||
}
|
||||
|
||||
# 主并行处理逻辑
|
||||
mapfile -t pkg_uri_list < <(echo "$uris_full" | grep -E "^'(http(s|)|(s|)ftp)://")
|
||||
total_pkgs=${#pkg_uri_list[@]}
|
||||
threads=${THREADS:-4} # 默认4线程
|
||||
per_thread=$(( (total_pkgs + threads - 1) / threads )) # 向上取整
|
||||
|
||||
# 分配任务到不同线程,每个线程使用自己的临时文件
|
||||
for ((i=0; i<threads; i++)); do
|
||||
thread_file="${DLLIST}.thread.${i}"
|
||||
> "$thread_file" # 清空或创建临时文件
|
||||
start=$((i * per_thread))
|
||||
end=$((start + per_thread -1))
|
||||
[ $end -ge $total_pkgs ] && end=$((total_pkgs -1))
|
||||
|
||||
# 启动后台线程处理任务块
|
||||
(
|
||||
for ((j=start; j<=end; j++)); do
|
||||
[ -z "${pkg_uri_list[j]}" ] && continue
|
||||
process_package "${pkg_uri_list[j]}" "$thread_file"
|
||||
done
|
||||
) &
|
||||
done
|
||||
|
||||
# 等待所有后台任务完成
|
||||
wait
|
||||
|
||||
# 合并所有线程的临时文件到最终的 $DLLIST 中(保留之前添加的 header)
|
||||
for ((i=0; i<threads; i++)); do
|
||||
thread_file="${DLLIST}.thread.${i}"
|
||||
if [ -f "$thread_file" ]; then
|
||||
cat "$thread_file" >> "$DLLIST"
|
||||
rm -f "$thread_file"
|
||||
fi
|
||||
done
|
||||
|
||||
# 合并显示信息
|
||||
if [ -f "$tmpdir/display" ]; then
|
||||
DOWNLOAD_DISPLAY+="\n$(cat "$tmpdir/display")"
|
||||
fi
|
||||
|
||||
# 计算总下载大小
|
||||
if [ -f "$tmpdir/sizes" ]; then
|
||||
DOWNLOAD_SIZE=$(awk '{sum+=$1} END{print sum}' "$tmpdir/sizes")
|
||||
fi
|
||||
|
||||
# 清理临时目录
|
||||
rm -rf "$tmpdir"
|
||||
}
|
||||
|
||||
|
||||
|
||||
display_downloadfile(){
|
||||
if [ -n "$VERBOSE_OUTPUT" ]; then
|
||||
cat "$DLLIST"
|
||||
@@ -452,18 +596,16 @@ display_downloadfile(){
|
||||
DISPLAY_SORT_OPTIONS=(-k 1,1)
|
||||
# Sort output after package download size (decreasing):
|
||||
#DISPLAY_SORT_OPTIONS=(-k 3,3 -hr)
|
||||
while read -r line; do
|
||||
[ -z "$line" ] && continue
|
||||
pkg="$(echo "$line" | cut -d' ' -f1)"
|
||||
ver="$(echo "$line" | cut -d' ' -f2)"
|
||||
size="$(echo "$line" | cut -d' ' -f3)"
|
||||
while IFS=' ' read -r pkg ver size _; do
|
||||
[ -z "$pkg" ] && continue
|
||||
printf '%s%-40s %-20s %10s\n' "$aptfast_prefix" "$pkg" "$ver" "$size"
|
||||
done <<<"$(echo -e "$DOWNLOAD_DISPLAY" | sort "${DISPLAY_SORT_OPTIONS[@]}")"
|
||||
done <<<"$(echo -e "$DOWNLOAD_DISPLAY" | sort "${DISPLAY_SORT_OPTIONS[@]}" | numfmt --to=iec-i --suffix=B --field=3)"
|
||||
fi
|
||||
msg "Download size: $(echo "$DOWNLOAD_SIZE" | numfmt --to=iec-i --suffix=B)" "normal"
|
||||
msg "下载大小: $(echo "$DOWNLOAD_SIZE" | numfmt --to=iec-i --suffix=B)" "normal"
|
||||
}
|
||||
|
||||
|
||||
# Create and insert a PID number to lockfile.
|
||||
|
||||
_create_lock
|
||||
@@ -473,19 +615,21 @@ CMD="$(echo "$_DOWNLOADER" | sed 's/^\s*\([^ ]\+\).*$/\1/')"
|
||||
if [ ! "$(command -v "$CMD")" ]; then
|
||||
msg "Command not found: $CMD" "normal" "err"
|
||||
msg "You must configure $CONFFILE to use aria2c or another supported download manager" "normal" "err"
|
||||
exit 1
|
||||
CLEANUP_STATE=1
|
||||
exit
|
||||
fi
|
||||
|
||||
# Make sure package manager is available.
|
||||
if [ ! "$(command -v "$_APTMGR")" ]; then
|
||||
msg "\`$_APTMGR\` command not available." "warning"
|
||||
msg "You must configure $CONFFILE to use either apt-get or aptitude." "normal" "err"
|
||||
exit 1
|
||||
CLEANUP_STATE=1
|
||||
exit
|
||||
fi
|
||||
|
||||
# Disable script warning if apt is used.
|
||||
APT_SCRIPT_WARNING=()
|
||||
if [ "$_APTMGR" == "apt" ]; then
|
||||
if [ "$(basename "${_APTMGR}")" == 'apt' ]; then
|
||||
APT_SCRIPT_WARNING=(-o "Apt::Cmd::Disable-Script-Warning=true")
|
||||
fi
|
||||
|
||||
@@ -532,6 +676,8 @@ while true; do
|
||||
d)
|
||||
DOWNLOAD_ONLY=true
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
done
|
||||
((OPTIND++))
|
||||
@@ -574,7 +720,7 @@ if [ "$option" == "install" ]; then
|
||||
msg "Do you want to download the packages? [Y/n] " "question"
|
||||
|
||||
while ((!updsys)); do
|
||||
read -r -sn1 -t "$APT_FAST_TIMEOUT" answer || { msg; msg "Timed out." "warning"; exit 1; }
|
||||
read -r -sn1 -t "$APT_FAST_TIMEOUT" answer || { msg; msg "Timed out." "warning"; CLEANUP_STATE=1; exit; }
|
||||
case "$answer" in
|
||||
[JjYy]) result=1; updsys=1 ;;
|
||||
[Nn]) result=0; updsys=1 ;;
|
||||
@@ -596,7 +742,7 @@ if [ "$option" == "install" ]; then
|
||||
mkdir -p -- "$DLDIR"
|
||||
fi
|
||||
|
||||
cd "$DLDIR" &>/dev/null || exit 1
|
||||
cd "$DLDIR" &>/dev/null || { msg; msg "Not able to change into download directory." "warning"; CLEANUP_STATE=1; exit; }
|
||||
|
||||
eval "${_DOWNLOADER}" # execute downloadhelper command
|
||||
if [ "$(find "$DLDIR" -printf . | wc -c)" -gt 1 ]; then
|
||||
@@ -616,22 +762,26 @@ if [ "$option" == "install" ]; then
|
||||
cd - &>/dev/null || msg "Failed to change back directory" "warning"
|
||||
fi
|
||||
else
|
||||
exit 1
|
||||
CLEANUP_STATE=1
|
||||
exit
|
||||
fi
|
||||
else
|
||||
[ -t 1 ] && tput el
|
||||
fi
|
||||
|
||||
if [ -z "$DOWNLOAD_ONLY" ] || [ "$_APTMGR" == "aptitude" ]; then
|
||||
# different problem resolving for aptitude
|
||||
if [ -z "$DOWNLOAD_ONLY" ] || [ "$(basename "${_APTMGR}")" == 'aptitude' ]; then
|
||||
"${_APTMGR}" "${APT_SCRIPT_WARNING[@]}" "$@"
|
||||
fi
|
||||
|
||||
|
||||
elif [ "$option" == "clean" ]; then
|
||||
"${_APTMGR}" "${APT_SCRIPT_WARNING[@]}" "$@" && {
|
||||
find "$DLDIR" -maxdepth 1 -type f -delete
|
||||
CLEANUP_STATE="$?"
|
||||
[ -f "$DLLIST" ] && rm -f -- "$DLLIST"* || true
|
||||
if [ -d "$DLDIR" ]; then
|
||||
find "$DLDIR" -maxdepth 1 -type f -delete
|
||||
CLEANUP_STATE="$?"
|
||||
[ -f "$DLLIST" ] && rm -f -- "$DLLIST"* || true
|
||||
fi
|
||||
}
|
||||
|
||||
elif [ "$option" == "download" ]; then
|
||||
@@ -649,7 +799,8 @@ elif [ "$option" == "download" ]; then
|
||||
eval "${_DOWNLOADER}"
|
||||
fi
|
||||
|
||||
if [ "$_APTMGR" == "aptitude" ]; then
|
||||
# different problem resolving for aptitude
|
||||
if [ "$(basename "${_APTMGR}")" == 'aptitude' ]; then
|
||||
"${_APTMGR}" "$@"
|
||||
fi
|
||||
|
||||
@@ -685,3 +836,4 @@ else
|
||||
fi
|
||||
|
||||
# After error or all done remove our lockfile (done with EXIT trap)
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ source /opt/durapps/spark-store/bin/bashimport/log.amber
|
||||
load_transhell
|
||||
|
||||
case `arch` in
|
||||
x86_64)
|
||||
x86_64 | i686 | i386)
|
||||
STORE_URL="store"
|
||||
STORE_LIST_URL=""
|
||||
;;
|
||||
|
||||
591
tool/ssaudit
@@ -1,149 +1,520 @@
|
||||
#!/bin/bash
|
||||
# 初始化常量和全局变量
|
||||
readonly SPARK_DOWNLOAD_SERVER_URL="https://d.spark-app.store/"
|
||||
readonly SPARK_DOWNLOAD_SERVER_URL_NO_PROTOCOL="d.spark-app.store"
|
||||
# ACE环境配置 - 修改此数组即可添加或删除支持的环境——记得修改 store-helper 里的 uninstaller check-is-installed 和 ss-launcher
|
||||
readonly ACE_ENVIRONMENTS=(
|
||||
"bookworm-run:amber-ce-bookworm"
|
||||
"trixie-run:amber-ce-trixie"
|
||||
"deepin23-run:amber-ce-deepin23"
|
||||
"sid-run:amber-ce-sid"
|
||||
)
|
||||
readonly ACE_ENVIRONMENTS_FOR_AUTOINSTALL=(
|
||||
"bookworm-run:amber-ce-bookworm"
|
||||
"trixie-run:amber-ce-trixie"
|
||||
)
|
||||
function get_current_user() {
|
||||
# 优先通过 who 命令获取用户
|
||||
local user
|
||||
user=$(who | awk '{print $1}' | head -n 1 2>/dev/null)
|
||||
|
||||
source /opt/durapps/spark-store/bin/bashimport/transhell.amber
|
||||
load_transhell_debug
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
case $(arch) in
|
||||
x86_64)
|
||||
STORE_URL="store"
|
||||
;;
|
||||
aarch64)
|
||||
STORE_URL="aarch64-store"
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Spark Store Install script. 星火商店审核脚本"
|
||||
|
||||
function pkexec_as_current_user() {
|
||||
local user=$(who | awk '{print $1}' | head -n 1)
|
||||
local uid=$(id -u "$user")
|
||||
sudo -u "$user" DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/"$uid"/bus pkexec "$@"
|
||||
}
|
||||
function create_desktop_file() {
|
||||
local user=$(who | awk '{print $1}' | head -n 1)
|
||||
if [ -e $(sudo -u "$user" xdg-user-dir)/.config/spark-union/spark-store/ssshell-config-do-not-create-desktop ];then
|
||||
echo "It is configured that do not create desktop file. Give up"
|
||||
else
|
||||
exec_create_desktop_file
|
||||
fi
|
||||
}
|
||||
function exec_create_desktop_file() {
|
||||
local user=$(who | awk '{print $1}' | head -n 1)
|
||||
for desktop_file_path in $(dpkg -L "$package_name" |grep /usr/share/applications/ | awk '/\.desktop$/ {print}'); do
|
||||
if [ "$(cat $desktop_file_path | grep NoDisplay=true)" = "" ];then
|
||||
echo $desktop_file_path is checked and will be installed to desktop
|
||||
sudo -u "$user" cp "$desktop_file_path" "$(sudo -u "$user" xdg-user-dir DESKTOP)/"
|
||||
fi
|
||||
done
|
||||
for desktop_file_path in $(dpkg -L "$package_name" |grep /opt/apps/$package_name/entries/applications | awk '/\.desktop$/ {print}'); do
|
||||
if [ "$(cat $desktop_file_path | grep NoDisplay=true)" = "" ];then
|
||||
echo $desktop_file_path is checked and will be installed to desktop
|
||||
chmod +x $desktop_file_path
|
||||
sudo -u "$user" cp "$desktop_file_path" "$(sudo -u "$user" xdg-user-dir DESKTOP)/"
|
||||
fi
|
||||
done
|
||||
|
||||
# 如果 who 无输出,则通过 loginctl 获取
|
||||
if [[ -z "$user" ]]; then
|
||||
user=$(loginctl list-sessions --no-legend 2>/dev/null | awk '{print $3}' | head -n 1)
|
||||
fi
|
||||
|
||||
# 返回最终结果(可能为空)
|
||||
echo "${user}"
|
||||
}
|
||||
|
||||
function zenity() {
|
||||
local user=$(who | awk '{print $1}' | head -n 1)
|
||||
local user=$(get_current_user)
|
||||
local uid=$(id -u "$user")
|
||||
sudo -u "$user" DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/"$uid"/bus zenity "$@"
|
||||
}
|
||||
|
||||
function hash_check() {
|
||||
if [ ! -e "/var/lib/aptss/lists/cdn.d.store.deepinos.org.cn_${STORE_URL}_Packages" ] && \
|
||||
[ ! -e "/var/lib/aptss/lists/d.store.deepinos.org.cn_${STORE_URL}_Packages" ] && \
|
||||
[ ! -e "/var/lib/aptss/lists/mirrors.sdu.edu.cn_spark-store-repository_${STORE_URL}_Packages" ]; then
|
||||
echo "接收星火仓库软件信息中..."
|
||||
aptss ssupdate
|
||||
fi
|
||||
|
||||
if [ -e "/var/lib/aptss/lists/cdn.d.store.deepinos.org.cn_${STORE_URL}_Packages" ]; then
|
||||
PACKAGES_DATA_PATH="/var/lib/aptss/lists/cdn.d.store.deepinos.org.cn_${STORE_URL}_Packages"
|
||||
echo "星火仓库的Packages位置为 $PACKAGES_DATA_PATH,是星火域名单目录仓库配置"
|
||||
# 全局变量初始化(位于 parse_args 前)
|
||||
ACE_PARAMS=()
|
||||
|
||||
# 生成ACE环境参数帮助信息
|
||||
function generate_ace_help() {
|
||||
local help_text=""
|
||||
for ace_entry in "${ACE_ENVIRONMENTS[@]}"; do
|
||||
local ace_param="--${ace_entry#*:}"
|
||||
help_text+=" $ace_param 使用${ace_entry%%:*} ACE容器安装\n"
|
||||
done
|
||||
echo -e "$help_text"
|
||||
}
|
||||
source /opt/durapps/spark-store/bin/bashimport/transhell.amber
|
||||
# 脚本工作变量
|
||||
DELETE_AFTER_INSTALL="0"
|
||||
DEBPATH=""
|
||||
FORCE_ACE_ENV=""
|
||||
FORCE_NATIVE="0"
|
||||
NO_CREATE_DESKTOP="0"
|
||||
FORCE_CREATE_DESKTOP="0"
|
||||
|
||||
# 加载翻译和调试
|
||||
load_transhell_debug
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
# 根据架构设置仓库URL
|
||||
case $(arch) in
|
||||
x86_64) STORE_URL="store" ;;
|
||||
aarch64) STORE_URL="aarch64-store" ;;
|
||||
loongarch64) STORE_URL="loong64-store" ;;
|
||||
esac
|
||||
# 帮助函数
|
||||
function show_help() {
|
||||
echo "Spark Store Anstall script. 星火商店审核脚本"
|
||||
echo "用法: $0 [选项] <deb路径>"
|
||||
echo "选项:"
|
||||
echo " -h, --help 显示帮助信息"
|
||||
echo " --delete-after-install 安装成功后删除软件包"
|
||||
echo " --no-create-desktop-entry 不创建桌面快捷方式"
|
||||
echo " --force-create-desktop-entry 强制创建桌面快捷方式"
|
||||
echo "$(generate_ace_help)"
|
||||
echo " --native 只在主机安装,不使用ACE容器"
|
||||
}
|
||||
# 参数解析
|
||||
function parse_args() {
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
-h|--help)
|
||||
show_help
|
||||
exit 0
|
||||
;;
|
||||
--delete-after-install)
|
||||
DELETE_AFTER_INSTALL="1"
|
||||
shift
|
||||
;;
|
||||
--native)
|
||||
FORCE_NATIVE="1"
|
||||
shift
|
||||
;;
|
||||
--no-create-desktop-entry)
|
||||
NO_CREATE_DESKTOP="1"
|
||||
shift
|
||||
;;
|
||||
--force-create-desktop-entry)
|
||||
FORCE_CREATE_DESKTOP="1"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
# 检查是否为ACE环境参数
|
||||
local is_ace_param=0
|
||||
for ace_entry in "${ACE_ENVIRONMENTS[@]}"; do
|
||||
local ace_param="--${ace_entry#*:}"
|
||||
if [ "$1" = "$ace_param" ]; then
|
||||
# 将ACE环境命令名加入数组
|
||||
ACE_PARAMS+=("${ace_entry%%:*}")
|
||||
is_ace_param=1
|
||||
shift
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# 如果不是ACE环境参数,则视为DEB路径
|
||||
if [ "$is_ace_param" -eq 0 ]; then
|
||||
DEBPATH="$1"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
# 验证当前用户
|
||||
function validate_user() {
|
||||
if [ "$(id -u)" != "0" ]; then
|
||||
echo "${TRANSHELL_CONTENT_PLEASE_RUN_AS_ROOT}"
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# 验证文件存在或尝试下载
|
||||
function validate_or_download_file() {
|
||||
if [ ! -f "$1" ]; then
|
||||
echo "${TRANSHELL_CONTENT_FILE_NOT_EXIST},Trying to redownload"
|
||||
aptss update
|
||||
FILEPATH=$(dirname "$1")
|
||||
FILENAME=$(basename "$1")
|
||||
PACKAGE_NAME=$(echo "$FILENAME" | sed -r 's/^([^_]+)_.*$/\1/')
|
||||
VERSION=$(echo "$FILENAME" | sed -r 's/^[^_]+_([^_]+)_.*$/\1/')
|
||||
pushd "${FILEPATH}" >/dev/null || exit 1
|
||||
aptss download "${PACKAGE_NAME}"
|
||||
popd >/dev/null || exit 1
|
||||
|
||||
if [ ! -f "$1" ]; then
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# 哈希校验
|
||||
function hash_check() {
|
||||
local PACKAGES_DATA_PATH=""
|
||||
|
||||
# 检查可能的仓库位置
|
||||
if [ -e "/var/lib/aptss/lists/${SPARK_DOWNLOAD_SERVER_URL_NO_PROTOCOL}_${STORE_URL}_Packages" ]; then
|
||||
PACKAGES_DATA_PATH="/var/lib/aptss/lists/${SPARK_DOWNLOAD_SERVER_URL_NO_PROTOCOL}_${STORE_URL}_Packages"
|
||||
elif [ -e "/var/lib/aptss/lists/d.store.deepinos.org.cn_${STORE_URL}_Packages" ]; then
|
||||
PACKAGES_DATA_PATH="/var/lib/aptss/lists/d.store.deepinos.org.cn_${STORE_URL}_Packages"
|
||||
echo "星火仓库的Packages位置为 $PACKAGES_DATA_PATH,是星火域名单目录仓库配置"
|
||||
else
|
||||
PACKAGES_DATA_PATH="/var/lib/aptss/lists/mirrors.sdu.edu.cn_spark-store-repository_${STORE_URL}_Packages"
|
||||
echo "星火仓库的Packages位置为 $PACKAGES_DATA_PATH,是SDU镜像仓库配置"
|
||||
fi
|
||||
|
||||
echo "正在运行包验证..."
|
||||
echo "Running Spark Package Verify..."
|
||||
|
||||
DEB_SHA512SUM=$(sha512sum "$1" | cut -d ' ' -f 1)
|
||||
IS_SHA512SUM_CHECKED=$(cat "$PACKAGES_DATA_PATH" | grep "$DEB_SHA512SUM")
|
||||
unset IS_SHA512SUM_CHECKED
|
||||
IS_SHA512SUM_CHECKED=$(grep -F "$DEB_SHA512SUM" "$PACKAGES_DATA_PATH")
|
||||
}
|
||||
|
||||
# 确保aptss存在
|
||||
function ensure_aptss_exist() {
|
||||
if ! command -v aptss &>/dev/null; then
|
||||
local deb_file="/tmp/spark-store-console-in-container_latest_all.deb"
|
||||
|
||||
if ! wget -O "$deb_file" "https://amber-ce-resource.spark-app.store/store/depends/spark-store-console-in-container_latest_all.deb"; then
|
||||
echo "下载 .deb 安装包失败" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
if ! apt install -y "$deb_file"; then
|
||||
echo "安装 .deb 包失败" >&2
|
||||
rm -f "$deb_file"
|
||||
return 1
|
||||
fi
|
||||
rm -f "$deb_file"
|
||||
|
||||
####################################
|
||||
if ! command -v aptss &>/dev/null; then
|
||||
echo "成功安装但未找到 aptss 命令" >&2
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
export -f ensure_aptss_exist
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "没有接收到参数,退出"
|
||||
echo "用法:$0 deb路径"
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ ! -f "$1" ]; then
|
||||
echo "${TRANSHELL_CONTENT_FILE_NOT_EXIST}"
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$(id -u)" != "0" ]; then
|
||||
echo "${TRANSHELL_CONTENT_PLEASE_RUN_AS_ROOT}"
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DEBPATH=$(realpath "$1")
|
||||
|
||||
|
||||
|
||||
package_name=$(dpkg-deb -f "$DEBPATH" Package)
|
||||
echo "Package name is $package_name"
|
||||
# 确保ACE环境存在
|
||||
function ensure_ace_env() {
|
||||
local ace_env_pkg="${1}"
|
||||
|
||||
try_run_output=$(/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh test-install-app "$DEBPATH")
|
||||
try_run_ret="$?"
|
||||
if [ "$try_run_ret" -ne 0 ]; then
|
||||
aptss update
|
||||
try_run_output=$(/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh test-install-app "$DEBPATH")
|
||||
try_run_ret="$?"
|
||||
if ! dpkg -l "$ace_env_pkg" &>/dev/null; then
|
||||
echo "ACE环境$ace_env_pkg未安装,正在尝试安装..."
|
||||
zenity --info --text="首次使用$ace_env_pkg环境,重启或注销桌面后才能在启动器中展示,不影响应用启动。安装将在后台继续。" --title="ACE环境安装" &
|
||||
if ! aptss install -y "$ace_env_pkg"; then
|
||||
echo "安装$ace_env_pkg失败"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$try_run_ret" -ne 0 ]; then
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
echo -e "${try_run_output}"
|
||||
exit "$try_run_ret"
|
||||
return 0
|
||||
}
|
||||
export user=$(who | awk '{print $1}' | head -n 1)
|
||||
# 在桌面创建快捷方式
|
||||
function create_desktop_file() {
|
||||
# 如果明确要求不要创建或明确要创建,则跳过配置文件检查
|
||||
if [ "$NO_CREATE_DESKTOP" -eq 1 ]; then
|
||||
echo "根据参数要求,跳过创建桌面快捷方式"
|
||||
return
|
||||
fi
|
||||
|
||||
if [ "$FORCE_CREATE_DESKTOP" -eq 0 ]; then
|
||||
if [ -e "$(sudo -u "$user" xdg-user-dir)/.config/spark-union/spark-store/ssshell-config-do-not-create-desktop" ]; then
|
||||
echo "根据配置要求,跳过创建桌面快捷方式"
|
||||
return
|
||||
fi
|
||||
fi
|
||||
|
||||
exec_create_desktop_file
|
||||
}
|
||||
export CURRENT_USER_DIR_DESKTOP=$(sudo -u "$user" xdg-user-dir DESKTOP)
|
||||
function exec_create_desktop_file() {
|
||||
local desktop_files=()
|
||||
|
||||
# 收集所有桌面文件
|
||||
desktop_files+=($(dpkg -L "$package_name" | grep '/usr/share/applications/.*\.desktop$'))
|
||||
desktop_files+=($(dpkg -L "$package_name" | grep '/opt/apps/'"$package_name"'/entries/applications/.*\.desktop$'))
|
||||
|
||||
for desktop_file_path in "${desktop_files[@]}"; do
|
||||
if [ "$FORCE_CREATE_DESKTOP" -eq 1 ] || [ -z "$(grep 'NoDisplay=true' "$desktop_file_path")" ]; then
|
||||
echo "$desktop_file_path is checked and will be installed to desktop"
|
||||
chmod +x "$desktop_file_path"
|
||||
sudo -u "$user" cp "$desktop_file_path" "${CURRENT_USER_DIR_DESKTOP}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
export -f exec_create_desktop_file
|
||||
|
||||
dpkg -i "$DEBPATH" || aptss install "$DEBPATH" -yf
|
||||
# 在ACE环境中创建桌面快捷方式
|
||||
function create_desktop_in_ace() {
|
||||
local ace_cmd="$1"
|
||||
local package_name="$2"
|
||||
|
||||
# 如果明确要求不要创建,则直接返回
|
||||
if [ "$NO_CREATE_DESKTOP" -eq 1 ]; then
|
||||
echo "根据参数要求,跳过在ACE中创建桌面快捷方式"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# 如果是强制创建,或者没有配置禁止创建
|
||||
if [ "$FORCE_CREATE_DESKTOP" -eq 1 ] || ! $ace_cmd "[ -e ~/.config/spark-union/spark-store/ssshell-config-do-not-create-desktop ]"; then
|
||||
echo "在ACE环境中创建桌面快捷方式..."
|
||||
export -f exec_create_desktop_file
|
||||
export package_name
|
||||
export FORCE_CREATE_DESKTOP
|
||||
$ace_cmd "exec_create_desktop_file"
|
||||
else
|
||||
echo "根据ACE环境中的配置,跳过创建桌面快捷方式"
|
||||
fi
|
||||
}
|
||||
|
||||
if [ "$?" = "0" ] && [ "$2" = "--delete-after-install" ]; then
|
||||
if dpkg -s "$package_name" >/dev/null 2>&1; then
|
||||
echo "软件包已安装:$package_name"
|
||||
create_desktop_file
|
||||
rm "$DEBPATH"
|
||||
echo "${TRANSHELL_CONTENT_DEB_IS_DELETED}"
|
||||
# 在指定ACE环境中安装
|
||||
function install_in_ace_env() {
|
||||
local ace_cmd="$1"
|
||||
local deb_path="$2"
|
||||
local ace_env_pkg="${3#*:}"
|
||||
|
||||
if [ "$IS_ACE_ENV" != "" ] || command -v termux-chroot; then
|
||||
echo "无法在ACE/termux/小小电脑中安装ACE包"
|
||||
return 1
|
||||
fi
|
||||
if ! ensure_ace_env "$ace_env_pkg"; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "----------------------------------------"
|
||||
echo "正在尝试使用 $ace_cmd 环境安装..."
|
||||
echo "----------------------------------------"
|
||||
$ace_cmd "ensure_aptss_exist"
|
||||
|
||||
# 首先尝试dry-run测试
|
||||
if ! $ace_cmd "aptss install --dry-run '$deb_path'"; then
|
||||
echo "初始dry-run测试失败,尝试更新后重试..."
|
||||
$ace_cmd "aptss update"
|
||||
if ! $ace_cmd "aptss install --dry-run '$deb_path'"; then
|
||||
echo "dry-run测试仍然失败,放弃安装"
|
||||
echo "OMG_IT_GOES_WRONG"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# dry-run成功后执行实际安装
|
||||
$ace_cmd "aptss install store.spark-app.app-runtime-base --no-install-recommends -yfq"
|
||||
if $ace_cmd "dpkg -i '$deb_path' || aptss install '$deb_path' -yfq"; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# 在主机安装
|
||||
function install_in_host() {
|
||||
local deb_path="$1"
|
||||
|
||||
# 首先尝试dry-run测试
|
||||
if ! aptss install --dry-run "$deb_path"; then
|
||||
echo "初始dry-run测试失败,尝试更新后重试..."
|
||||
aptss update
|
||||
if ! aptss install --dry-run "$deb_path"; then
|
||||
echo "dry-run测试仍然失败,放弃安装"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# dry-run成功后执行实际安装
|
||||
if dpkg -i "$deb_path" || aptss install "$deb_path" -yfq; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# 自动尝试在各种环境中安装
|
||||
function auto_try_install() {
|
||||
local deb_path="$1"
|
||||
|
||||
# 首先尝试在主机安装
|
||||
if install_in_host "$deb_path"; then
|
||||
create_desktop_file
|
||||
return 0
|
||||
fi
|
||||
|
||||
# 如果主机安装失败,并非在ACE内运行且不在强制本地模式,尝试ACE环境
|
||||
if [ "$FORCE_NATIVE" -eq 0 ] && [ "$IS_ACE_ENV" = "" ] && ! command -v termux-chroot; then
|
||||
for ace_entry in "${ACE_ENVIRONMENTS_FOR_AUTOINSTALL[@]}"; do
|
||||
local ace_cmd=${ace_entry%%:*}
|
||||
local ace_env_pkg=${ace_entry#*:}
|
||||
|
||||
# 确保ACE环境存在
|
||||
if ensure_ace_env "$ace_env_pkg"; then
|
||||
if install_in_ace_env "$ace_cmd" "$deb_path" "$ace_env_pkg"; then
|
||||
# 在ACE环境中创建桌面快捷方式
|
||||
create_desktop_in_ace "$ace_cmd" "$package_name"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
return 1
|
||||
}
|
||||
# 清理安装后的文件
|
||||
function post_install_cleanup() {
|
||||
local success=$1
|
||||
local deb_path="$2"
|
||||
local package_name="$3"
|
||||
|
||||
if [ "$success" -eq 0 ] && [ "$DELETE_AFTER_INSTALL" -eq "1" ]; then
|
||||
# 检查是否安装在主机
|
||||
if [ "$FORCE_NATIVE" -eq 1 ] || [ -n "$FORCE_ACE_ENV" ]; then
|
||||
if [ "$FORCE_NATIVE" -eq 1 ]; then
|
||||
if dpkg -s "$package_name" >/dev/null 2>&1; then
|
||||
echo "软件包已在主机安装:$package_name"
|
||||
create_desktop_file
|
||||
unlock_file "$deb_path"
|
||||
rm "$deb_path"
|
||||
echo "${TRANSHELL_CONTENT_DEB_IS_DELETED}"
|
||||
else
|
||||
echo "软件包未在主机安装:$package_name"
|
||||
echo "安装异常!抛出错误"
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
# ACE环境中安装的情况,不检查主机dpkg数据库
|
||||
echo "软件包已在ACE环境安装:$package_name"
|
||||
unlock_file "$deb_path"
|
||||
rm "$deb_path"
|
||||
echo "${TRANSHELL_CONTENT_DEB_IS_DELETED}"
|
||||
fi
|
||||
else
|
||||
echo "软件包未安装:$package_name"
|
||||
echo "安装异常!抛出错误"
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
# 自动模式下,如果ACE安装成功也会走到这里
|
||||
echo "软件包已安装:$package_name"
|
||||
unlock_file "$deb_path"
|
||||
rm "$deb_path"
|
||||
echo "${TRANSHELL_CONTENT_DEB_IS_DELETED}"
|
||||
fi
|
||||
else
|
||||
echo "${TRANSHELL_CONTENT_WILL_NOT_DELETE_DEB}"
|
||||
if dpkg -s "$package_name" >/dev/null 2>&1; then
|
||||
echo "软件包已安装:$package_name"
|
||||
create_desktop_file
|
||||
else
|
||||
echo "软件包未安装:$package_name"
|
||||
if [ "$FORCE_NATIVE" -eq 1 ] && ! dpkg -s "$package_name" >/dev/null 2>&1; then
|
||||
echo "软件包未在主机安装:$package_name"
|
||||
echo "安装异常!抛出错误"
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
exit 1
|
||||
elif [ -n "$FORCE_ACE_ENV" ] && ! command -v "$FORCE_ACE_ENV" >/dev/null 2>&1; then
|
||||
echo "指定的ACE环境不可用"
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# 文件锁定/解锁函数
|
||||
function lock_file() {
|
||||
chattr +i "$1"
|
||||
}
|
||||
|
||||
function unlock_file() {
|
||||
if [ -e "$1" ];then
|
||||
chattr -i "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
# 主安装流程
|
||||
function main_install() {
|
||||
parse_args "$@"
|
||||
|
||||
if [ -z "$DEBPATH" ]; then
|
||||
echo "没有接收到参数,退出"
|
||||
show_help
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 设置退出时的文件解锁
|
||||
trap 'unlock_file $DEBPATH' EXIT
|
||||
validate_user
|
||||
validate_or_download_file "$DEBPATH"
|
||||
|
||||
DEBPATH=$(realpath "$DEBPATH")
|
||||
lock_file "$DEBPATH"
|
||||
|
||||
|
||||
|
||||
package_name=$(dpkg-deb -f "$DEBPATH" Package)
|
||||
local install_success=1
|
||||
if [ "$FORCE_NATIVE" -eq 1 ] || [ "$IS_ACE_ENV" = "1" ]; then
|
||||
# 优先使用主机安装,忽略所有ACE参数
|
||||
echo "忽略ACE,使用主机安装 $package_name"
|
||||
install_in_host "$DEBPATH"
|
||||
install_success=$?
|
||||
# 安装成功后在主机创建桌面快捷方式
|
||||
if [ "$install_success" -eq 0 ]; then
|
||||
create_desktop_file
|
||||
fi
|
||||
|
||||
elif [ ${#ACE_PARAMS[@]} -gt 0 ] && [ "$IS_ACE_ENV" = "" ]; then
|
||||
# 用户指定了一个或多个ACE环境,且未要求原生安装
|
||||
echo "使用ACE环境安装,已指定环境: ${ACE_PARAMS[*]}"
|
||||
|
||||
# 查找第一个已安装的ACE环境
|
||||
chosen_env=""
|
||||
for env_cmd in "${ACE_PARAMS[@]}"; do
|
||||
if command -v "$env_cmd" >/dev/null 2>&1; then
|
||||
chosen_env="$env_cmd"
|
||||
break
|
||||
fi
|
||||
done
|
||||
# 如果没有安装任何环境,则使用第一个指定的环境
|
||||
if [ -z "$chosen_env" ]; then
|
||||
chosen_env="${ACE_PARAMS[0]}"
|
||||
echo "未发现已安装的ACE环境,准备安装 $chosen_env..."
|
||||
# 查找对应的ACE环境软件包名
|
||||
for ace_entry in "${ACE_ENVIRONMENTS[@]}"; do
|
||||
if [ "${ace_entry%%:*}" = "$chosen_env" ]; then
|
||||
ace_pkg="${ace_entry#*:}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
# 安装ACE环境(示例使用aptss工具,可根据实际情况调整)
|
||||
ensure_ace_env "$ace_pkg" -y
|
||||
fi
|
||||
|
||||
# 再次确认ACE环境命令是否可用
|
||||
if command -v "$chosen_env" >/dev/null 2>&1; then
|
||||
# 查找软件包名(仅首次查找即可)
|
||||
for ace_entry in "${ACE_ENVIRONMENTS[@]}"; do
|
||||
if [ "${ace_entry%%:*}" = "$chosen_env" ]; then
|
||||
ace_pkg="${ace_entry#*:}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
echo "在 ACE 环境 $chosen_env 中安装 $package_name"
|
||||
install_in_ace_env "$chosen_env" "$DEBPATH" "$ace_pkg"
|
||||
install_success=$?
|
||||
if [ "$install_success" -eq 0 ]; then
|
||||
create_desktop_in_ace "$chosen_env" "$package_name"
|
||||
fi
|
||||
else
|
||||
echo "指定的ACE环境 $chosen_env 不可用"
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
else
|
||||
# 未指定ACE环境和--native,使用自动安装逻辑(先主机再ACE)
|
||||
echo "自动选择安装方式"
|
||||
auto_try_install "$DEBPATH"
|
||||
install_success=$?
|
||||
fi
|
||||
|
||||
post_install_cleanup "$install_success" "$DEBPATH" "$package_name"
|
||||
}
|
||||
|
||||
# 执行主函数
|
||||
main_install "$@"
|
||||
|
||||
643
tool/ssinstall
@@ -1,81 +1,170 @@
|
||||
#!/bin/bash
|
||||
# 初始化常量和全局变量
|
||||
readonly SPARK_DOWNLOAD_SERVER_URL="https://d.spark-app.store/"
|
||||
readonly SPARK_DOWNLOAD_SERVER_URL_NO_PROTOCOL="d.spark-app.store"
|
||||
# ACE环境配置 - 修改此数组即可添加或删除支持的环境——记得修改 store-helper 里的 uninstaller check-is-installed 和 ss-launcher
|
||||
readonly ACE_ENVIRONMENTS=(
|
||||
"bookworm-run:amber-ce-bookworm"
|
||||
"trixie-run:amber-ce-trixie"
|
||||
"deepin23-run:amber-ce-deepin23"
|
||||
"sid-run:amber-ce-sid"
|
||||
)
|
||||
readonly ACE_ENVIRONMENTS_FOR_AUTOINSTALL=(
|
||||
"bookworm-run:amber-ce-bookworm"
|
||||
"trixie-run:amber-ce-trixie"
|
||||
)
|
||||
function get_current_user() {
|
||||
# 优先通过 who 命令获取用户
|
||||
local user
|
||||
user=$(who | awk '{print $1}' | head -n 1 2>/dev/null)
|
||||
|
||||
source /opt/durapps/spark-store/bin/bashimport/transhell.amber
|
||||
load_transhell_debug
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
# 如果 who 无输出,则通过 loginctl 获取
|
||||
if [[ -z "$user" ]]; then
|
||||
user=$(loginctl list-sessions --no-legend 2>/dev/null | awk '{print $3}' | head -n 1)
|
||||
fi
|
||||
|
||||
trap 'unlock_file $DEBPATH' EXIT
|
||||
case $(arch) in
|
||||
x86_64)
|
||||
STORE_URL="store"
|
||||
;;
|
||||
aarch64)
|
||||
STORE_URL="aarch64-store"
|
||||
;;
|
||||
loongarch64)
|
||||
STORE_URL="loong64-store"
|
||||
STORE_LIST_URL="-loong64"
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Spark Store Install script. 星火商店安装脚本"
|
||||
|
||||
function pkexec_as_current_user() {
|
||||
local user=$(who | awk '{print $1}' | head -n 1)
|
||||
local uid=$(id -u "$user")
|
||||
sudo -u "$user" DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/"$uid"/bus pkexec "$@"
|
||||
# 返回最终结果(可能为空)
|
||||
echo "${user}"
|
||||
}
|
||||
function create_desktop_file() {
|
||||
local user=$(who | awk '{print $1}' | head -n 1)
|
||||
if [ -e $(sudo -u "$user" xdg-user-dir)/.config/spark-union/spark-store/ssshell-config-do-not-create-desktop ];then
|
||||
echo "It is configured that do not create desktop file. Give up"
|
||||
else
|
||||
exec_create_desktop_file
|
||||
fi
|
||||
}
|
||||
function exec_create_desktop_file() {
|
||||
local user=$(who | awk '{print $1}' | head -n 1)
|
||||
for desktop_file_path in $(dpkg -L "$package_name" |grep /usr/share/applications/ | awk '/\.desktop$/ {print}'); do
|
||||
if [ "$(cat $desktop_file_path | grep NoDisplay=true)" = "" ];then
|
||||
echo $desktop_file_path is checked and will be installed to desktop
|
||||
sudo -u "$user" cp "$desktop_file_path" "$(sudo -u "$user" xdg-user-dir DESKTOP)/"
|
||||
fi
|
||||
done
|
||||
for desktop_file_path in $(dpkg -L "$package_name" |grep /opt/apps/$package_name/entries/applications | awk '/\.desktop$/ {print}'); do
|
||||
if [ "$(cat $desktop_file_path | grep NoDisplay=true)" = "" ];then
|
||||
echo $desktop_file_path is checked and will be installed to desktop
|
||||
chmod +x $desktop_file_path
|
||||
sudo -u "$user" cp "$desktop_file_path" "$(sudo -u "$user" xdg-user-dir DESKTOP)/"
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function zenity() {
|
||||
local user=$(who | awk '{print $1}' | head -n 1)
|
||||
local user=$(get_current_user)
|
||||
local uid=$(id -u "$user")
|
||||
sudo -u "$user" DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/"$uid"/bus zenity "$@"
|
||||
}
|
||||
|
||||
function hash_check() {
|
||||
if [ ! -e "/var/lib/aptss/lists/d.spark-app.store_${STORE_URL}_Packages" ] && \
|
||||
[ ! -e "/var/lib/aptss/lists/d.store.deepinos.org.cn_${STORE_URL}_Packages" ] && \
|
||||
[ ! -e "/var/lib/aptss/lists/mirrors.sdu.edu.cn_spark-store_${STORE_URL}_Packages" ]; then
|
||||
echo "接收星火仓库软件信息中..."
|
||||
aptss ssupdate
|
||||
fi
|
||||
|
||||
if [ -e "/var/lib/aptss/lists/d.spark-app.store_${STORE_URL}_Packages" ]; then
|
||||
PACKAGES_DATA_PATH="/var/lib/aptss/lists/d.spark-app.store_${STORE_URL}_Packages"
|
||||
echo "星火仓库的Packages位置为 $PACKAGES_DATA_PATH,是星火域名仓库配置"
|
||||
# 全局变量初始化(位于 parse_args 前)
|
||||
ACE_PARAMS=()
|
||||
|
||||
# 生成ACE环境参数帮助信息
|
||||
function generate_ace_help() {
|
||||
local help_text=""
|
||||
for ace_entry in "${ACE_ENVIRONMENTS[@]}"; do
|
||||
local ace_param="--${ace_entry#*:}"
|
||||
help_text+=" $ace_param 使用${ace_entry%%:*} ACE容器安装\n"
|
||||
done
|
||||
echo -e "$help_text"
|
||||
}
|
||||
source /opt/durapps/spark-store/bin/bashimport/transhell.amber
|
||||
# 脚本工作变量
|
||||
DELETE_AFTER_INSTALL="0"
|
||||
DEBPATH=""
|
||||
FORCE_ACE_ENV=""
|
||||
FORCE_NATIVE="0"
|
||||
NO_CREATE_DESKTOP="0"
|
||||
FORCE_CREATE_DESKTOP="0"
|
||||
|
||||
# 加载翻译和调试
|
||||
load_transhell_debug
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
# 根据架构设置仓库URL
|
||||
case $(arch) in
|
||||
x86_64) STORE_URL="store" ;;
|
||||
aarch64) STORE_URL="aarch64-store" ;;
|
||||
loongarch64) STORE_URL="loong64-store" ;;
|
||||
esac
|
||||
# 帮助函数
|
||||
function show_help() {
|
||||
echo "Spark Store Install script. 星火商店安装脚本"
|
||||
echo "用法: $0 [选项] <deb路径>"
|
||||
echo "选项:"
|
||||
echo " -h, --help 显示帮助信息"
|
||||
echo " --delete-after-install 安装成功后删除软件包"
|
||||
echo " --no-create-desktop-entry 不创建桌面快捷方式"
|
||||
echo " --force-create-desktop-entry 强制创建桌面快捷方式"
|
||||
echo "$(generate_ace_help)"
|
||||
echo " --native 只在主机安装,不使用ACE容器"
|
||||
}
|
||||
# 参数解析
|
||||
function parse_args() {
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
-h|--help)
|
||||
show_help
|
||||
exit 0
|
||||
;;
|
||||
--delete-after-install)
|
||||
DELETE_AFTER_INSTALL="1"
|
||||
shift
|
||||
;;
|
||||
--native)
|
||||
FORCE_NATIVE="1"
|
||||
shift
|
||||
;;
|
||||
--no-create-desktop-entry)
|
||||
NO_CREATE_DESKTOP="1"
|
||||
shift
|
||||
;;
|
||||
--force-create-desktop-entry)
|
||||
FORCE_CREATE_DESKTOP="1"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
# 检查是否为ACE环境参数
|
||||
local is_ace_param=0
|
||||
for ace_entry in "${ACE_ENVIRONMENTS[@]}"; do
|
||||
local ace_param="--${ace_entry#*:}"
|
||||
if [ "$1" = "$ace_param" ]; then
|
||||
# 将ACE环境命令名加入数组
|
||||
ACE_PARAMS+=("${ace_entry%%:*}")
|
||||
is_ace_param=1
|
||||
shift
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# 如果不是ACE环境参数,则视为DEB路径
|
||||
if [ "$is_ace_param" -eq 0 ]; then
|
||||
DEBPATH="$1"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
# 验证当前用户
|
||||
function validate_user() {
|
||||
if [ "$(id -u)" != "0" ]; then
|
||||
echo "${TRANSHELL_CONTENT_PLEASE_RUN_AS_ROOT}"
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# 验证文件存在或尝试下载
|
||||
function validate_or_download_file() {
|
||||
if [ ! -f "$1" ]; then
|
||||
echo "${TRANSHELL_CONTENT_FILE_NOT_EXIST},Trying to redownload"
|
||||
aptss update
|
||||
FILEPATH=$(dirname "$1")
|
||||
FILENAME=$(basename "$1")
|
||||
PACKAGE_NAME=$(echo "$FILENAME" | sed -r 's/^([^_]+)_.*$/\1/')
|
||||
VERSION=$(echo "$FILENAME" | sed -r 's/^[^_]+_([^_]+)_.*$/\1/')
|
||||
pushd "${FILEPATH}" >/dev/null || exit 1
|
||||
aptss download "${PACKAGE_NAME}"
|
||||
popd >/dev/null || exit 1
|
||||
|
||||
if [ ! -f "$1" ]; then
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# 哈希校验
|
||||
function hash_check() {
|
||||
local PACKAGES_DATA_PATH=""
|
||||
|
||||
# 检查可能的仓库位置
|
||||
if [ -e "/var/lib/aptss/lists/${SPARK_DOWNLOAD_SERVER_URL_NO_PROTOCOL}_${STORE_URL}_Packages" ]; then
|
||||
PACKAGES_DATA_PATH="/var/lib/aptss/lists/${SPARK_DOWNLOAD_SERVER_URL_NO_PROTOCOL}_${STORE_URL}_Packages"
|
||||
elif [ -e "/var/lib/aptss/lists/d.store.deepinos.org.cn_${STORE_URL}_Packages" ]; then
|
||||
PACKAGES_DATA_PATH="/var/lib/aptss/lists/d.store.deepinos.org.cn_${STORE_URL}_Packages"
|
||||
echo "星火仓库的Packages位置为 $PACKAGES_DATA_PATH,是d域名单目录仓库配置"
|
||||
else
|
||||
PACKAGES_DATA_PATH="/var/lib/aptss/lists/mirrors.sdu.edu.cn_spark-store-repository_${STORE_URL}_Packages"
|
||||
echo "星火仓库的Packages位置为 $PACKAGES_DATA_PATH,是SDU镜像仓库配置"
|
||||
fi
|
||||
|
||||
echo "正在运行包验证..."
|
||||
@@ -83,113 +172,361 @@ function hash_check() {
|
||||
|
||||
DEB_SHA512SUM=$(sha512sum "$1" | cut -d ' ' -f 1)
|
||||
unset IS_SHA512SUM_CHECKED
|
||||
IS_SHA512SUM_CHECKED=$(cat "$PACKAGES_DATA_PATH" | grep "$DEB_SHA512SUM")
|
||||
IS_SHA512SUM_CHECKED=$(grep -F "$DEB_SHA512SUM" "$PACKAGES_DATA_PATH")
|
||||
}
|
||||
|
||||
function lock_file(){
|
||||
chattr +i "$1"
|
||||
}
|
||||
# 确保aptss存在
|
||||
function ensure_aptss_exist() {
|
||||
if ! command -v aptss &>/dev/null; then
|
||||
local deb_file="/tmp/spark-store-console-in-container_latest_all.deb"
|
||||
|
||||
if ! wget -O "$deb_file" "https://amber-ce-resource.spark-app.store/store/depends/spark-store-console-in-container_latest_all.deb"; then
|
||||
echo "下载 .deb 安装包失败" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
function unlock_file(){
|
||||
chattr -i "$1"
|
||||
}
|
||||
if ! apt install -y "$deb_file"; then
|
||||
echo "安装 .deb 包失败" >&2
|
||||
rm -f "$deb_file"
|
||||
return 1
|
||||
fi
|
||||
rm -f "$deb_file"
|
||||
|
||||
####################################
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "没有接收到参数,退出"
|
||||
echo "用法:$0 deb路径"
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
exit
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if [ "$(id -u)" != "0" ]; then
|
||||
echo "${TRANSHELL_CONTENT_PLEASE_RUN_AS_ROOT}"
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "$1" ]; then
|
||||
echo "${TRANSHELL_CONTENT_FILE_NOT_EXIST},Trying to redownload"
|
||||
FILEPATH=$(dirname "$1")
|
||||
FILENAME=$(basename "$1")
|
||||
PACKAGE_NAME=$(echo "$FILENAME" | sed -r 's/^([^_]+)_.*$/\1/')
|
||||
VERSION=$(echo "$FILENAME" | sed -r 's/^[^_]+_([^_]+)_.*$/\1/')
|
||||
pushd ${FILEPATH}
|
||||
aptss download ${PACKAGE_NAME}=${VERSION}
|
||||
popd
|
||||
if [ ! -f "$1" ]; then
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
exit 1
|
||||
else
|
||||
DEBPATH=$(realpath "$1")
|
||||
if ! command -v aptss &>/dev/null; then
|
||||
echo "成功安装但未找到 aptss 命令" >&2
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
else
|
||||
DEBPATH=$(realpath "$1")
|
||||
fi
|
||||
}
|
||||
export -f ensure_aptss_exist
|
||||
|
||||
lock_file "$DEBPATH"
|
||||
|
||||
hash_check "$DEBPATH"
|
||||
|
||||
if [ -z "$IS_SHA512SUM_CHECKED" ]; then
|
||||
echo "尝试更新仓库信息重新校验"
|
||||
aptss ssupdate
|
||||
hash_check "$DEBPATH"
|
||||
if [ -z "$IS_SHA512SUM_CHECKED" ]; then
|
||||
echo -e "$TRANSHELL_CONTENT_HASH_CHECK_FAILED"
|
||||
zenity --info --icon-name=spark-store --height 270 --width 500 --text "$TRANSHELL_CONTENT_HASH_CHECK_FAILED"
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -z "$IS_SHA512SUM_CHECKED" ]; then
|
||||
echo "校验成功,开始安装"
|
||||
echo "----------------------------------------------------------------------------------"
|
||||
package_name=$(dpkg-deb -f "$DEBPATH" Package)
|
||||
echo "Package name is $package_name"
|
||||
try_run_output=$(/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh test-install-app "$DEBPATH")
|
||||
try_run_ret="$?"
|
||||
|
||||
if [ "$try_run_ret" -ne 0 ]; then
|
||||
aptss update
|
||||
try_run_output=$(/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh test-install-app "$DEBPATH")
|
||||
try_run_ret="$?"
|
||||
# 确保ACE环境存在
|
||||
function ensure_ace_env() {
|
||||
local ace_env_pkg="${1}"
|
||||
|
||||
if ! dpkg -l "$ace_env_pkg" &>/dev/null; then
|
||||
echo "ACE环境$ace_env_pkg未安装,正在尝试安装..."
|
||||
zenity --info --text="首次使用$ace_env_pkg环境,重启或注销桌面后才能在启动器中展示,不影响应用启动。安装将在后台继续。" --title="ACE环境安装" &
|
||||
if ! aptss install -y "$ace_env_pkg"; then
|
||||
echo "安装$ace_env_pkg失败"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
export user=$(who | awk '{print $1}' | head -n 1)
|
||||
# 在桌面创建快捷方式
|
||||
function create_desktop_file() {
|
||||
# 如果明确要求不要创建或明确要创建,则跳过配置文件检查
|
||||
if [ "$NO_CREATE_DESKTOP" -eq 1 ]; then
|
||||
echo "根据参数要求,跳过创建桌面快捷方式"
|
||||
return
|
||||
fi
|
||||
|
||||
if [ "$try_run_ret" -ne 0 ]; then
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
echo -e "${try_run_output}"
|
||||
exit "$try_run_ret"
|
||||
if [ "$FORCE_CREATE_DESKTOP" -eq 0 ]; then
|
||||
if [ -e "$(sudo -u "$user" xdg-user-dir)/.config/spark-union/spark-store/ssshell-config-do-not-create-desktop" ]; then
|
||||
echo "根据配置要求,跳过创建桌面快捷方式"
|
||||
return
|
||||
fi
|
||||
fi
|
||||
|
||||
exec_create_desktop_file
|
||||
}
|
||||
export CURRENT_USER_DIR_DESKTOP=$(sudo -u "$user" xdg-user-dir DESKTOP)
|
||||
function exec_create_desktop_file() {
|
||||
local desktop_files=()
|
||||
|
||||
# 收集所有桌面文件
|
||||
desktop_files+=($(dpkg -L "$package_name" | grep '/usr/share/applications/.*\.desktop$'))
|
||||
desktop_files+=($(dpkg -L "$package_name" | grep '/opt/apps/'"$package_name"'/entries/applications/.*\.desktop$'))
|
||||
|
||||
for desktop_file_path in "${desktop_files[@]}"; do
|
||||
if [ "$FORCE_CREATE_DESKTOP" -eq 1 ] || [ -z "$(grep 'NoDisplay=true' "$desktop_file_path")" ]; then
|
||||
echo "$desktop_file_path is checked and will be installed to desktop"
|
||||
chmod +x "$desktop_file_path"
|
||||
sudo -u "$user" cp "$desktop_file_path" "${CURRENT_USER_DIR_DESKTOP}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
export -f exec_create_desktop_file
|
||||
|
||||
dpkg -i "$DEBPATH" || aptss install "$DEBPATH" -yf
|
||||
# 在ACE环境中创建桌面快捷方式
|
||||
function create_desktop_in_ace() {
|
||||
local ace_cmd="$1"
|
||||
local package_name="$2"
|
||||
|
||||
# 如果明确要求不要创建,则直接返回
|
||||
if [ "$NO_CREATE_DESKTOP" -eq 1 ]; then
|
||||
echo "根据参数要求,跳过在ACE中创建桌面快捷方式"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# 如果是强制创建,或者没有配置禁止创建
|
||||
if [ "$FORCE_CREATE_DESKTOP" -eq 1 ] || ! $ace_cmd "[ -e ~/.config/spark-union/spark-store/ssshell-config-do-not-create-desktop ]"; then
|
||||
echo "在ACE环境中创建桌面快捷方式..."
|
||||
export -f exec_create_desktop_file
|
||||
export package_name
|
||||
export FORCE_CREATE_DESKTOP
|
||||
$ace_cmd "exec_create_desktop_file"
|
||||
else
|
||||
echo "根据ACE环境中的配置,跳过创建桌面快捷方式"
|
||||
fi
|
||||
}
|
||||
|
||||
unlock_file "$DEBPATH"
|
||||
# 在指定ACE环境中安装
|
||||
function install_in_ace_env() {
|
||||
local ace_cmd="$1"
|
||||
local deb_path="$2"
|
||||
local ace_env_pkg="${3#*:}"
|
||||
|
||||
if [ "$IS_ACE_ENV" != "" ] || command -v termux-chroot; then
|
||||
echo "无法在ACE/termux/小小电脑中安装ACE包"
|
||||
return 1
|
||||
fi
|
||||
if ! ensure_ace_env "$ace_env_pkg"; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "----------------------------------------"
|
||||
echo "正在尝试使用 $ace_cmd 环境安装..."
|
||||
echo "----------------------------------------"
|
||||
$ace_cmd "ensure_aptss_exist"
|
||||
|
||||
if [ "$?" = "0" ] && [ "$2" = "--delete-after-install" ]; then
|
||||
if dpkg -s "$package_name" >/dev/null 2>&1; then
|
||||
echo "软件包已安装:$package_name"
|
||||
create_desktop_file
|
||||
rm "$DEBPATH"
|
||||
echo "${TRANSHELL_CONTENT_DEB_IS_DELETED}"
|
||||
# 首先尝试dry-run测试
|
||||
if ! $ace_cmd "aptss install --dry-run '$deb_path'"; then
|
||||
echo "初始dry-run测试失败,尝试更新后重试..."
|
||||
$ace_cmd "aptss update"
|
||||
if ! $ace_cmd "aptss install --dry-run '$deb_path'"; then
|
||||
echo "dry-run测试仍然失败,放弃安装"
|
||||
echo "OMG_IT_GOES_WRONG"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# dry-run成功后执行实际安装
|
||||
$ace_cmd "aptss install store.spark-app.app-runtime-base --no-install-recommends -yfq"
|
||||
if $ace_cmd "dpkg -i '$deb_path' || aptss install '$deb_path' -yfq"; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# 在主机安装
|
||||
function install_in_host() {
|
||||
local deb_path="$1"
|
||||
|
||||
# 首先尝试dry-run测试
|
||||
if ! aptss install --dry-run "$deb_path"; then
|
||||
echo "初始dry-run测试失败,尝试更新后重试..."
|
||||
aptss update
|
||||
if ! aptss install --dry-run "$deb_path"; then
|
||||
echo "dry-run测试仍然失败,放弃安装"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# dry-run成功后执行实际安装
|
||||
if dpkg -i "$deb_path" || aptss install "$deb_path" -yfq; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# 自动尝试在各种环境中安装
|
||||
function auto_try_install() {
|
||||
local deb_path="$1"
|
||||
|
||||
# 首先尝试在主机安装
|
||||
if install_in_host "$deb_path"; then
|
||||
create_desktop_file
|
||||
return 0
|
||||
fi
|
||||
|
||||
# 如果主机安装失败,并非在ACE内运行且不在强制本地模式,尝试ACE环境
|
||||
if [ "$FORCE_NATIVE" -eq 0 ] && [ "$IS_ACE_ENV" = "" ] && ! command -v termux-chroot; then
|
||||
for ace_entry in "${ACE_ENVIRONMENTS_FOR_AUTOINSTALL[@]}"; do
|
||||
local ace_cmd=${ace_entry%%:*}
|
||||
local ace_env_pkg=${ace_entry#*:}
|
||||
|
||||
# 确保ACE环境存在
|
||||
if ensure_ace_env "$ace_env_pkg"; then
|
||||
if install_in_ace_env "$ace_cmd" "$deb_path" "$ace_env_pkg"; then
|
||||
# 在ACE环境中创建桌面快捷方式
|
||||
create_desktop_in_ace "$ace_cmd" "$package_name"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
return 1
|
||||
}
|
||||
# 清理安装后的文件
|
||||
function post_install_cleanup() {
|
||||
local success=$1
|
||||
local deb_path="$2"
|
||||
local package_name="$3"
|
||||
|
||||
if [ "$success" -eq 0 ] && [ "$DELETE_AFTER_INSTALL" -eq "1" ]; then
|
||||
# 检查是否安装在主机
|
||||
if [ "$FORCE_NATIVE" -eq 1 ] || [ -n "$FORCE_ACE_ENV" ]; then
|
||||
if [ "$FORCE_NATIVE" -eq 1 ]; then
|
||||
if dpkg -s "$package_name" >/dev/null 2>&1; then
|
||||
echo "软件包已在主机安装:$package_name"
|
||||
create_desktop_file
|
||||
unlock_file "$deb_path"
|
||||
rm "$deb_path"
|
||||
echo "${TRANSHELL_CONTENT_DEB_IS_DELETED}"
|
||||
else
|
||||
echo "软件包未在主机安装:$package_name"
|
||||
echo "安装异常!抛出错误"
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
# ACE环境中安装的情况,不检查主机dpkg数据库
|
||||
echo "软件包已在ACE环境安装:$package_name"
|
||||
unlock_file "$deb_path"
|
||||
rm "$deb_path"
|
||||
echo "${TRANSHELL_CONTENT_DEB_IS_DELETED}"
|
||||
fi
|
||||
else
|
||||
echo "软件包未安装:$package_name"
|
||||
echo "安装异常!抛出错误"
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
# 自动模式下,如果ACE安装成功也会走到这里
|
||||
echo "软件包已安装:$package_name"
|
||||
unlock_file "$deb_path"
|
||||
rm "$deb_path"
|
||||
echo "${TRANSHELL_CONTENT_DEB_IS_DELETED}"
|
||||
fi
|
||||
else
|
||||
echo "${TRANSHELL_CONTENT_WILL_NOT_DELETE_DEB}"
|
||||
if dpkg -s "$package_name" >/dev/null 2>&1; then
|
||||
echo "软件包已安装:$package_name"
|
||||
create_desktop_file
|
||||
else
|
||||
echo "软件包未安装:$package_name"
|
||||
if [ "$FORCE_NATIVE" -eq 1 ] && ! dpkg -s "$package_name" >/dev/null 2>&1; then
|
||||
echo "软件包未在主机安装:$package_name"
|
||||
echo "安装异常!抛出错误"
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
exit 1
|
||||
elif [ -n "$FORCE_ACE_ENV" ] && ! command -v "$FORCE_ACE_ENV" >/dev/null 2>&1; then
|
||||
echo "指定的ACE环境不可用"
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# 文件锁定/解锁函数
|
||||
function lock_file() {
|
||||
chattr +i "$1"
|
||||
}
|
||||
|
||||
function unlock_file() {
|
||||
if [ -e "$1" ];then
|
||||
chattr -i "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
# 主安装流程
|
||||
function main_install() {
|
||||
parse_args "$@"
|
||||
|
||||
if [ -z "$DEBPATH" ]; then
|
||||
echo "没有接收到参数,退出"
|
||||
show_help
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 设置退出时的文件解锁
|
||||
trap 'unlock_file $DEBPATH' EXIT
|
||||
validate_user
|
||||
validate_or_download_file "$DEBPATH"
|
||||
|
||||
DEBPATH=$(realpath "$DEBPATH")
|
||||
lock_file "$DEBPATH"
|
||||
|
||||
hash_check "$DEBPATH"
|
||||
|
||||
if [ -z "$IS_SHA512SUM_CHECKED" ]; then
|
||||
echo "尝试更新仓库信息重新校验"
|
||||
aptss ssupdate
|
||||
hash_check "$DEBPATH"
|
||||
if [ -z "$IS_SHA512SUM_CHECKED" ]; then
|
||||
echo -e "$TRANSHELL_CONTENT_HASH_CHECK_FAILED"
|
||||
zenity --info --icon-name=spark-store --height 270 --width 500 --text "$TRANSHELL_CONTENT_HASH_CHECK_FAILED"
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
package_name=$(dpkg-deb -f "$DEBPATH" Package)
|
||||
local install_success=1
|
||||
if [ "$FORCE_NATIVE" -eq 1 ] || [ "$IS_ACE_ENV" = "1" ]; then
|
||||
# 优先使用主机安装,忽略所有ACE参数
|
||||
echo "忽略ACE,使用主机安装 $package_name"
|
||||
install_in_host "$DEBPATH"
|
||||
install_success=$?
|
||||
# 安装成功后在主机创建桌面快捷方式
|
||||
if [ "$install_success" -eq 0 ]; then
|
||||
create_desktop_file
|
||||
fi
|
||||
|
||||
elif [ ${#ACE_PARAMS[@]} -gt 0 ] && [ "$IS_ACE_ENV" = "" ]; then
|
||||
# 用户指定了一个或多个ACE环境,且未要求原生安装
|
||||
echo "使用ACE环境安装,已指定环境: ${ACE_PARAMS[*]}"
|
||||
|
||||
# 查找第一个已安装的ACE环境
|
||||
chosen_env=""
|
||||
for env_cmd in "${ACE_PARAMS[@]}"; do
|
||||
if command -v "$env_cmd" >/dev/null 2>&1; then
|
||||
chosen_env="$env_cmd"
|
||||
break
|
||||
fi
|
||||
done
|
||||
# 如果没有安装任何环境,则使用第一个指定的环境
|
||||
if [ -z "$chosen_env" ]; then
|
||||
chosen_env="${ACE_PARAMS[0]}"
|
||||
echo "未发现已安装的ACE环境,准备安装 $chosen_env..."
|
||||
# 查找对应的ACE环境软件包名
|
||||
for ace_entry in "${ACE_ENVIRONMENTS[@]}"; do
|
||||
if [ "${ace_entry%%:*}" = "$chosen_env" ]; then
|
||||
ace_pkg="${ace_entry#*:}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
# 安装ACE环境(示例使用aptss工具,可根据实际情况调整)
|
||||
ensure_ace_env "$ace_pkg" -y
|
||||
fi
|
||||
|
||||
# 再次确认ACE环境命令是否可用
|
||||
if command -v "$chosen_env" >/dev/null 2>&1; then
|
||||
# 查找软件包名(仅首次查找即可)
|
||||
for ace_entry in "${ACE_ENVIRONMENTS[@]}"; do
|
||||
if [ "${ace_entry%%:*}" = "$chosen_env" ]; then
|
||||
ace_pkg="${ace_entry#*:}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
echo "在 ACE 环境 $chosen_env 中安装 $package_name"
|
||||
install_in_ace_env "$chosen_env" "$DEBPATH" "$ace_pkg"
|
||||
install_success=$?
|
||||
if [ "$install_success" -eq 0 ]; then
|
||||
create_desktop_in_ace "$chosen_env" "$package_name"
|
||||
fi
|
||||
else
|
||||
echo "指定的ACE环境 $chosen_env 不可用"
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
else
|
||||
# 未指定ACE环境和--native,使用自动安装逻辑(先主机再ACE)
|
||||
echo "自动选择安装方式"
|
||||
auto_try_install "$DEBPATH"
|
||||
install_success=$?
|
||||
fi
|
||||
|
||||
post_install_cleanup "$install_success" "$DEBPATH" "$package_name"
|
||||
}
|
||||
|
||||
# 执行主函数
|
||||
main_install "$@"
|
||||
|
||||
@@ -1,2 +1,45 @@
|
||||
#!/bin/bash
|
||||
dpkg -l | grep "^ii $1 " > /dev/null
|
||||
readonly ACE_ENVIRONMENTS=(
|
||||
"bookworm-run:amber-ce-bookworm"
|
||||
"trixie-run:amber-ce-trixie"
|
||||
"deepin23-run:amber-ce-deepin23"
|
||||
"sid-run:amber-ce-sid"
|
||||
)
|
||||
dpkg -s "$1" > /dev/null
|
||||
RET="$?"
|
||||
if [[ "$RET" != "0" ]] &&[[ "$IS_ACE_ENV" == "" ]];then ## 如果未在ACE环境中
|
||||
|
||||
|
||||
|
||||
for ace_entry in "${ACE_ENVIRONMENTS[@]}"; do
|
||||
ace_cmd=${ace_entry%%:*}
|
||||
if command -v "$ace_cmd" >/dev/null 2>&1; then
|
||||
echo "----------------------------------------"
|
||||
echo "正在检查 $ace_cmd 环境的安装..."
|
||||
echo "----------------------------------------"
|
||||
|
||||
# 在ACE环境中执行安装检测
|
||||
$ace_cmd dpkg -l | grep "^ii $1 " > /dev/null
|
||||
try_run_ret="$?"
|
||||
|
||||
|
||||
# 最终检测结果处理
|
||||
if [ "$try_run_ret" -eq 0 ]; then
|
||||
echo "----------------------------------------"
|
||||
echo "在 $ace_cmd 环境中找到了安装"
|
||||
echo "----------------------------------------"
|
||||
exit $try_run_ret
|
||||
else
|
||||
echo "----------------------------------------"
|
||||
echo "在 $ace_cmd 环境中未能找到安装,继续查找"
|
||||
echo "----------------------------------------"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
echo "----------------------------------------"
|
||||
echo "所有已安装的 ACE 环境中未能找到安装,退出"
|
||||
echo "----------------------------------------"
|
||||
exit "$RET"
|
||||
fi
|
||||
## 如果在ACE环境中或者未出错
|
||||
exit "$RET"
|
||||
|
||||
@@ -1,141 +1,164 @@
|
||||
#!/bin/bash
|
||||
# ===== Log =====
|
||||
# log.info xxx
|
||||
# log.warn xxx
|
||||
# log.info xxx
|
||||
# log.debug xxx
|
||||
# 带颜色的echo
|
||||
function log.color_output() {
|
||||
local color=$1
|
||||
shift 1
|
||||
|
||||
echo >&2 -e "\033[${color}m$@\033[0m"
|
||||
return 0
|
||||
# ===== ACE环境配置 =====
|
||||
readonly ACE_ENVIRONMENTS=(
|
||||
"bookworm-run:amber-ce-bookworm"
|
||||
"trixie-run:amber-ce-trixie"
|
||||
"deepin23-run:amber-ce-deepin23"
|
||||
"sid-run:amber-ce-sid"
|
||||
)
|
||||
|
||||
# ===== 日志和函数 =====
|
||||
[ -f /opt/durapps/spark-store/bin/bashimport/log.amber ] && \
|
||||
source /opt/durapps/spark-store/bin/bashimport/log.amber || {
|
||||
log.info() { echo "INFO: $*"; }
|
||||
log.warn() { echo "WARN: $*"; }
|
||||
log.error() { echo "ERROR: $*"; }
|
||||
log.debug() { echo "DEBUG: $*"; }
|
||||
}
|
||||
|
||||
# Log is named without prefix "utils." for convenience
|
||||
# Usage: log.log <level> ...content
|
||||
function log.log() {
|
||||
if [[ $# < 2 ]]; then
|
||||
return -1
|
||||
fi
|
||||
|
||||
local level=$1
|
||||
shift 1
|
||||
|
||||
case $level in
|
||||
error) log.color_output "0;31" "[ERROR] $@" ;;
|
||||
warn) log.color_output "1;33" "[WARN] $@" ;;
|
||||
info) log.color_output "1;37" "[INFO] $@" ;;
|
||||
debug) log.color_output "1;30" "[DEBUG] $@" ;;
|
||||
esac
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
function log.error() { log.log "error" "$@"; }
|
||||
function log.warn() { log.log "warn" $@; }
|
||||
function log.info() { log.log "info" $@; }
|
||||
function log.debug() { log.log "debug" $@; }
|
||||
|
||||
|
||||
function scan_desktop_file_log(){
|
||||
unset desktop_file_path
|
||||
for desktop_file_path in $(dpkg -L "$1" |grep /usr/share/applications/ | awk '/\.desktop$/ {print}'); do
|
||||
if [ "$(cat $desktop_file_path | grep NoDisplay=true)" = "" ];then
|
||||
log.info "$desktop_file_path is found."
|
||||
fi
|
||||
done
|
||||
for desktop_file_path in $(dpkg -L "$1" |grep /opt/apps/$package_name/entries/applications | awk '/\.desktop$/ {print}'); do
|
||||
if [ "$(cat $desktop_file_path | grep NoDisplay=true)" = "" ];then
|
||||
log.info "$desktop_file_path is found."
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
}
|
||||
|
||||
function scan_desktop_file(){
|
||||
# ===== 功能函数 =====
|
||||
function scan_desktop_file_log() {
|
||||
unset desktop_file_path
|
||||
local result=""
|
||||
for desktop_file_path in $(dpkg -L "$1" | grep /usr/share/applications/ | awk '/\.desktop$/ {print}'); do
|
||||
if [ "$(grep NoDisplay=true $desktop_file_path)" = "" ]; then
|
||||
result+="$desktop_file_path,"
|
||||
fi
|
||||
done
|
||||
for desktop_file_path in $(dpkg -L "$1" | grep /opt/apps/$package_name/entries/applications | awk '/\.desktop$/ {print}'); do
|
||||
if [ "$(grep NoDisplay=true $desktop_file_path)" = "" ]; then
|
||||
result+="$desktop_file_path,"
|
||||
fi
|
||||
done
|
||||
# 去掉最后一个逗号
|
||||
if [ -n "$result" ]; then
|
||||
result=${result%,}
|
||||
fi
|
||||
echo "$result"
|
||||
local package_name=$1
|
||||
# 标准desktop文件检测
|
||||
while IFS= read -r path; do
|
||||
[ -z "$(grep 'NoDisplay=true' "$path")" ] && {
|
||||
log.info "Found valid desktop file: $path"
|
||||
export desktop_file_path="$path"
|
||||
return 0
|
||||
}
|
||||
done < <(dpkg -L "$package_name" 2>/dev/null | grep -E '/usr/share/applications/.*\.desktop$|/opt/apps/.*/entries/applications/.*\.desktop$')
|
||||
|
||||
# 深度环境特殊处理
|
||||
while IFS= read -r path; do
|
||||
[ -z "$(grep 'NoDisplay=true' "$path")" ] && {
|
||||
log.info "Found deepin desktop file: $path"
|
||||
export desktop_file_path="$path"
|
||||
return 0
|
||||
}
|
||||
done < <(find /opt/apps/$package_name -path '*/entries/applications/*.desktop' 2>/dev/null)
|
||||
return 1
|
||||
}
|
||||
|
||||
function launch_app(){
|
||||
|
||||
# 检查是否传入了路径参数
|
||||
if [ -z "$1" ]; then
|
||||
log.error "请传入文件路径作为参数"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DESKTOP_FILE_PATH=$1
|
||||
|
||||
if [[ $DESKTOP_FILE_PATH == file://* ]]; then
|
||||
# 如果是,移除 'file://' 部分并输出结果
|
||||
DESKTOP_FILE_PATH="${DESKTOP_FILE_PATH#file://}"
|
||||
fi
|
||||
|
||||
# 获取文件内容中第一个 Exec= 后的命令
|
||||
exec_command=$(grep -m 1 -oP "(?<=Exec=).*" "$DESKTOP_FILE_PATH")
|
||||
|
||||
# 删除 exec_command 中最后的 % 及其后面的内容
|
||||
exec_command="${exec_command%\%*}"
|
||||
|
||||
# 打印提取的命令
|
||||
log.info "Command is $exec_command"
|
||||
|
||||
# 在默认终端执行命令
|
||||
eval "$exec_command"
|
||||
function scan_desktop_file() {
|
||||
local package_name=$1 result=""
|
||||
# 标准结果收集
|
||||
while IFS= read -r path; do
|
||||
[ -z "$(grep 'NoDisplay=true' "$path")" ] && result+="$path,"
|
||||
done < <(dpkg -L "$package_name" 2>/dev/null | grep -E '/usr/share/applications/.*\.desktop$|/opt/apps/.*/entries/applications/.*\.desktop$')
|
||||
|
||||
# 深度环境补充扫描
|
||||
while IFS= read -r path; do
|
||||
[ -z "$(grep 'NoDisplay=true' "$path")" ] && result+="$path,"
|
||||
done < <(find /opt/apps/$package_name -path '*/entries/applications/*.desktop' 2>/dev/null)
|
||||
|
||||
echo "${result%,}"
|
||||
}
|
||||
|
||||
if [ "$#" -lt 2 ];then
|
||||
log.info "Usage: $0 check/launch/list/start packagename/desktop-file"
|
||||
exit -1
|
||||
fi
|
||||
function launch_app() {
|
||||
local DESKTOP_FILE_PATH="${1#file://}"
|
||||
# 提取并净化Exec命令
|
||||
exec_command=$(grep -m1 '^Exec=' "$DESKTOP_FILE_PATH" | cut -d= -f2- | sed 's/%.//g')
|
||||
[ -z "$exec_command" ] && return 1
|
||||
[ ! -z "$IS_ACE_ENV" ] && HOST_PREFIX="host-spawn"
|
||||
exec_command="${HOST_PREFIX} $exec_command"
|
||||
log.info "Launching: $exec_command"
|
||||
${SHELL:-bash} -c " $exec_command" &
|
||||
|
||||
}
|
||||
|
||||
if [ "$1" = "check" ];then
|
||||
# 导出函数以便在ACE环境中使用
|
||||
export -f launch_app scan_desktop_file scan_desktop_file_log log.info log.warn log.debug log.error
|
||||
|
||||
scan_desktop_file_log "$2"
|
||||
if [ "$desktop_file_path" = "" ];then
|
||||
log.error "No desktop file found. exit -1"
|
||||
exit -1
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
# ===== ACE环境执行器 =====
|
||||
function ace_runner() {
|
||||
local action=$1
|
||||
local target=$2
|
||||
|
||||
for ace_entry in "${ACE_ENVIRONMENTS[@]}"; do
|
||||
local ace_cmd=${ace_entry%%:*}
|
||||
local ace_env=${ace_entry#*:}
|
||||
|
||||
if ! command -v "$ace_cmd" >/dev/null; then
|
||||
log.debug "$ace_cmd not found, skipping..."
|
||||
continue
|
||||
fi
|
||||
|
||||
log.info "Attempting in $ace_env environment..."
|
||||
|
||||
case "$action" in
|
||||
check)
|
||||
if "$ace_cmd" scan_desktop_file_log "$target"; then
|
||||
log.info "Found desktop file in $ace_env"
|
||||
return 0
|
||||
fi
|
||||
;;
|
||||
list)
|
||||
local result
|
||||
if result=$("$ace_cmd" scan_desktop_file "$target"); then
|
||||
echo "$result"
|
||||
return 0
|
||||
fi
|
||||
;;
|
||||
launch|start)
|
||||
"$ace_cmd" scan_desktop_file_log "$target"
|
||||
if desktop_path=$("$ace_cmd" scan_desktop_file_log "$target"); then
|
||||
log.info "Launching from $ace_env..."
|
||||
"$ace_cmd" launch_app $("$ace_cmd" scan_desktop_file "$target")
|
||||
return 0
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
log.debug "Attempt in $ace_env failed"
|
||||
done
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
elif [ "$1" = "list" ];then
|
||||
scan_desktop_file "$2"
|
||||
if [ "$desktop_file_path" = "" ];then
|
||||
exit -1
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
elif [ "$1" = "launch" ];then
|
||||
scan_desktop_file_log "$2"
|
||||
if [ "$desktop_file_path" = "" ];then
|
||||
log.error "No desktop file found. exit -1"
|
||||
exit -1
|
||||
fi
|
||||
# ===== 主逻辑 =====
|
||||
[ $# -lt 2 ] && {
|
||||
log.error "Usage: $0 {check|launch|list|start} package_name/desktop_file"
|
||||
exit 1
|
||||
}
|
||||
|
||||
case $1 in
|
||||
check)
|
||||
# 当前环境检查
|
||||
if scan_desktop_file_log "$2"; then
|
||||
exit 0
|
||||
else
|
||||
# 非ACE环境下执行ACE环境扫描
|
||||
[ -z "$IS_ACE_ENV" ] && ace_runner check "$2"
|
||||
exit $?
|
||||
fi
|
||||
;;
|
||||
|
||||
launch_app "${desktop_file_path}"
|
||||
list)
|
||||
# 当前环境列表
|
||||
if result=$(scan_desktop_file "$2"); then
|
||||
echo "$result"
|
||||
exit 0
|
||||
else
|
||||
# 非ACE环境下执行ACE环境扫描
|
||||
[ -z "$IS_ACE_ENV" ] && ace_runner list "$2"
|
||||
exit $?
|
||||
fi
|
||||
;;
|
||||
|
||||
elif [ "$1" = "start" ];then
|
||||
launch_app "${desktop_file_path}"
|
||||
fi
|
||||
launch|start)
|
||||
# 当前环境启动
|
||||
if scan_desktop_file_log "$2" && launch_app "$desktop_file_path"; then
|
||||
exit 0
|
||||
else
|
||||
# 非ACE环境下通过ACE环境启动
|
||||
[ -z "$IS_ACE_ENV" ] && ace_runner launch "$2"
|
||||
exit $?
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
log.error "Invalid command: $1"
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
|
||||
190
tool/store-helper/uninstaller
Executable file
@@ -0,0 +1,190 @@
|
||||
#!/bin/bash
|
||||
# ===== ACE环境配置 =====
|
||||
|
||||
readonly ACE_ENVIRONMENTS=(
|
||||
"bookworm-run:amber-ce-bookworm"
|
||||
"trixie-run:amber-ce-trixie"
|
||||
"deepin23-run:amber-ce-deepin23"
|
||||
"sid-run:amber-ce-sid"
|
||||
)
|
||||
# 生成ACE环境参数帮助信息
|
||||
function generate_ace_help() {
|
||||
local help_text=""
|
||||
for ace_entry in "${ACE_ENVIRONMENTS[@]}"; do
|
||||
local ace_param="--${ace_entry#*:}"
|
||||
help_text+=" $ace_param 使用${ace_entry%%:*} ACE容器卸载\n"
|
||||
done
|
||||
echo -e "$help_text"
|
||||
}
|
||||
# 帮助函数
|
||||
function show_help() {
|
||||
echo "Spark Store Uninstall script. 星火商店卸载脚本"
|
||||
echo "用法: $0 [选项] 包名"
|
||||
echo "选项:"
|
||||
echo " -h, --help 显示帮助信息"
|
||||
echo " --delete-after-install 安装成功后删除软件包"
|
||||
echo " --no-create-desktop-entry 不创建桌面快捷方式"
|
||||
echo " --force-create-desktop-entry 强制创建桌面快捷方式"
|
||||
echo "$(generate_ace_help)"
|
||||
echo " --native 只在主机卸载,不使用ACE容器"
|
||||
}
|
||||
|
||||
|
||||
# 参数解析
|
||||
function parse_args() {
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
-h|--help)
|
||||
show_help
|
||||
exit 0
|
||||
;;
|
||||
--delete-after-install)
|
||||
DELETE_AFTER_INSTALL="1"
|
||||
shift
|
||||
;;
|
||||
--native)
|
||||
FORCE_NATIVE="1"
|
||||
shift
|
||||
;;
|
||||
--no-create-desktop-entry)
|
||||
NO_CREATE_DESKTOP="1"
|
||||
shift
|
||||
;;
|
||||
--force-create-desktop-entry)
|
||||
FORCE_CREATE_DESKTOP="1"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
# 检查是否为ACE环境参数
|
||||
local is_ace_param=0
|
||||
for ace_entry in "${ACE_ENVIRONMENTS[@]}"; do
|
||||
local ace_param="--${ace_entry#*:}"
|
||||
if [ "$1" = "$ace_param" ]; then
|
||||
# 将ACE环境命令名加入数组
|
||||
ACE_PARAMS+=("${ace_entry%%:*}")
|
||||
is_ace_param=1
|
||||
shift
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# 如果不是ACE环境参数,则视为包名
|
||||
if [ "$is_ace_param" -eq 0 ]; then
|
||||
PACKAGE_NAME="$1"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
# ===== 日志和函数 =====
|
||||
[ -f /opt/durapps/spark-store/bin/bashimport/log.amber ] && \
|
||||
source /opt/durapps/spark-store/bin/bashimport/log.amber || {
|
||||
log.info() { echo "INFO: $*"; }
|
||||
log.warn() { echo "WARN: $*"; }
|
||||
log.error() { echo "ERROR: $*"; }
|
||||
log.debug() { echo "DEBUG: $*"; }
|
||||
}
|
||||
|
||||
# 初始化变量
|
||||
FORCE_NATIVE=0
|
||||
ACE_PARAMS=()
|
||||
PACKAGE_NAME=""
|
||||
uninstall_success=0
|
||||
|
||||
# 解析参数
|
||||
parse_args "$@"
|
||||
|
||||
if [ -z "$PACKAGE_NAME" ]; then
|
||||
log.error "请指定要卸载的包名"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 尝试在本地卸载
|
||||
try_native_uninstall() {
|
||||
if [ "$FORCE_NATIVE" -eq 1 ] || [ ${#ACE_PARAMS[@]} -eq 0 ]; then
|
||||
echo "----------------------------------------"
|
||||
echo "正在检查本地环境中的安装..."
|
||||
echo "----------------------------------------"
|
||||
|
||||
dpkg -s "$PACKAGE_NAME" > /dev/null
|
||||
RET="$?"
|
||||
if [[ "$RET" == "0" ]]; then
|
||||
echo "----------------------------------------"
|
||||
echo "在本地环境中找到了安装"
|
||||
echo "----------------------------------------"
|
||||
apt autopurge "$PACKAGE_NAME" -y
|
||||
uninstall_success=1
|
||||
return 0
|
||||
else
|
||||
echo "----------------------------------------"
|
||||
echo "在本地环境中未能找到安装"
|
||||
echo "----------------------------------------"
|
||||
fi
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
# 尝试在ACE环境中卸载
|
||||
try_ace_uninstall() {
|
||||
local ace_cmd="$1"
|
||||
if command -v "$ace_cmd" >/dev/null 2>&1; then
|
||||
echo "----------------------------------------"
|
||||
echo "正在检查 $ace_cmd 环境的安装..."
|
||||
echo "----------------------------------------"
|
||||
|
||||
$ace_cmd dpkg -l | grep "^ii $PACKAGE_NAME " > /dev/null
|
||||
try_run_ret="$?"
|
||||
|
||||
if [ "$try_run_ret" -eq 0 ]; then
|
||||
echo "----------------------------------------"
|
||||
echo "在 $ace_cmd 环境中找到了安装"
|
||||
echo "----------------------------------------"
|
||||
$ace_cmd apt autopurge "$PACKAGE_NAME" -y
|
||||
uninstall_success=1
|
||||
return 0
|
||||
else
|
||||
echo "----------------------------------------"
|
||||
echo "在 $ace_cmd 环境中未能找到安装"
|
||||
echo "----------------------------------------"
|
||||
fi
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
# 主卸载逻辑
|
||||
if [ $FORCE_NATIVE -eq 1 ] && [ ${#ACE_PARAMS[@]} -eq 0 ]; then
|
||||
# 只有 --native 参数时,只尝试本地卸载
|
||||
try_native_uninstall || exit $?
|
||||
elif [ $FORCE_NATIVE -eq 0 ] && [ ${#ACE_PARAMS[@]} -gt 0 ]; then
|
||||
# 只有 ACE 参数时,只尝试指定的 ACE 环境卸载
|
||||
for ace_param in "${ACE_PARAMS[@]}"; do
|
||||
try_ace_uninstall "$ace_param"
|
||||
done
|
||||
elif [ $FORCE_NATIVE -eq 1 ] && [ ${#ACE_PARAMS[@]} -gt 0 ]; then
|
||||
# 同时有 --native 和 ACE 参数时,先尝试本地卸载,再尝试 ACE 环境卸载
|
||||
try_native_uninstall
|
||||
for ace_param in "${ACE_PARAMS[@]}"; do
|
||||
try_ace_uninstall "$ace_param"
|
||||
done
|
||||
else
|
||||
# 无参数时,先尝试本地卸载,再尝试所有 ACE 环境卸载
|
||||
try_native_uninstall
|
||||
|
||||
for ace_entry in "${ACE_ENVIRONMENTS[@]}"; do
|
||||
ace_cmd=${ace_entry%%:*}
|
||||
if command -v "$ace_cmd" >/dev/null 2>&1; then
|
||||
try_ace_uninstall "$ace_cmd"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [ $uninstall_success -eq 0 ]; then
|
||||
echo "----------------------------------------"
|
||||
echo "在所有指定的环境中未能找到安装,退出"
|
||||
echo "----------------------------------------"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
||||
@@ -37,6 +37,8 @@ if [ "$(id -u)" != "0" ] ; then
|
||||
fi
|
||||
|
||||
aptss install "${@:2}" --only-upgrade 2>&1 | tee /tmp/spark-store-app-upgrade-log.txt
|
||||
sed -i '1i--------------------------------------------------------------' /tmp/spark-store-app-upgrade-log.txt
|
||||
sed -i '1i更新失败可能是由于系统版本过低,您可先【卸载】此应用后再在商店【安装】此应用来尝试修复此问题,商店会在安装时尝试自动解决问题。若仍无法解决,请按照指引进行反馈' /tmp/spark-store-app-upgrade-log.txt
|
||||
chmod 777 /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
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$(id -u)" != "0" ] ; then
|
||||
if [ "$IS_ACE_ENV" = "1" ];then
|
||||
/opt/durapps/spark-store/bin/store-helper/pass-auth.sh "$0" "$@"
|
||||
else
|
||||
xhost +
|
||||
pkexec "$0" "$@"
|
||||
exit
|
||||
fi
|
||||
if [ "$IS_ACE_ENV" = "1" ] ; then
|
||||
/opt/durapps/spark-store/bin/store-helper/pass-auth.sh "$0" "$@"
|
||||
else
|
||||
xhost +
|
||||
pkexec "$0" "$@"
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
trap "rm -f /tmp/spark-store/upgradeStatus.txt" EXIT
|
||||
HERE=$(dirname $0)
|
||||
trap "rm -f /tmp/spark-store/upgradeStatus.txt" EXIT
|
||||
source /opt/durapps/spark-store/bin/bashimport/transhell.amber
|
||||
load_transhell_debug
|
||||
|
||||
@@ -20,57 +20,58 @@ function get_name_from_desktop_file() {
|
||||
local name_i18n
|
||||
local package_name
|
||||
package_name=$1
|
||||
for desktop_file_path in $(dpkg -L "$package_name" |grep /usr/share/applications/ | awk '/\.desktop$/ {print}'); do
|
||||
if [ "$(grep -m 1 '^NoDisplay=' "$desktop_file_path" | cut -d '=' -f 2)" = "true" ] || [ "$(grep -m 1 '^NoDisplay=' "$desktop_file_path" | cut -d '=' -f 2)" = "True" ];then
|
||||
continue
|
||||
else
|
||||
name_orig=$(grep -m 1 '^Name=' "$desktop_file_path" | cut -d '=' -f 2)
|
||||
name_i18n=$(grep -m 1 "^Name\[${LANGUAGE}\]\=" "$desktop_file_path" | cut -d '=' -f 2)
|
||||
if [ -z "$name_i18n" ] ;then
|
||||
app_name_in_desktop=$name_orig
|
||||
for desktop_file_path in $(dpkg -L "$package_name" |grep /usr/share/applications/ | awk '/\.desktop$/ {print}') ; do
|
||||
if [ "$(grep -m 1 '^NoDisplay=' "$desktop_file_path" | cut -d '=' -f 2)" = "true" ] || [ "$(grep -m 1 '^NoDisplay=' "$desktop_file_path" | cut -d '=' -f 2)" = "True" ] ; then
|
||||
continue
|
||||
else
|
||||
app_name_in_desktop=$name_i18n
|
||||
name_orig=$(awk -F= '/^\[Desktop Entry\]$/ {found=1} found && /^Name=/ {print $2; exit} /^\[.*\]$/ && !/\[Desktop Entry\]/ {exit}' "$desktop_file_path")
|
||||
name_i18n=$(awk -v lang="Name[$LANGUAGE]" -F= '/^\[Desktop Entry\]$/ {found=1} found && /^Name\[/ && $1 == lang {print $2; exit} /^\[.*\]$/ && !/\[Desktop Entry\]/ {exit}' "$desktop_file_path")
|
||||
if [ -z "$name_i18n" ] ; then
|
||||
app_name_in_desktop=$name_orig
|
||||
else
|
||||
app_name_in_desktop=$name_i18n
|
||||
fi
|
||||
fi
|
||||
|
||||
fi
|
||||
done
|
||||
for desktop_file_path in $(dpkg -L "$package_name" |grep /opt/apps/$package_name/entries/applications | awk '/\.desktop$/ {print}'); do
|
||||
if [ "$(grep -m 1 '^NoDisplay=' "$desktop_file_path" | cut -d '=' -f 2)" = "true" ] || [ "$(grep -m 1 '^NoDisplay=' "$desktop_file_path" | cut -d '=' -f 2)" = "True" ];then
|
||||
continue
|
||||
else
|
||||
name_orig=$(grep -m 1 '^Name=' "$desktop_file_path" | cut -d '=' -f 2)
|
||||
name_i18n=$(grep -m 1 "^Name\[${LANGUAGE}\]\=" "$desktop_file_path" | cut -d '=' -f 2)
|
||||
if [ -z "$name_i18n" ] ;then
|
||||
app_name_in_desktop=$name_orig
|
||||
else
|
||||
app_name_in_desktop=$name_i18n
|
||||
fi
|
||||
|
||||
fi
|
||||
done
|
||||
if [ -z "$app_name_in_desktop" ] ;then
|
||||
app_name_in_desktop=${package_name}
|
||||
fi
|
||||
echo ${app_name_in_desktop}
|
||||
|
||||
for desktop_file_path in $(dpkg -L "$package_name" |grep /opt/apps/$package_name/entries/applications | awk '/\.desktop$/ {print}') ; do
|
||||
if [ "$(grep -m 1 '^NoDisplay=' "$desktop_file_path" | cut -d '=' -f 2)" = "true" ] || [ "$(grep -m 1 '^NoDisplay=' "$desktop_file_path" | cut -d '=' -f 2)" = "True" ] ; then
|
||||
continue
|
||||
else
|
||||
name_orig=$(awk -F= '/^\[Desktop Entry\]$/ {found=1} found && /^Name=/ {print $2; exit} /^\[.*\]$/ && !/\[Desktop Entry\]/ {exit}' "$desktop_file_path")
|
||||
name_i18n=$(awk -v lang="Name[$LANGUAGE]" -F= '/^\[Desktop Entry\]$/ {found=1} found && /^Name\[/ && $1 == lang {print $2; exit} /^\[.*\]$/ && !/\[Desktop Entry\]/ {exit}' "$desktop_file_path")
|
||||
if [ -z "$name_i18n" ] ; then
|
||||
app_name_in_desktop=$name_orig
|
||||
else
|
||||
app_name_in_desktop=$name_i18n
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "$app_name_in_desktop" ] ; then
|
||||
app_name_in_desktop=${package_name}
|
||||
fi
|
||||
|
||||
echo ${app_name_in_desktop}
|
||||
}
|
||||
|
||||
touch /tmp/spark-store/upgradeStatus.txt
|
||||
|
||||
# 执行 apt update
|
||||
pkexec /opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh ssupdate 2>&1 > /dev/null | zenity --progress --auto-close --pulsate --no-cancel --text="${TRANSHELL_CONTENT_UPDATE_CHEKING_PLEASE_WAIT}" --height 70 --width 400 --title="${TRANSHELL_CONTENT_SPARK_STORE_UPGRADE_MODEL}" --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
|
||||
pkexec ${HERE}/ss-do-upgrade-worker.sh ssupdate 2>&1 > /dev/null | zenity --progress --auto-close --pulsate --no-cancel --text="${TRANSHELL_CONTENT_UPDATE_CHEKING_PLEASE_WAIT}" --height 70 --width 400 --title="${TRANSHELL_CONTENT_SPARK_STORE_UPGRADE_MODEL}" --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
|
||||
|
||||
if [ -z `cat /tmp/spark-store-app-ssupdate-status.txt` ] ; then
|
||||
/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh clean-log
|
||||
${HERE}/ss-do-upgrade-worker.sh clean-log
|
||||
else
|
||||
zenity --error --text "${TRANSHELL_CONTENT_CHECK_UPDATE_PROCESS_ERROR_PRESS_CONFIRM_TO_CHECK}" --title "${TRANSHELL_CONTENT_SPARK_STORE_UPGRADE_MODEL}" --height 200 --width 350 --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
|
||||
zenity --text-info --filename=/tmp/spark-store-app-ssupdate-log.txt --checkbox="${TRANSHELL_CONTENT_I_ALREDY_COPIED_THE_LOG_HERE_AND_WILL_USE_IT_TO_FEEDBACK}" --title="${TRANSHELL_CONTENT_FEEDBACK_CAN_BE_FOUND_IN_THE_SETTINGS}" --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
|
||||
/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh clean-log
|
||||
${HERE}/ss-do-upgrade-worker.sh clean-log
|
||||
rm -f /tmp/spark-store/upgradeStatus.txt
|
||||
exit
|
||||
fi
|
||||
|
||||
# 获取可更新应用列表
|
||||
PKG_LIST="$(/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh upgradable-list)"
|
||||
PKG_LIST="$(${HERE}/ss-do-upgrade-worker.sh upgradable-list)"
|
||||
## 如果没更新,就弹出不需要更新
|
||||
if [ -z "$PKG_LIST" ] ; then
|
||||
zenity --info --text "${TRANSHELL_CONTENT_NO_NEED_TO_UPGRADE}" --title "${TRANSHELL_CONTENT_SPARK_STORE_UPGRADE_MODEL}" --height 150 --width 300 --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
|
||||
@@ -112,44 +113,60 @@ done)
|
||||
|
||||
## 如果没有应用需要更新,则直接退出
|
||||
if [ -z "$PKG_UPGRADE_LIST" ] ; then
|
||||
zenity --info --text "${TRANSHELL_CONTENT_NO_NEED_TO_UPGRADE}" --title "${TRANSHELL_CONTENT_SPARK_STORE_UPGRADE_MODEL}" --height 150 --width 300 --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
|
||||
else
|
||||
PKG_UPGRADE_LIST=$(echo "$PKG_UPGRADE_LIST" | zenity --list --text="${TRANSHELL_CONTENT_CHOOSE_APP_TO_UPGRADE}" --column="${TRANSHELL_CONTENT_CHOOSE}" --column="${TRANSHELL_CONTENT_APP_NAME}" --column="${TRANSHELL_CONTENT_NEW_VERSION}" --column="${TRANSHELL_CONTENT_UPGRADE_FROM}" --column="${TRANSHELL_CONTENT_PKG_NAME}" --separator=" " --checklist --multiple --print-column=5 --height 350 --width 650 --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg)
|
||||
zenity --info --text "${TRANSHELL_CONTENT_NO_NEED_TO_UPGRADE}" --title "${TRANSHELL_CONTENT_SPARK_STORE_UPGRADE_MODEL}" --height 150 --width 300
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
while true;do
|
||||
PKG_UPGRADE_LIST=$(echo "$PKG_UPGRADE_LIST" | zenity --list --text="${TRANSHELL_CONTENT_CHOOSE_APP_TO_UPGRADE}" --column="${TRANSHELL_CONTENT_CHOOSE}" --column="${TRANSHELL_CONTENT_APP_NAME}" --column="${TRANSHELL_CONTENT_NEW_VERSION}" --column="${TRANSHELL_CONTENT_UPGRADE_FROM}" --column="${TRANSHELL_CONTENT_PKG_NAME}" --separator=" " --checklist --multiple --print-column=5 --height 350 --width 650 )
|
||||
## 如果没有选择,则直接退出
|
||||
if [ -z "$PKG_UPGRADE_LIST" ] ; then
|
||||
zenity --info --text "${TRANSHELL_CONTENT_NO_APP_IS_CHOSEN}" --title "${TRANSHELL_CONTENT_SPARK_STORE_UPGRADE_MODEL}" --height 150 --width 300 --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
|
||||
else
|
||||
zenity --info --text "${TRANSHELL_CONTENT_NO_APP_IS_CHOSEN}" --title "${TRANSHELL_CONTENT_SPARK_STORE_UPGRADE_MODEL}" --height 150 --width 300
|
||||
exit 0
|
||||
fi
|
||||
if [[ "$PKG_UPGRADE_LIST" == *"(null)"* ]]; then
|
||||
zenity --error --text "${TRANSHELL_CONTENT_LIST_NOT_LOADED_PLEASE_WAIT}" --title "${TRANSHELL_CONTENT_SPARK_STORE_UPGRADE_MODEL}" --height 150 --width 300
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
### 更新用户选择的应用
|
||||
# for PKG_UPGRADE in $PKG_UPGRADE_LIST;do
|
||||
# APP_UPGRADE="$(get_name_from_desktop_file $PKG_UPGRADE)"
|
||||
# update_transhell
|
||||
|
||||
(
|
||||
total=$(echo "$PKG_UPGRADE_LIST" | wc -w)
|
||||
count=0
|
||||
|
||||
(for PKG_UPGRADE in $PKG_UPGRADE_LIST; do
|
||||
for PKG_UPGRADE in $PKG_UPGRADE_LIST; do
|
||||
count=$((count + 1))
|
||||
APP_UPGRADE="$(get_name_from_desktop_file $PKG_UPGRADE)"
|
||||
update_transhell
|
||||
|
||||
# 启动升级任务
|
||||
(pkexec /opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh upgrade-app $PKG_UPGRADE -y 2>&1 > /dev/null ) &
|
||||
cmd_pid=$!
|
||||
(yes n | pkexec ${HERE}/ss-do-upgrade-worker.sh upgrade-app $PKG_UPGRADE -yfq 2>&1 > /dev/null ) &
|
||||
|
||||
# 计算进度百分比
|
||||
progress=$(( count * 100 / total - 1))
|
||||
|
||||
# 动态修改zenity的文本
|
||||
echo "# ${TRANSHELL_CONTENT_UPGRADING_PLEASE_WAIT}"
|
||||
echo "$progress"
|
||||
wait
|
||||
done) | zenity --progress --auto-close --no-cancel --pulsate --text="Preparing..." --height 70 --width 400 --title="${TRANSHELL_CONTENT_SPARK_STORE_UPGRADE_MODEL}" --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
|
||||
|
||||
|
||||
|
||||
|
||||
done
|
||||
) | zenity --progress --auto-close --no-cancel --text="Preparing..." --height 70 --width 400 --title="${TRANSHELL_CONTENT_SPARK_STORE_UPGRADE_MODEL}" --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
|
||||
|
||||
|
||||
#### 更新成功
|
||||
if [ -z "`cat /tmp/spark-store-app-upgrade-status.txt`" ] ; then
|
||||
zenity --info --text "${TRANSHELL_CONTENT_CHOSEN_APP_UPGRADE_FINISHED}" --title "${TRANSHELL_CONTENT_SPARK_STORE_UPGRADE_MODEL}" --height 150 --width 300 --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
|
||||
else
|
||||
#### 更新异常
|
||||
else #### 更新异常
|
||||
zenity --error --text "${TRANSHELL_CONTENT_APP_UGRADE_PROCESS_ERROR_PRESS_CONFIRM_TO_CHECK}" --title "${TRANSHELL_CONTENT_SPARK_STORE_UPGRADE_MODEL}" --height 200 --width 350 --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
|
||||
zenity --text-info --filename=/tmp/spark-store-app-upgrade-log.txt --checkbox="${TRANSHELL_CONTENT_I_ALREDY_COPIED_THE_LOG_HERE_AND_WILL_USE_IT_TO_FEEDBACK}" --title="${TRANSHELL_CONTENT_FEEDBACK_CAN_BE_FOUND_IN_THE_SETTINGS}" --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
rm -f /tmp/spark-store/upgradeStatus.txt
|
||||
rm -f /tmp/spark-store/upgradeStatus.txt
|
||||
# 从最开头
|
||||
|
||||
@@ -9,169 +9,135 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="290"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="289"/>
|
||||
<source>Uninstall</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="346"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="345"/>
|
||||
<source>0</source>
|
||||
<translation type="unfinished">0B {0?}</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="356"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="355"/>
|
||||
<source>Download Times</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="410"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="413"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="441"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="444"/>
|
||||
<source><html><head/><body><p>Capable to deepin 23</p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="528"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="531"/>
|
||||
<source><html><head/><body><p>This app is developed by community user,we give this tag to honor those who contribute to the Linux Ecology</p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="416"/>
|
||||
<source><html><head/><body><p><img src=":/tags/community-small.png"/></p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="435"/>
|
||||
<source><html><head/><body><p><img src=":/tags/ubuntu-small.png"/></p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="448"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="451"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="422"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="425"/>
|
||||
<source><html><head/><body><p>Capable to UOS home 20</p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="454"/>
|
||||
<source><html><head/><body><p><img src=":/tags/uos-small.png"/></p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="467"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="470"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="566"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="569"/>
|
||||
<source><html><head/><body><p>A deepin-wine2 app. Spark Store will automatically configure the wine kit for you.</p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="473"/>
|
||||
<source><html><head/><body><p><img src=":/tags/dwine2-small.png"/></p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="486"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="489"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="547"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="550"/>
|
||||
<source><html><head/><body><p>This is a DTK5 app,which means it would have better effect on Deepin Desktop Environment</p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="492"/>
|
||||
<source><html><head/><body><p><img src=":/tags/dtk-small.png"/></p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="505"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="508"/>
|
||||
<source><html><head/><body><p>Capable to deepin 20</p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="511"/>
|
||||
<source><html><head/><body><p><img src=":/tags/deepin-small.png"/></p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="524"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="527"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="509"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="512"/>
|
||||
<source><html><head/><body><p>An Appimage to deb app.</p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="530"/>
|
||||
<source><html><head/><body><p><img src=":/tags/a2d-small.png"/></p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="549"/>
|
||||
<source><html><head/><body><p><img src=":/tags/dwine5-small.png"/></p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="602"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="644"/>
|
||||
<source>Share</source>
|
||||
<translation type="unfinished">Spk share link</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="609"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="651"/>
|
||||
<source>APP Feedback</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="765"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="806"/>
|
||||
<source>Introduction</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="1068"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="1107"/>
|
||||
<source>Description</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="903"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="943"/>
|
||||
<source>Screen capture</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="244"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="198"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="338"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="372"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="541"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="243"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="210"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="351"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="396"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="590"/>
|
||||
<source>Download and Install</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="429"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="432"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="403"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="406"/>
|
||||
<source><html><head/><body><p>Capable to Ubuntu 22.04</p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="543"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="546"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="585"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="588"/>
|
||||
<source><html><head/><body><p>A Wine app.Spark Store will automatically configure the wine kit for you</p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="1161"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="460"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="463"/>
|
||||
<source><html><head/><body><p>Capable to Debian Stable</p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="1200"/>
|
||||
<source>Update</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="1190"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="1229"/>
|
||||
<source>Contributor</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="1197"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="1236"/>
|
||||
<source>Pkgname</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="1303"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="1342"/>
|
||||
<source>Author</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="1339"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="1378"/>
|
||||
<source>Size</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="1375"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="1414"/>
|
||||
<source>Website</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@@ -186,69 +152,82 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="183"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="365"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="510"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="191"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="383"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="544"/>
|
||||
<source>Reinstall</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="190"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="193"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="385"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="527"/>
|
||||
<source>Launch</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="202"/>
|
||||
<source>Upgrade</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="343"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="483"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="356"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="509"/>
|
||||
<source>Install</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="348"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="361"/>
|
||||
<source>Installing</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="462"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="466"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="470"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="474"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="483"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="487"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="491"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="495"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="499"/>
|
||||
<source>Warning</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="462"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="483"/>
|
||||
<source>The current application does not support or tested on deepin, there may be problems</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="466"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="487"/>
|
||||
<source>The current application does not support or tested on UOS, there may be problems</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="470"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="491"/>
|
||||
<source>The current application does not support or tested on Ubuntu, there may be problems</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="474"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="495"/>
|
||||
<source>The current application does not support or tested on Debian, there may be problems</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="499"/>
|
||||
<source>The current application does not support or tested on current platform, there may be problems</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="544"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="559"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="593"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="608"/>
|
||||
<source>Spark Store</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="544"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="593"/>
|
||||
<source>Uninstall succeeded</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="559"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="608"/>
|
||||
<source>The URL has been copied to the clipboard</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@@ -336,9 +315,9 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="218"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="229"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="226"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="237"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="245"/>
|
||||
<source>Spark Store</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@@ -349,32 +328,32 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="218"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="226"/>
|
||||
<source>Installation complete.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="219"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="220"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="227"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="228"/>
|
||||
<source>Finish</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="227"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="235"/>
|
||||
<source>Retry</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="229"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="230"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="231"/>
|
||||
<source>Error happened in dpkg progress , please check the install info or try to reinstall.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="237"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="238"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="239"/>
|
||||
<source>Error happened in dpkg progress , please check the install info or try to reinstall.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="245"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="246"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="247"/>
|
||||
<source>dpkg progress had been aborted, please check the install info or try to reinstall.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
||||
@@ -9,169 +9,135 @@
|
||||
<translation>Tipo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="290"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="289"/>
|
||||
<source>Uninstall</source>
|
||||
<translation>Desinstalar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="346"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="345"/>
|
||||
<source>0</source>
|
||||
<translation>0</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="356"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="355"/>
|
||||
<source>Download Times</source>
|
||||
<translation>Número de descargas</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="410"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="413"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="441"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="444"/>
|
||||
<source><html><head/><body><p>Capable to deepin 23</p></body></html></source>
|
||||
<translation type="unfinished"><html><head/><body><p>Capaz de deepin 20</p></body></html> {23<?}</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="528"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="531"/>
|
||||
<source><html><head/><body><p>This app is developed by community user,we give this tag to honor those who contribute to the Linux Ecology</p></body></html></source>
|
||||
<translation><html><head/><body><p>Esta aplicación fue desarrollada por usuarios de la comunidad y la Etiquetamos en honor a aquellos que contribuyeron a la ecología de linux.</p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="416"/>
|
||||
<source><html><head/><body><p><img src=":/tags/community-small.png"/></p></body></html></source>
|
||||
<translation><html><head/><body><p><img src=":/tags/community-small.png"/></p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="435"/>
|
||||
<source><html><head/><body><p><img src=":/tags/ubuntu-small.png"/></p></body></html></source>
|
||||
<translation><html><head/><body><p><img src=":/tags/ubuntu-small.png"/></p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="448"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="451"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="422"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="425"/>
|
||||
<source><html><head/><body><p>Capable to UOS home 20</p></body></html></source>
|
||||
<translation><html><head/><body><p>Capaz de UOS home 20</p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="454"/>
|
||||
<source><html><head/><body><p><img src=":/tags/uos-small.png"/></p></body></html></source>
|
||||
<translation><html><head/><body><p><img src=":/tags/uos-small.png"/></p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="467"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="470"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="566"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="569"/>
|
||||
<source><html><head/><body><p>A deepin-wine2 app. Spark Store will automatically configure the wine kit for you.</p></body></html></source>
|
||||
<translation><html><head/><body><p>A deepin-wine2 app. La tienda Spark le configurará automáticamente un traje de vino.</p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="473"/>
|
||||
<source><html><head/><body><p><img src=":/tags/dwine2-small.png"/></p></body></html></source>
|
||||
<translation><html><head/><body><p><img src=":/tags/dwine2-small.png"/></p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="486"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="489"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="547"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="550"/>
|
||||
<source><html><head/><body><p>This is a DTK5 app,which means it would have better effect on Deepin Desktop Environment</p></body></html></source>
|
||||
<translation><html><head/><body><p>Esta es una aplicación dtk5, lo que significa que funcionará mejor en un entorno de escritorio profundo.</p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="492"/>
|
||||
<source><html><head/><body><p><img src=":/tags/dtk-small.png"/></p></body></html></source>
|
||||
<translation><html><head/><body><p><img src=":/tags/dtk-small.png"/></p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="505"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="508"/>
|
||||
<source><html><head/><body><p>Capable to deepin 20</p></body></html></source>
|
||||
<translation><html><head/><body><p>Capaz de deepin 20</p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="511"/>
|
||||
<source><html><head/><body><p><img src=":/tags/deepin-small.png"/></p></body></html></source>
|
||||
<translation><html><head/><body><p><img src=":/tags/deepin-small.png"/></p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="524"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="527"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="509"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="512"/>
|
||||
<source><html><head/><body><p>An Appimage to deb app.</p></body></html></source>
|
||||
<translation><html><head/><body><p>Appimage de la aplicación deb.</p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="530"/>
|
||||
<source><html><head/><body><p><img src=":/tags/a2d-small.png"/></p></body></html></source>
|
||||
<translation><html><head/><body><p><img src=":/tags/a2d-small.png"/></p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="549"/>
|
||||
<source><html><head/><body><p><img src=":/tags/dwine5-small.png"/></p></body></html></source>
|
||||
<translation><html><head/><body><p><img src=":/tags/dwine5-small.png"/></p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="602"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="644"/>
|
||||
<source>Share</source>
|
||||
<translation>Comunión</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="609"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="651"/>
|
||||
<source>APP Feedback</source>
|
||||
<translation>Comentarios de la app</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="765"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="806"/>
|
||||
<source>Introduction</source>
|
||||
<translation>Introducción</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="1068"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="1107"/>
|
||||
<source>Description</source>
|
||||
<translation>Descripción</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="903"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="943"/>
|
||||
<source>Screen capture</source>
|
||||
<translation>Captura de pantalla</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="244"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="198"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="338"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="372"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="541"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="243"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="210"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="351"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="396"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="590"/>
|
||||
<source>Download and Install</source>
|
||||
<translation>Descargar e instalar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="429"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="432"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="403"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="406"/>
|
||||
<source><html><head/><body><p>Capable to Ubuntu 22.04</p></body></html></source>
|
||||
<translation><html><head/><body><p>Capaz de Ubuntu 22.04</p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="543"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="546"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="585"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="588"/>
|
||||
<source><html><head/><body><p>A Wine app.Spark Store will automatically configure the wine kit for you</p></body></html></source>
|
||||
<translation><html><head/><body><p>La aplicación wine. Spark Store configurará automáticamente el kit Wine para usted</p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="1161"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="460"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="463"/>
|
||||
<source><html><head/><body><p>Capable to Debian Stable</p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="1200"/>
|
||||
<source>Update</source>
|
||||
<translation>Modernizar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="1190"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="1229"/>
|
||||
<source>Contributor</source>
|
||||
<translation>Contribuyentes</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="1197"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="1236"/>
|
||||
<source>Pkgname</source>
|
||||
<translation>Nombre del embalaje</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="1303"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="1342"/>
|
||||
<source>Author</source>
|
||||
<translation>Autor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="1339"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="1378"/>
|
||||
<source>Size</source>
|
||||
<translation>Tamaño</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="1375"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="1414"/>
|
||||
<source>Website</source>
|
||||
<translation>Sitio web</translation>
|
||||
</message>
|
||||
@@ -186,69 +152,82 @@
|
||||
<translation>Se ha desactivado el modo desarrollador</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="183"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="365"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="510"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="191"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="383"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="544"/>
|
||||
<source>Reinstall</source>
|
||||
<translation>Reinstalación</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="190"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="193"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="385"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="527"/>
|
||||
<source>Launch</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="202"/>
|
||||
<source>Upgrade</source>
|
||||
<translation>Actualización</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="343"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="483"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="356"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="509"/>
|
||||
<source>Install</source>
|
||||
<translation>Instalación</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="348"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="361"/>
|
||||
<source>Installing</source>
|
||||
<translation>Se está instalando</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="462"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="466"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="470"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="474"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="483"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="487"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="491"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="495"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="499"/>
|
||||
<source>Warning</source>
|
||||
<translation>Aviso</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="462"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="483"/>
|
||||
<source>The current application does not support or tested on deepin, there may be problems</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="466"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="487"/>
|
||||
<source>The current application does not support or tested on UOS, there may be problems</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="470"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="491"/>
|
||||
<source>The current application does not support or tested on Ubuntu, there may be problems</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="474"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="495"/>
|
||||
<source>The current application does not support or tested on Debian, there may be problems</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="499"/>
|
||||
<source>The current application does not support or tested on current platform, there may be problems</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="544"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="559"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="593"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="608"/>
|
||||
<source>Spark Store</source>
|
||||
<translation>SPARK Store</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="544"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="593"/>
|
||||
<source>Uninstall succeeded</source>
|
||||
<translation>Desinstalación exitosa</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="559"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="608"/>
|
||||
<source>The URL has been copied to the clipboard</source>
|
||||
<translation>La URL ha sido copiada al portapapeles</translation>
|
||||
</message>
|
||||
@@ -336,9 +315,9 @@
|
||||
<translation>Descarga completada.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="218"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="229"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="226"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="237"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="245"/>
|
||||
<source>Spark Store</source>
|
||||
<translation>SPARK Store</translation>
|
||||
</message>
|
||||
@@ -349,32 +328,32 @@
|
||||
<translation>Se está instalando</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="218"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="226"/>
|
||||
<source>Installation complete.</source>
|
||||
<translation>La instalación está completa.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="219"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="220"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="227"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="228"/>
|
||||
<source>Finish</source>
|
||||
<translation>Completado</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="227"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="235"/>
|
||||
<source>Retry</source>
|
||||
<translation>Reinterpretar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="229"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="230"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="231"/>
|
||||
<source>Error happened in dpkg progress , please check the install info or try to reinstall.</source>
|
||||
<translation>Se produjo un error durante el proceso dpkg, verifique la información de instalación o intente reinstalar.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="237"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="238"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="239"/>
|
||||
<source>Error happened in dpkg progress , please check the install info or try to reinstall.</source>
|
||||
<translation>Se produjo un error durante el proceso dpkg, verifique la información de instalación o intente reinstalar.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="245"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="246"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="247"/>
|
||||
<source>dpkg progress had been aborted, please check the install info or try to reinstall.</source>
|
||||
<translation>El proceso de DPKG ha sido interrumpido, compruebe la información de instalación o intente reinstalar.</translation>
|
||||
</message>
|
||||
|
||||
@@ -9,169 +9,135 @@
|
||||
<translation>Type</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="290"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="289"/>
|
||||
<source>Uninstall</source>
|
||||
<translation>Désinstaller</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="346"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="345"/>
|
||||
<source>0</source>
|
||||
<translation>0</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="356"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="355"/>
|
||||
<source>Download Times</source>
|
||||
<translation>Nombre de téléchargements</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="410"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="413"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="441"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="444"/>
|
||||
<source><html><head/><body><p>Capable to deepin 23</p></body></html></source>
|
||||
<translation type="unfinished"><html><head/><body><p>Capable de la deepin 20</p></body></html> {23<?}</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="528"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="531"/>
|
||||
<source><html><head/><body><p>This app is developed by community user,we give this tag to honor those who contribute to the Linux Ecology</p></body></html></source>
|
||||
<translation><html><head/><body><p>Cette application a été développée par des utilisateurs de la communauté et nous avons donné ce label à ceux qui ont contribué à l'écologie de Linux</p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="416"/>
|
||||
<source><html><head/><body><p><img src=":/tags/community-small.png"/></p></body></html></source>
|
||||
<translation><html><head/><body><p><img src=":/tags/community-small.png"/></p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="435"/>
|
||||
<source><html><head/><body><p><img src=":/tags/ubuntu-small.png"/></p></body></html></source>
|
||||
<translation><html><head/><body><p><img src=":/tags/ubuntu-small.png"/></p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="448"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="451"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="422"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="425"/>
|
||||
<source><html><head/><body><p>Capable to UOS home 20</p></body></html></source>
|
||||
<translation><html><head/><body><p>Capable de la home UOS 20</p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="454"/>
|
||||
<source><html><head/><body><p><img src=":/tags/uos-small.png"/></p></body></html></source>
|
||||
<translation><html><head/><body><p><img src=":/tags/uos-small.png"/></p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="467"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="470"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="566"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="569"/>
|
||||
<source><html><head/><body><p>A deepin-wine2 app. Spark Store will automatically configure the wine kit for you.</p></body></html></source>
|
||||
<translation><html><head/><body><p>Une application deepin-wine2. Le Spark Store configure automatiquement votre pack de vins.</p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="473"/>
|
||||
<source><html><head/><body><p><img src=":/tags/dwine2-small.png"/></p></body></html></source>
|
||||
<translation><html><head/><body><p><img src=":/tags/dwine2-small.png"/></p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="486"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="489"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="547"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="550"/>
|
||||
<source><html><head/><body><p>This is a DTK5 app,which means it would have better effect on Deepin Desktop Environment</p></body></html></source>
|
||||
<translation><html><head/><body><p>C'est une application dtk5, ce qui signifie qu'elle fonctionnera mieux dans un environnement de bureau profond.</p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="492"/>
|
||||
<source><html><head/><body><p><img src=":/tags/dtk-small.png"/></p></body></html></source>
|
||||
<translation><html><head/><body><p><img src=":/tags/dtk-small.png"/></p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="505"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="508"/>
|
||||
<source><html><head/><body><p>Capable to deepin 20</p></body></html></source>
|
||||
<translation><html><head/><body><p>Capable de la deepin 20</p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="511"/>
|
||||
<source><html><head/><body><p><img src=":/tags/deepin-small.png"/></p></body></html></source>
|
||||
<translation><html><head/><body><p><img src=":/tags/deepin-small.png"/></p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="524"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="527"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="509"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="512"/>
|
||||
<source><html><head/><body><p>An Appimage to deb app.</p></body></html></source>
|
||||
<translation><html><head/><body><p>Appimage pour l'application DEB</p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="530"/>
|
||||
<source><html><head/><body><p><img src=":/tags/a2d-small.png"/></p></body></html></source>
|
||||
<translation><html><head/><body><p><img src=":/tags/a2d-small.png"/></p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="549"/>
|
||||
<source><html><head/><body><p><img src=":/tags/dwine5-small.png"/></p></body></html></source>
|
||||
<translation><html><head/><body><p><img src=":/tags/dwine5-small.png"/></p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="602"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="644"/>
|
||||
<source>Share</source>
|
||||
<translation>Au total</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="609"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="651"/>
|
||||
<source>APP Feedback</source>
|
||||
<translation>App feedback</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="765"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="806"/>
|
||||
<source>Introduction</source>
|
||||
<translation>Présentation</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="1068"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="1107"/>
|
||||
<source>Description</source>
|
||||
<translation>Description</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="903"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="943"/>
|
||||
<source>Screen capture</source>
|
||||
<translation>Captures d'écran</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="244"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="198"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="338"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="372"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="541"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="243"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="210"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="351"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="396"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="590"/>
|
||||
<source>Download and Install</source>
|
||||
<translation>Télécharger et installer</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="429"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="432"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="403"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="406"/>
|
||||
<source><html><head/><body><p>Capable to Ubuntu 22.04</p></body></html></source>
|
||||
<translation><html><head/><body><p>Capable de la Ubuntu 22.04</p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="543"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="546"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="585"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="588"/>
|
||||
<source><html><head/><body><p>A Wine app.Spark Store will automatically configure the wine kit for you</p></body></html></source>
|
||||
<translation><html><head/><body><p>L'application wine. Spark Store configure automatiquement le kit Wine pour vous</p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="1161"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="460"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="463"/>
|
||||
<source><html><head/><body><p>Capable to Debian Stable</p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="1200"/>
|
||||
<source>Update</source>
|
||||
<translation>Moderniser</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="1190"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="1229"/>
|
||||
<source>Contributor</source>
|
||||
<translation>Contributeurs</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="1197"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="1236"/>
|
||||
<source>Pkgname</source>
|
||||
<translation>Nom de l'emballage</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="1303"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="1342"/>
|
||||
<source>Author</source>
|
||||
<translation>Auteur</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="1339"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="1378"/>
|
||||
<source>Size</source>
|
||||
<translation>Taille</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.ui" line="1375"/>
|
||||
<location filename="../src/pages/appintopage.ui" line="1414"/>
|
||||
<source>Website</source>
|
||||
<translation>Site Web</translation>
|
||||
</message>
|
||||
@@ -186,69 +152,82 @@
|
||||
<translation>Mode développeur désactivé</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="183"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="365"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="510"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="191"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="383"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="544"/>
|
||||
<source>Reinstall</source>
|
||||
<translation>Réinstaller</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="190"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="193"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="385"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="527"/>
|
||||
<source>Launch</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="202"/>
|
||||
<source>Upgrade</source>
|
||||
<translation>Mise à niveau</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="343"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="483"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="356"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="509"/>
|
||||
<source>Install</source>
|
||||
<translation>Installation</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="348"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="361"/>
|
||||
<source>Installing</source>
|
||||
<translation>Installation en cours</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="462"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="466"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="470"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="474"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="483"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="487"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="491"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="495"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="499"/>
|
||||
<source>Warning</source>
|
||||
<translation>Avertissement</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="462"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="483"/>
|
||||
<source>The current application does not support or tested on deepin, there may be problems</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="466"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="487"/>
|
||||
<source>The current application does not support or tested on UOS, there may be problems</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="470"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="491"/>
|
||||
<source>The current application does not support or tested on Ubuntu, there may be problems</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="474"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="495"/>
|
||||
<source>The current application does not support or tested on Debian, there may be problems</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="499"/>
|
||||
<source>The current application does not support or tested on current platform, there may be problems</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="544"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="559"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="593"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="608"/>
|
||||
<source>Spark Store</source>
|
||||
<translation>Le Spark store</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="544"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="593"/>
|
||||
<source>Uninstall succeeded</source>
|
||||
<translation>Désinstallation réussie</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/pages/appintopage.cpp" line="559"/>
|
||||
<location filename="../src/pages/appintopage.cpp" line="608"/>
|
||||
<source>The URL has been copied to the clipboard</source>
|
||||
<translation>L'URL a été copiée dans le presse - papiers</translation>
|
||||
</message>
|
||||
@@ -336,9 +315,9 @@
|
||||
<translation>Le téléchargement est terminé.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="218"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="229"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="226"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="237"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="245"/>
|
||||
<source>Spark Store</source>
|
||||
<translation>Le Spark store</translation>
|
||||
</message>
|
||||
@@ -349,32 +328,32 @@
|
||||
<translation>Installation en cours</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="218"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="226"/>
|
||||
<source>Installation complete.</source>
|
||||
<translation>L'installation est terminée.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="219"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="220"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="227"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="228"/>
|
||||
<source>Finish</source>
|
||||
<translation>Terminé</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="227"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="235"/>
|
||||
<source>Retry</source>
|
||||
<translation>Essayez à nouveau</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="229"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="230"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="231"/>
|
||||
<source>Error happened in dpkg progress , please check the install info or try to reinstall.</source>
|
||||
<translation>Une erreur s'est produite dans le processus dpkg, vérifiez les informations d'installation ou essayez de réinstaller.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="237"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="238"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="239"/>
|
||||
<source>Error happened in dpkg progress , please check the install info or try to reinstall.</source>
|
||||
<translation>Une erreur s'est produite dans le processus dpkg, vérifiez les informations d'installation ou essayez de réinstaller.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="245"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="246"/>
|
||||
<location filename="../src/widgets/common/downloaditem.cpp" line="247"/>
|
||||
<source>dpkg progress had been aborted, please check the install info or try to reinstall.</source>
|
||||
<translation>La progression de DPKG a été interrompue, veuillez vérifier les informations d’installation ou essayer de réinstaller.</translation>
|
||||
</message>
|
||||
|
||||