mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-06-01 22:19:51 +08:00
Compare commits
30 Commits
Author | SHA1 | Date | |
---|---|---|---|
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 |
.gitee
.workflow
DOCS
FAQ.mdFAQ.zh.mdREADME.mdREADME.zh.mddebian
patchs
pkg/usr/share/ssinstall-local/transhell
src
tool
@ -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")
|
||||
|
||||
|
@ -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
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 以后的操作系统版本,您无需安装依赖包,您需要按照上面的操作直接安装本体程序。
|
||||
|
||||
|
@ -152,7 +152,7 @@ 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)
|
||||
|
||||
---
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# 星火应用商店
|
||||
[](https://gitee.com/spark-store-project/spark-store/stargazers) [](https://gitee.com/spark-store-project/spark-store/members)
|
||||
|
||||

|
||||
|
||||
|
||||
## 简介
|
||||
@ -171,9 +171,11 @@ 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)。
|
||||
|
||||
---
|
||||
|
||||
|
30
debian/changelog
vendored
30
debian/changelog
vendored
@ -1,4 +1,18 @@
|
||||
spark-store (4.5.1) UNRELEASED; urgency=medium
|
||||
spark-store (4.7.0) UNRELEASED; urgency=medium
|
||||
|
||||
* aptss 第二、三阶段加速
|
||||
* 修复部分应用无法启动的问题
|
||||
* 支持使用 ACE deepin23 trixie
|
||||
|
||||
-- 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 区的展示方式
|
||||
@ -200,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下编译出错
|
||||
* 薪怎:支持崩溃日志收集系统
|
||||
@ -437,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 显示开发者模式未开启
|
||||
* 修复:从托盘打开主窗口时透明度动画不流畅
|
||||
* 修复:主窗口关闭后,从托盘打开关于窗口会被主窗口遮挡
|
||||
@ -519,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 构造函数中进行
|
||||
@ -539,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
|
||||
|
||||
@ -751,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
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
|
||||
|
@ -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包"
|
@ -45,24 +45,33 @@
|
||||
<file>icon/light/update.svg</file>
|
||||
<file>icon/logo.svg</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>translations/qtwebengine_zh.qm</file>
|
||||
<file>tags/debian.svg</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@ -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
|
||||
}
|
||||
|
Binary file not shown.
Before ![]() (image error) Size: 4.7 KiB |
Binary file not shown.
Before ![]() (image error) Size: 5.7 KiB |
Binary file not shown.
Before ![]() (image error) Size: 4.8 KiB |
Binary file not shown.
Before ![]() (image error) Size: 5.0 KiB |
Binary file not shown.
Before ![]() (image error) Size: 4.9 KiB |
Binary file not shown.
Before ![]() (image error) Size: 4.7 KiB |
Binary file not shown.
Before ![]() (image error) Size: 4.5 KiB |
File diff suppressed because one or more lines are too long
Before (image error) Size: 19 KiB |
Binary file not shown.
Before ![]() (image error) Size: 5.0 KiB |
File diff suppressed because one or more lines are too long
Before (image error) Size: 18 KiB |
Binary file not shown.
Before ![]() (image error) Size: 4.7 KiB |
18
src/main.cpp
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.";
|
||||
|
@ -562,7 +562,7 @@ 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();
|
||||
|
||||
@ -595,16 +595,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});
|
||||
}
|
@ -363,6 +363,19 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_9">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
@ -383,7 +396,7 @@
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>16777215</height>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
@ -392,8 +405,8 @@
|
||||
<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.png" height=40 width=40 /></p></body></html></string>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../assets/assets.qrc">:/tags/ubuntu.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -402,7 +415,7 @@
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>16777215</height>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
@ -411,8 +424,8 @@
|
||||
<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-authorize.svg" height=40 width=40 /></p></body></html></string>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../assets/assets.qrc">:/tags/uos.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -421,7 +434,7 @@
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>16777215</height>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
@ -430,21 +443,27 @@
|
||||
<property name="whatsThis">
|
||||
<string><html><head/><body><p>Capable to deepin 23</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><img src=":/tags/deepin.svg" height=40 width=40 /></p></body></html></string>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../assets/assets.qrc">:/tags/deepin.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="tag_debian">
|
||||
<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="text">
|
||||
<string><html><head/><body><p><img src=":/tags/debian.svg" height=40 width=40 /></p></body></html></string>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../assets/assets.qrc">:/tags/debian.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -463,22 +482,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_9">
|
||||
<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>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_13">
|
||||
<item>
|
||||
@ -499,7 +502,7 @@
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>16777215</height>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
@ -508,8 +511,8 @@
|
||||
<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.png"height=40 width=40 /></p></body></html></string>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../assets/assets.qrc">:/tags/a2d.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -518,7 +521,7 @@
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>16777215</height>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
@ -527,8 +530,8 @@
|
||||
<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.svg" height=40 width=40 /></p></body></html></string>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../assets/assets.qrc">:/tags/community.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -537,7 +540,7 @@
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>16777215</height>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
@ -546,8 +549,8 @@
|
||||
<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/logo_icon.svg" height=40 width=40 /></p></body></html></string>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../assets/assets.qrc">:/tags/dtk.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -556,7 +559,7 @@
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>16777215</height>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
@ -565,8 +568,8 @@
|
||||
<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" height=40 width=40 ></p></body></html></string>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../assets/assets.qrc">:/tags/dwine2.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -575,7 +578,7 @@
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>16777215</height>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
@ -584,8 +587,8 @@
|
||||
<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.svg" height=40 width=40 /></p></body></html></string>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../assets/assets.qrc">:/tags/dwine5.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -1449,6 +1452,8 @@ QListWidget::item::selected
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<resources>
|
||||
<include location="../assets/assets.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
@ -198,7 +198,7 @@ void Utils::setQPAPlatform()
|
||||
// }
|
||||
else
|
||||
{
|
||||
qputenv("QT_QPA_PLATFORM", "dxcb");
|
||||
qputenv("QT_QPA_PLATFORM", "dxcb;xcb");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -186,12 +186,21 @@ 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=
|
||||
@ -367,15 +376,15 @@ prepare_auth(){
|
||||
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(){
|
||||
if [ "$APT_FAST_APT_AUTH" -eq 0 ]; then
|
||||
echo "$1"
|
||||
return
|
||||
fi
|
||||
for auth_info in "${AUTH_INFO_PARSED[@]}"; do
|
||||
# convert to array, don't escape variable here
|
||||
auth_info_arr=($auth_info)
|
||||
@ -430,44 +439,40 @@ get_uris(){
|
||||
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 "$CLEANUP_STATE"
|
||||
fi
|
||||
prepare_auth
|
||||
local tmpdir=$(mktemp -d) || {
|
||||
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="$@"
|
||||
|
||||
local display_line="" # 添加局部变量并初始化为空
|
||||
|
||||
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" ] && continue
|
||||
uri="$(get_auth "${uri//"'"/}")"
|
||||
[ -z "$uri" ] && return
|
||||
uri="${uri//"'"/}"
|
||||
[ "$APT_FAST_APT_AUTH" -ne 0 ] && uri="$(get_auth "$uri")"
|
||||
IFS=':' read -r hash_algo checksum _ <<<"$checksum_string"
|
||||
|
||||
filename_decoded="$(urldecode "$filename")"
|
||||
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="${display_line}$pkg_name_decoded $pkg_version_decoded"
|
||||
display_line="${display_line} $(echo "$filesize" | numfmt --to=iec-i --suffix=B)\n"
|
||||
|
||||
## 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.
|
||||
|
||||
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 ;;
|
||||
@ -522,30 +527,27 @@ get_uris(){
|
||||
hash_algo=
|
||||
fi
|
||||
|
||||
# 原来利用文件锁写入,现在改为写入当前线程的临时文件
|
||||
{
|
||||
get_mirrors "$uri"
|
||||
[ -n "$hash_algo" ] && echo " checksum=$hash_algo=$checksum"
|
||||
echo " out=$filename"
|
||||
} >> "$thread_file"
|
||||
|
||||
# 使用文件锁安全写入下载列表
|
||||
(
|
||||
flock -x 200 # 获取排他锁
|
||||
{
|
||||
get_mirrors "$uri"
|
||||
[ -n "$hash_algo" ] && echo " checksum=$hash_algo=$checksum"
|
||||
echo " out=$filename"
|
||||
} >> "$DLLIST"
|
||||
) 200>>"$DLLIST" # 使用文件描述符200关联锁文件
|
||||
|
||||
# 将显示信息和文件大小存入临时文件
|
||||
echo "$display_line" >> "$tmpdir/display"
|
||||
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))
|
||||
@ -554,7 +556,7 @@ get_uris(){
|
||||
(
|
||||
for ((j=start; j<=end; j++)); do
|
||||
[ -z "${pkg_uri_list[j]}" ] && continue
|
||||
process_package "${pkg_uri_list[j]}"
|
||||
process_package "${pkg_uri_list[j]}" "$thread_file"
|
||||
done
|
||||
) &
|
||||
done
|
||||
@ -562,6 +564,15 @@ get_uris(){
|
||||
# 等待所有后台任务完成
|
||||
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")"
|
||||
@ -574,12 +585,10 @@ get_uris(){
|
||||
|
||||
# 清理临时目录
|
||||
rm -rf "$tmpdir"
|
||||
|
||||
#cat "$DLLIST"
|
||||
#exit
|
||||
}
|
||||
|
||||
|
||||
|
||||
display_downloadfile(){
|
||||
if [ -n "$VERBOSE_OUTPUT" ]; then
|
||||
cat "$DLLIST"
|
||||
@ -590,7 +599,7 @@ display_downloadfile(){
|
||||
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"
|
||||
@ -827,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=""
|
||||
;;
|
||||
|
225
tool/ssaudit
225
tool/ssaudit
@ -1,9 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
SPARK_DOWNLOAD_SERVER_URL="https://d.spark-app.store/"
|
||||
SPARK_DOWNLOAD_SERVER_URL_NO_PROTOCOL="d.spark-app.store"
|
||||
source /opt/durapps/spark-store/bin/bashimport/transhell.amber
|
||||
|
||||
load_transhell_debug
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
trap 'unlock_file $DEBPATH' EXIT
|
||||
case $(arch) in
|
||||
x86_64)
|
||||
STORE_URL="store"
|
||||
@ -11,9 +14,13 @@ case $(arch) in
|
||||
aarch64)
|
||||
STORE_URL="aarch64-store"
|
||||
;;
|
||||
loongarch64)
|
||||
STORE_URL="loong64-store"
|
||||
STORE_LIST_URL="-loong64"
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Spark Store Install script. 星火商店审核脚本"
|
||||
echo "Spark Store Audit script. 星火商店审核脚本"
|
||||
|
||||
function pkexec_as_current_user() {
|
||||
local user=$(who | awk '{print $1}' | head -n 1)
|
||||
@ -47,6 +54,7 @@ function exec_create_desktop_file() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
function zenity() {
|
||||
local user=$(who | awk '{print $1}' | head -n 1)
|
||||
local uid=$(id -u "$user")
|
||||
@ -54,33 +62,47 @@ function 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,是星火域名单目录仓库配置"
|
||||
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")
|
||||
IS_SHA512SUM_CHECKED=skipped
|
||||
}
|
||||
|
||||
function lock_file(){
|
||||
chattr +i "$1"
|
||||
}
|
||||
|
||||
function unlock_file(){
|
||||
chattr -i "$1"
|
||||
}
|
||||
|
||||
function ensure_aptss_exist(){
|
||||
|
||||
if command -v aptss &>/dev/null; then
|
||||
aptss update
|
||||
else
|
||||
local deb_file="/tmp/spark-store-console-in-container_latest_all.deb"
|
||||
|
||||
# Download package
|
||||
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
|
||||
|
||||
# Install package
|
||||
if ! apt install -y "$deb_file"; then
|
||||
echo "安装 .deb 包失败" >&2
|
||||
rm -f "$deb_file"
|
||||
return 1
|
||||
fi
|
||||
rm -f "$deb_file"
|
||||
|
||||
# Verify installation
|
||||
if ! command -v aptss &>/dev/null; then
|
||||
echo "成功安装但未找到 aptss 命令" >&2
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
export -f ensure_aptss_exist
|
||||
####################################
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
@ -90,11 +112,7 @@ if [ $# -eq 0 ]; then
|
||||
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}"
|
||||
@ -102,48 +120,135 @@ if [ "$(id -u)" != "0" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DEBPATH=$(realpath "$1")
|
||||
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}
|
||||
popd
|
||||
if [ ! -f "$1" ]; then
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
exit 1
|
||||
else
|
||||
DEBPATH=$(realpath "$1")
|
||||
fi
|
||||
else
|
||||
DEBPATH=$(realpath "$1")
|
||||
fi
|
||||
|
||||
lock_file "$DEBPATH"
|
||||
|
||||
hash_check "$DEBPATH"
|
||||
|
||||
|
||||
|
||||
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
|
||||
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="$?"
|
||||
# 安装失败后进行 aptss 刷新,随后尝试在主机安装
|
||||
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="$?"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$try_run_ret" -ne 0 ]; then
|
||||
if [ "$try_run_ret" -ne 0 ]; then ## 若安装检测仍然失败
|
||||
if [[ "$IS_ACE_ENV" == "" ]];then ## 如果未在ACE环境中
|
||||
# 定义按顺序尝试的ACE环境(命令:推荐安装包)
|
||||
declare -a ace_commands_order=(
|
||||
"bookworm-run:amber-ce-bookworm"
|
||||
"trixie-run:amber-ce-trixie"
|
||||
"deepin23-run:amber-ce-deepin23"
|
||||
)
|
||||
|
||||
success=false
|
||||
recommendation_msg=""
|
||||
# 收集所有推荐信息
|
||||
for ace_entry in "${ace_commands_order[@]}"; do
|
||||
recommendation_msg+="您可安装 ${ace_entry%%:*} 兼容环境后重试: ${ace_entry#*:}\n"
|
||||
done
|
||||
|
||||
# 按顺序尝试每个ACE环境
|
||||
for ace_entry in "${ace_commands_order[@]}"; do
|
||||
ace_cmd=${ace_entry%%:*}
|
||||
if command -v "$ace_cmd" >/dev/null 2>&1; then
|
||||
echo "----------------------------------------"
|
||||
echo "正在尝试使用 $ace_cmd 环境安装..."
|
||||
echo "----------------------------------------"
|
||||
|
||||
# 在ACE环境中执行安装检测
|
||||
$ace_cmd ensure_aptss_exist
|
||||
try_run_output=$($ace_cmd aptss install --dry-run "$DEBPATH" 2>&1)
|
||||
try_run_ret="$?"
|
||||
|
||||
# 如果首次检测失败则更新后重试
|
||||
if [ "$try_run_ret" -ne 0 ]; then
|
||||
$ace_cmd aptss update
|
||||
try_run_output=$($ace_cmd aptss install --dry-run "$DEBPATH" 2>&1)
|
||||
try_run_ret="$?"
|
||||
fi
|
||||
|
||||
# 最终检测结果处理
|
||||
if [ "$try_run_ret" -eq 0 ]; then
|
||||
echo "----------------------------------------"
|
||||
echo "在 $ace_cmd 环境中预检成功,开始安装..."
|
||||
echo "----------------------------------------"
|
||||
$ace_cmd 'dpkg -i "$DEBPATH" || aptss install "$DEBPATH" -yfq'
|
||||
success=true
|
||||
break # 跳出循环
|
||||
else
|
||||
echo "----------------------------------------"
|
||||
echo "在 $ace_cmd 环境中安装预检失败,错误信息:"
|
||||
echo -e "${try_run_output}"
|
||||
echo "----------------------------------------"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if ! $success; then
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
echo -e "${try_run_output}"
|
||||
echo -e "所有ACE环境尝试失败,推荐安装以下任一兼容环境:\n${recommendation_msg}"
|
||||
exit "$try_run_ret"
|
||||
fi
|
||||
else # 已经在ACE环境中仍失败直接退出
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
echo -e "${try_run_output}"
|
||||
exit "$try_run_ret"
|
||||
fi
|
||||
else ## 如果主机安装检测成功
|
||||
dpkg -i "$DEBPATH" || aptss install "$DEBPATH" -yfq
|
||||
fi
|
||||
|
||||
dpkg -i "$DEBPATH" || aptss install "$DEBPATH" -yf
|
||||
|
||||
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}"
|
||||
else
|
||||
echo "软件包未安装:$package_name"
|
||||
echo "安装异常!抛出错误"
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
fi
|
||||
### 退出阶段保持不变 ###
|
||||
if [ "$?" = "0" ] && [ "$2" = "--delete-after-install" ]; then
|
||||
if dpkg -s "$package_name" >/dev/null 2>&1; then
|
||||
echo "软件包已安装:$package_name"
|
||||
create_desktop_file
|
||||
unlock_file $DEBPATH
|
||||
rm "$DEBPATH"
|
||||
echo "${TRANSHELL_CONTENT_DEB_IS_DELETED}"
|
||||
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"
|
||||
echo "安装异常!抛出错误"
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
fi
|
||||
echo "软件包未安装:$package_name"
|
||||
echo "安装异常!抛出错误"
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
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"
|
||||
echo "安装异常!抛出错误"
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
166
tool/ssinstall
166
tool/ssinstall
@ -1,6 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
SPARK_DOWNLOAD_SERVER_URL="https://d.spark-app.store/"
|
||||
SPARK_DOWNLOAD_SERVER_URL_NO_PROTOCOL="d.spark-app.store"
|
||||
source /opt/durapps/spark-store/bin/bashimport/transhell.amber
|
||||
|
||||
load_transhell_debug
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
@ -60,15 +62,15 @@ function zenity() {
|
||||
}
|
||||
|
||||
function hash_check() {
|
||||
if [ ! -e "/var/lib/aptss/lists/d.spark-app.store_${STORE_URL}_Packages" ] && \
|
||||
if [ ! -e "/var/lib/aptss/lists/${SPARK_DOWNLOAD_SERVER_URL_NO_PROTOCOL}_${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"
|
||||
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"
|
||||
echo "星火仓库的Packages位置为 $PACKAGES_DATA_PATH,是星火域名仓库配置"
|
||||
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"
|
||||
@ -94,6 +96,35 @@ function unlock_file(){
|
||||
chattr -i "$1"
|
||||
}
|
||||
|
||||
function ensure_aptss_exist(){
|
||||
|
||||
if command -v aptss &>/dev/null; then
|
||||
aptss update
|
||||
else
|
||||
local deb_file="/tmp/spark-store-console-in-container_latest_all.deb"
|
||||
|
||||
# Download package
|
||||
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
|
||||
|
||||
# Install package
|
||||
if ! apt install -y "$deb_file"; then
|
||||
echo "安装 .deb 包失败" >&2
|
||||
rm -f "$deb_file"
|
||||
return 1
|
||||
fi
|
||||
rm -f "$deb_file"
|
||||
|
||||
# Verify installation
|
||||
if ! command -v aptss &>/dev/null; then
|
||||
echo "成功安装但未找到 aptss 命令" >&2
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
export -f ensure_aptss_exist
|
||||
####################################
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
@ -113,6 +144,7 @@ fi
|
||||
|
||||
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/')
|
||||
@ -149,47 +181,107 @@ 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
|
||||
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="$?"
|
||||
# 安装失败后进行 aptss 刷新,随后尝试在主机安装
|
||||
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="$?"
|
||||
fi
|
||||
|
||||
if [ "$try_run_ret" -ne 0 ]; then
|
||||
fi
|
||||
|
||||
if [ "$try_run_ret" -ne 0 ]; then ## 若安装检测仍然失败
|
||||
if [[ "$IS_ACE_ENV" == "" ]];then ## 如果未在ACE环境中
|
||||
# 定义按顺序尝试的ACE环境(命令:推荐安装包)
|
||||
declare -a ace_commands_order=(
|
||||
"bookworm-run:amber-ce-bookworm"
|
||||
"trixie-run:amber-ce-trixie"
|
||||
"deepin23-run:amber-ce-deepin23"
|
||||
)
|
||||
|
||||
success=false
|
||||
recommendation_msg=""
|
||||
# 收集所有推荐信息
|
||||
for ace_entry in "${ace_commands_order[@]}"; do
|
||||
recommendation_msg+="您可安装 ${ace_entry%%:*} 兼容环境后重试: ${ace_entry#*:}\n"
|
||||
done
|
||||
|
||||
# 按顺序尝试每个ACE环境
|
||||
for ace_entry in "${ace_commands_order[@]}"; do
|
||||
ace_cmd=${ace_entry%%:*}
|
||||
if command -v "$ace_cmd" >/dev/null 2>&1; then
|
||||
echo "----------------------------------------"
|
||||
echo "正在尝试使用 $ace_cmd 环境安装..."
|
||||
echo "----------------------------------------"
|
||||
|
||||
# 在ACE环境中执行安装检测
|
||||
$ace_cmd ensure_aptss_exist
|
||||
try_run_output=$($ace_cmd aptss install --dry-run "$DEBPATH" 2>&1)
|
||||
try_run_ret="$?"
|
||||
|
||||
# 如果首次检测失败则更新后重试
|
||||
if [ "$try_run_ret" -ne 0 ]; then
|
||||
$ace_cmd aptss update
|
||||
try_run_output=$($ace_cmd aptss install --dry-run "$DEBPATH" 2>&1)
|
||||
try_run_ret="$?"
|
||||
fi
|
||||
|
||||
# 最终检测结果处理
|
||||
if [ "$try_run_ret" -eq 0 ]; then
|
||||
echo "----------------------------------------"
|
||||
echo "在 $ace_cmd 环境中预检成功,开始安装..."
|
||||
echo "----------------------------------------"
|
||||
$ace_cmd 'dpkg -i "$DEBPATH" || aptss install "$DEBPATH" -yfq'
|
||||
success=true
|
||||
break # 跳出循环
|
||||
else
|
||||
echo "----------------------------------------"
|
||||
echo "在 $ace_cmd 环境中安装预检失败,错误信息:"
|
||||
echo -e "${try_run_output}"
|
||||
echo "----------------------------------------"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if ! $success; then
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
echo -e "${try_run_output}"
|
||||
echo -e "所有ACE环境尝试失败,推荐安装以下任一兼容环境:\n${recommendation_msg}"
|
||||
exit "$try_run_ret"
|
||||
fi
|
||||
else # 已经在ACE环境中仍失败直接退出
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
echo -e "${try_run_output}"
|
||||
exit "$try_run_ret"
|
||||
fi
|
||||
else ## 如果主机安装检测成功
|
||||
dpkg -i "$DEBPATH" || aptss install "$DEBPATH" -yfq
|
||||
fi
|
||||
|
||||
dpkg -i "$DEBPATH" || aptss install "$DEBPATH" -yf
|
||||
|
||||
unlock_file "$DEBPATH"
|
||||
|
||||
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}"
|
||||
else
|
||||
echo "软件包未安装:$package_name"
|
||||
echo "安装异常!抛出错误"
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
fi
|
||||
### 退出阶段保持不变 ###
|
||||
if [ "$?" = "0" ] && [ "$2" = "--delete-after-install" ]; then
|
||||
if dpkg -s "$package_name" >/dev/null 2>&1; then
|
||||
echo "软件包已安装:$package_name"
|
||||
create_desktop_file
|
||||
unlock_file $DEBPATH
|
||||
rm "$DEBPATH"
|
||||
echo "${TRANSHELL_CONTENT_DEB_IS_DELETED}"
|
||||
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"
|
||||
echo "安装异常!抛出错误"
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
fi
|
||||
echo "软件包未安装:$package_name"
|
||||
echo "安装异常!抛出错误"
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
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"
|
||||
echo "安装异常!抛出错误"
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
129
tool/ssinstall-local
Executable file
129
tool/ssinstall-local
Executable file
@ -0,0 +1,129 @@
|
||||
#!/bin/bash
|
||||
SPARK_DOWNLOAD_SERVER_URL="https://d.spark-app.store/"
|
||||
SPARK_DOWNLOAD_SERVER_URL_NO_PROTOCOL="d.spark-app.store"
|
||||
source /opt/durapps/spark-store/bin/bashimport/transhell.amber
|
||||
|
||||
load_transhell_debug
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
help(){
|
||||
echo "Spark Store 安装脚本使用说明:"
|
||||
echo "用法: $0 [选项] <deb文件路径>"
|
||||
echo ""
|
||||
echo "选项:"
|
||||
echo " -h, --help 显示此帮助信息"
|
||||
echo " --delete-after-install 安装完成后删除deb文件"
|
||||
echo ""
|
||||
echo "示例:"
|
||||
echo " $0 /path/to/package.deb"
|
||||
echo " $0 --delete-after-install /path/to/package.deb"
|
||||
}
|
||||
|
||||
parse_args() {
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
-h | --help)
|
||||
help
|
||||
exit 0
|
||||
;;
|
||||
--delete-after-install)
|
||||
DELETE_AFTER_INSTALL="1"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
DEBPATH="$1"
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
parse_args "$@"
|
||||
|
||||
echo "Spark Store Install script. 星火商店安装脚本"
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
####################################
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "没有接收到参数,退出"
|
||||
help
|
||||
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
|
||||
|
||||
package_name=$(dpkg-deb -f "$DEBPATH" Package)
|
||||
echo "Package name is $package_name"
|
||||
try_run_output=$(aptss --dry-run install "$DEBPATH")
|
||||
try_run_ret="$?"
|
||||
# 安装失败后进行 aptss 刷新,随后尝试安装
|
||||
if [ "$try_run_ret" -ne 0 ]; then
|
||||
aptss update
|
||||
try_run_output=$(aptss --dry-run install "$DEBPATH")
|
||||
try_run_ret="$?"
|
||||
fi
|
||||
|
||||
if [ "$try_run_ret" = "0" ]; then ## 若安装检测成功
|
||||
dpkg -i "$DEBPATH" || aptss install "$DEBPATH" -yfq
|
||||
else
|
||||
echo "Package manager quit with exit code.Here is the log"
|
||||
echo "包管理器以错误代码退出.日志如下"
|
||||
echo
|
||||
echo -e "${try_run_output}"
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
### 退出阶段
|
||||
if [ "$?" = "0" ]; then
|
||||
if dpkg -s "$package_name" >/dev/null 2>&1; then
|
||||
echo "软件包已安装:$package_name"
|
||||
create_desktop_file
|
||||
if [ "$DELETE_AFTER_INSTALL" = "1" ];then
|
||||
rm "$DEBPATH"
|
||||
echo "${TRANSHELL_CONTENT_DEB_IS_DELETED}"
|
||||
else
|
||||
echo "${TRANSHELL_CONTENT_WILL_NOT_DELETE_DEB}"
|
||||
fi
|
||||
else
|
||||
echo "软件包未安装:$package_name"
|
||||
echo "安装异常!抛出错误"
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "安装异常!抛出错误"
|
||||
echo "OMG-IT-GOES-WRONG"
|
||||
exit 1
|
||||
fi
|
@ -1,2 +1,42 @@
|
||||
#!/bin/bash
|
||||
dpkg -l | grep "^ii $1 " > /dev/null
|
||||
dpkg -s "$1" > /dev/null
|
||||
RET="$?"
|
||||
if [[ "$RET" != "0" ]] &&[[ "$IS_ACE_ENV" == "" ]];then ## 如果未在ACE环境中
|
||||
# 定义按顺序尝试的ACE环境(命令:推荐安装包)
|
||||
declare -a ace_commands_order=(
|
||||
"bookworm-run:amber-ce-bookworm"
|
||||
"trixie-run:amber-ce-trixie"
|
||||
"deepin23-run:amber-ce-deepin23"
|
||||
)
|
||||
for ace_entry in "${ace_commands_order[@]}"; 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,142 +1,132 @@
|
||||
#!/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环境配置 =====
|
||||
declare -a ace_commands_order=(
|
||||
"bookworm-run:amber-ce-bookworm"
|
||||
"trixie-run:amber-ce-trixie"
|
||||
"deepin23-run:amber-ce-deepin23"
|
||||
)
|
||||
|
||||
# ===== 日志和函数 =====
|
||||
[ -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
|
||||
package_name=$1
|
||||
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"
|
||||
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"
|
||||
desktop_file_path="$path"
|
||||
return 0
|
||||
}
|
||||
done < <(find /opt/apps/$package_name -path '*/entries/applications/*.desktop' 2>/dev/null)
|
||||
return 1
|
||||
}
|
||||
|
||||
function launch_app(){
|
||||
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 [ -z "$1" ]; then
|
||||
log.error "请传入文件路径作为参数"
|
||||
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
|
||||
log.info "Launching: $exec_command"
|
||||
# 图形环境启动优化
|
||||
if [ -n "$DISPLAY" ]; then
|
||||
nohup env DISPLAY=$DISPLAY XAUTHORITY=${XAUTHORITY:-~/.Xauthority} ${SHELL:-bash} -c "$exec_command" >/dev/null 2>&1 &
|
||||
else
|
||||
nohup ${SHELL:-bash} -c "$exec_command" >/dev/null 2>&1 &
|
||||
fi
|
||||
}
|
||||
|
||||
# ===== ACE环境执行器 =====
|
||||
function ace_runner() {
|
||||
local command_type=$1 package_name=$2
|
||||
for ace_entry in "${ace_commands_order[@]}"; do
|
||||
local ace_cmd=${ace_entry%%:*}
|
||||
command -v "$ace_cmd" >/dev/null || continue
|
||||
|
||||
log.info "Checking in $ace_cmd environment..."
|
||||
if output=$($ace_cmd "$0" "$command_type" "$package_name" 2>/dev/null); then
|
||||
[ "$command_type" = "list" ] && echo "$output"
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
# ===== 主逻辑 =====
|
||||
[ $# -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 1
|
||||
fi
|
||||
;;
|
||||
|
||||
DESKTOP_FILE_PATH=$1
|
||||
|
||||
if [[ $DESKTOP_FILE_PATH == file://* ]]; then
|
||||
# 如果是,移除 'file://' 部分并输出结果
|
||||
DESKTOP_FILE_PATH="${DESKTOP_FILE_PATH#file://}"
|
||||
list)
|
||||
# 当前环境列表
|
||||
if result=$(scan_desktop_file "$2"); then
|
||||
echo "$result"
|
||||
exit 0
|
||||
else
|
||||
# 非ACE环境下执行ACE环境扫描
|
||||
[ -z "$IS_ACE_ENV" ] && ace_runner list "$2"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
# 获取文件内容中第一个 Exec= 后的命令
|
||||
exec_command=$(grep -m 1 -oP "(?<=Exec=).*" "$DESKTOP_FILE_PATH")
|
||||
|
||||
# 删除 exec_command 中最后的 % 及其后面的内容
|
||||
exec_command="${exec_command%\%*}"
|
||||
|
||||
# 打印提取的命令
|
||||
log.info "Command is $exec_command"
|
||||
|
||||
# 在默认终端执行命令
|
||||
bash -c $exec_command
|
||||
}
|
||||
|
||||
if [ "$#" -lt 2 ];then
|
||||
log.info "Usage: $0 check/launch/list/start packagename/desktop-file"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
|
||||
if [ "$1" = "check" ];then
|
||||
|
||||
scan_desktop_file_log "$2"
|
||||
if [ "$desktop_file_path" = "" ];then
|
||||
log.error "No desktop file found. exit -1"
|
||||
exit -1
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
|
||||
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
|
||||
|
||||
|
||||
launch_app "${desktop_file_path}"
|
||||
|
||||
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 1
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
log.error "Invalid command: $1"
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
|
54
tool/store-helper/uninstaller
Executable file
54
tool/store-helper/uninstaller
Executable file
@ -0,0 +1,54 @@
|
||||
#!/bin/bash
|
||||
# ===== ACE环境配置 =====
|
||||
declare -a ace_commands_order=(
|
||||
"bookworm-run:amber-ce-bookworm"
|
||||
"trixie-run:amber-ce-trixie"
|
||||
"deepin23-run:amber-ce-deepin23"
|
||||
)
|
||||
|
||||
# ===== 日志和函数 =====
|
||||
[ -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: $*"; }
|
||||
}
|
||||
|
||||
dpkg -s "$1" > /dev/null
|
||||
RET="$?"
|
||||
if [[ "$RET" == "0" ]] ;then
|
||||
apt autopurge $1 -y
|
||||
else
|
||||
|
||||
for ace_entry in "${ace_commands_order[@]}"; 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 "----------------------------------------"
|
||||
$ace_cmd apt autopurge $1 -y
|
||||
else
|
||||
echo "----------------------------------------"
|
||||
echo "在 $ace_cmd 环境中未能找到安装,继续查找"
|
||||
echo "----------------------------------------"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
echo "----------------------------------------"
|
||||
echo "所有已安装的 ACE 环境中未能找到安装,退出"
|
||||
echo "----------------------------------------"
|
||||
exit "$RET"
|
||||
fi
|
||||
exit "$RET"
|
@ -146,7 +146,7 @@ for PKG_UPGRADE in $PKG_UPGRADE_LIST; do
|
||||
update_transhell
|
||||
|
||||
# 启动升级任务
|
||||
(yes | pkexec ${HERE}/ss-do-upgrade-worker.sh upgrade-app $PKG_UPGRADE -y 2>&1 > /dev/null ) &
|
||||
(yes n | pkexec ${HERE}/ss-do-upgrade-worker.sh upgrade-app $PKG_UPGRADE -yfq 2>&1 > /dev/null ) &
|
||||
|
||||
# 计算进度百分比
|
||||
progress=$(( count * 100 / total - 1))
|
||||
|
Loading…
x
Reference in New Issue
Block a user