mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-15 21:32:05 +08:00
Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6426a3c12a | |||
| 42fa1b5340 | |||
| 10320e99eb | |||
| b2120411e5 | |||
| 9c219e5e89 | |||
| 021283e240 | |||
| 74513723e9 | |||
| 3664a80c55 | |||
| 0bd8bab7eb | |||
| 4c565cda6c | |||
| 7484ee8438 | |||
| c22f13a271 | |||
| e0a62a88d9 | |||
| 804db2e623 | |||
|
|
89f7696704 | ||
|
|
18e13e4525 | ||
| 230b208fcb | |||
| c9354e6d27 | |||
| bad522e40a | |||
| ffac75eab7 | |||
| e2497116bf | |||
| 99fae1bb3f | |||
| 59e4da7b40 |
12
debian/changelog
vendored
12
debian/changelog
vendored
@@ -1,6 +1,16 @@
|
||||
spark-store (4.2.11~local) stable; urgency=medium
|
||||
spark-store (4.2.12) stable; urgency=medium
|
||||
|
||||
* 修复:飞腾部分设备上白屏的问题
|
||||
* 修复:下载开始时长时等待(降低链接超时时长)
|
||||
|
||||
-- shenmo <shenmo@spark-app.store> Sun, 5 Mar 2022 11:45:14 +0800
|
||||
|
||||
spark-store (4.2.11) stable; urgency=medium
|
||||
|
||||
* 修复:判断是否安装状态错误
|
||||
* 修改:部分组件重构提升清晰度
|
||||
* 修复:v23下部分应用图标失效
|
||||
|
||||
|
||||
-- shenmo <shenmo@spark-app.store> Sun, 5 Mar 2022 11:45:14 +0800
|
||||
|
||||
|
||||
19
debian/rules
vendored
19
debian/rules
vendored
@@ -3,10 +3,13 @@
|
||||
export QT_SELECT = qt5
|
||||
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
|
||||
include /usr/share/dpkg/default.mk
|
||||
export DEB_VERSION = $(shell dpkg-parsechangelog -S Version)
|
||||
|
||||
DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
|
||||
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
|
||||
|
||||
# Use realtime timestamp instead of the latest entry in debian/changelog
|
||||
SOURCE_DATE_EPOCH := $(shell date +%s)
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE = 1
|
||||
|
||||
@@ -14,25 +17,23 @@ DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
|
||||
dh $@ --parallel
|
||||
|
||||
override_dh_auto_clean:
|
||||
rm -rf $(CURDIR)/build
|
||||
rm -rf $(CURDIR)/build-$(DEB_HOST_MULTIARCH)
|
||||
|
||||
override_dh_auto_configure:
|
||||
mkdir -p $(CURDIR)/build
|
||||
mkdir -p $(CURDIR)/build-$(DEB_HOST_MULTIARCH)
|
||||
|
||||
qmake BUILD_VERSION=$(DEB_VERSION_UPSTREAM) spark-store-project.pro \
|
||||
-spec linux-g++ CONFIG+=qtquickcompiler \
|
||||
-o $(CURDIR)/build/
|
||||
-spec linux-g++ CONFIG+=force_debug_info \
|
||||
-o $(CURDIR)/build-$(DEB_HOST_MULTIARCH)/
|
||||
|
||||
override_dh_auto_build:
|
||||
make MAKEFLAGS="$(MAKEFLAGS)" -C $(CURDIR)/build
|
||||
make -C $(CURDIR)/build-$(DEB_HOST_MULTIARCH) -j$(JOBS)
|
||||
|
||||
override_dh_auto_install:
|
||||
make -C $(CURDIR)/build install \
|
||||
make -C $(CURDIR)/build-$(DEB_HOST_MULTIARCH) install \
|
||||
INSTALL_ROOT=$(CURDIR)/debian/spark-store
|
||||
|
||||
|
||||
# Ignore the dpkg-shlibdeps: warning (it uses none of the library's symbols)
|
||||
# Qt Mutidedia lib will ref to network libraray.
|
||||
override_dh_shlibdeps:
|
||||
dh_shlibdeps --dpkg-shlibdeps-params=--warnings=0
|
||||
|
||||
|
||||
20
debian/spark-store.postinst
vendored
20
debian/spark-store.postinst
vendored
@@ -13,8 +13,8 @@ case "$1" in
|
||||
echo "Will not enable armhf since 4271"
|
||||
;;
|
||||
loongarch64)
|
||||
echo "Enabling ABI1(OldWorld) arch..."
|
||||
dpkg --add-architecture loongarch64
|
||||
echo "Nope we DO NOT WANT ABI1 now"
|
||||
dpkg --remove-architecture loongarch64
|
||||
;;
|
||||
|
||||
*)
|
||||
@@ -29,7 +29,7 @@ case "$1" in
|
||||
|
||||
# Check if /usr/local/bin existed
|
||||
mkdir -p /usr/local/bin
|
||||
|
||||
## I hate /usr/local/bin. We will abandon them later
|
||||
# Create symbol links for binary files
|
||||
ln -s -f /opt/durapps/spark-store/bin/spark-store /usr/local/bin/spark-store
|
||||
ln -s -f /opt/durapps/spark-store/bin/ssinstall /usr/local/bin/ssinstall
|
||||
@@ -37,6 +37,7 @@ case "$1" in
|
||||
ln -s -f /opt/durapps/spark-store/bin/ssinstall /usr/bin/ssinstall
|
||||
ln -s -f /opt/durapps/spark-store/bin/ssaudit /usr/bin/ssaudit
|
||||
ln -s -f /opt/durapps/spark-store/bin/spark-dstore-patch /usr/local/bin/spark-dstore-patch
|
||||
ln -s -f /opt/durapps/spark-store/bin/spark-dstore-patch /usr/bin/spark-dstore-patch
|
||||
ln -s -f /opt/durapps/spark-store/bin/aptss /usr/local/bin/ss-apt-fast
|
||||
|
||||
ln -s -f /opt/durapps/spark-store/bin/aptss /usr/bin/aptss
|
||||
@@ -72,18 +73,7 @@ case "$1" in
|
||||
;;
|
||||
|
||||
triggered)
|
||||
# Quit if deepin-app-store-tool existed
|
||||
if [ -x "/usr/bin/deepin-app-store-tool" ] ; then
|
||||
exit 0
|
||||
fi
|
||||
spark-dstore-patch
|
||||
|
||||
# Trigger for UOS debs installation
|
||||
echo '--------检测到Uniontech标准软件包,运行补丁以修正安装--------'
|
||||
if [ -x "/usr/local/bin/spark-dstore-patch" ] ; then
|
||||
/usr/local/bin/spark-dstore-patch
|
||||
echo '-----------spark-dstore-patch补丁工具已运行完毕-----------'
|
||||
else
|
||||
echo '------------spark-dstore-patch补丁工具运行失败------------'
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
0
debian/spark-store.postrm
vendored
Normal file → Executable file
0
debian/spark-store.postrm
vendored
Normal file → Executable file
1
debian/spark-store.prerm
vendored
1
debian/spark-store.prerm
vendored
@@ -22,6 +22,7 @@ if [ "$1" = "remove" -o "$1" = "purge" ] ; then
|
||||
unlink /usr/bin/ssinstall
|
||||
unlink /usr/bin/ssaudit
|
||||
unlink /usr/local/bin/spark-dstore-patch
|
||||
unlink /usr/bin/spark-dstore-patch
|
||||
unlink /usr/local/bin/ss-apt-fast
|
||||
unlink /usr/bin/aptss
|
||||
|
||||
|
||||
1
debian/spark-store.triggers
vendored
1
debian/spark-store.triggers
vendored
@@ -1 +1,2 @@
|
||||
interest-noawait /opt/apps
|
||||
interest-noawait /usr/share/icons
|
||||
|
||||
@@ -120,6 +120,7 @@ void DownloadController::startDownload(const QString &url)
|
||||
QString downloadDir = "/tmp/spark-store/"; //下载目录
|
||||
QString aria2ConnectionPerServer = "--max-connection-per-server=1"; //每个服务器最大连接数
|
||||
QString aria2ConnectionMax = "--max-concurrent-downloads=16"; //最大同时下载数
|
||||
QString aria2ConnectionTimeout = "--connect-timeout=5"; // 1 秒服务器连接超时(像 spark1.uniartisan.com、cdn.dl.uniartisan.com、momen.d.store.deepinos.org.cn 等服务器失效时不影响即时下载)
|
||||
|
||||
|
||||
if (useMetalink) //如果是metalink
|
||||
@@ -147,6 +148,7 @@ void DownloadController::startDownload(const QString &url)
|
||||
command.append(aria2SizePerThreads.toUtf8());
|
||||
command.append(aria2ConnectionPerServer.toUtf8());
|
||||
command.append(aria2ConnectionMax.toUtf8());
|
||||
command.append(aria2ConnectionTimeout.toUtf8());
|
||||
|
||||
if (useMetalink)
|
||||
{
|
||||
|
||||
42
src/main.cpp
42
src/main.cpp
@@ -148,49 +148,9 @@ int main(int argc, char *argv[])
|
||||
// qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--disable-web-security");
|
||||
#ifdef __sw_64__
|
||||
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--no-sandbox");
|
||||
#elif __aarch64__
|
||||
QString env = QString::fromUtf8(qgetenv("QTWEBENGINE_CHROMIUM_FLAGS"));
|
||||
env = env.trimmed();
|
||||
/**
|
||||
* NOTE: 参考帮助手册代码,对于部分 ARM CPU 设备,
|
||||
* --disable-gpu 保证网页正常显示
|
||||
* --single-process 避免 QtWebEngine 崩溃(可选)
|
||||
*/
|
||||
env += " --disable-gpu";
|
||||
if (Utils::isPhytium()) {
|
||||
env += " --single-process";
|
||||
}
|
||||
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", env.trimmed().toUtf8());
|
||||
|
||||
if (Utils::isWayland()) {
|
||||
/**
|
||||
* WARNING: DDM TreeLand 混合器下,设置
|
||||
* QT_WAYLAND_SHELL_INTEGRATION 环境变量
|
||||
* 会导致崩溃 By justforlxz
|
||||
*/
|
||||
if (!Utils::isTreeLand()) {
|
||||
/**
|
||||
* NOTE: 参考帮助手册代码,对于麒麟 CPU 设备,
|
||||
* 避免 wayland 环境下 QtWebEngine 崩溃
|
||||
*/
|
||||
qputenv("QT_WAYLAND_SHELL_INTEGRATION", "kwayland-shell");
|
||||
}
|
||||
|
||||
}
|
||||
QSurfaceFormat format;
|
||||
format.setRenderableType(QSurfaceFormat::OpenGLES);
|
||||
QSurfaceFormat::setDefaultFormat(format);
|
||||
|
||||
/**
|
||||
* NOTE: https://zhuanlan.zhihu.com/p/550285855
|
||||
* 避免 X11 环境下从 QtWebEngine 后退回到 QWidget 时黑屏闪烁
|
||||
*/
|
||||
if (!Utils::isWayland()) {
|
||||
qputenv("QMLSCENE_DEVICE", "softwarecontext");
|
||||
DApplication::setAttribute(Qt::AA_UseSoftwareOpenGL);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* NOTE: https://zhuanlan.zhihu.com/p/550285855
|
||||
* 避免 wayland 环境下从 QtWebEngine 后退回到 QWidget 时黑屏闪烁
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#define WaylandSearchCenter 1
|
||||
#define OtherSearchCenter 2
|
||||
#define RightSearchSpace 1
|
||||
#define UploadServerUrl "https://upload.deepinos.org/"
|
||||
#define UploadServerUrl "https://upload.deepinos.org.cn/"
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent)
|
||||
: BaseWidgetOpacity(parent)
|
||||
|
||||
@@ -55,7 +55,7 @@ void AppIntoPage::openUrl(const QUrl &url)
|
||||
ui->label_2->setText(info["More"].toString());
|
||||
|
||||
// 显示 tags
|
||||
#if (DTK_VERSION >= DTK_VERSION_CHECK(5, 15, 0, 0))
|
||||
#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);
|
||||
@@ -154,7 +154,7 @@ void AppIntoPage::openUrl(const QUrl &url)
|
||||
|
||||
isUpdate.start("dpkg", QStringList() << "--compare-versions" << localVersion << "ge" << info["Version"].toString());
|
||||
isUpdate.waitForFinished(180 * 1000); // 默认超时 3 分钟
|
||||
if (!isUpdate.exitCode())
|
||||
if (isUpdate.exitCode() == 0 && isUpdate.exitStatus() == QProcess::NormalExit)
|
||||
{
|
||||
isUpdated = true;
|
||||
}
|
||||
@@ -342,10 +342,27 @@ void AppIntoPage::isDownloading(const QUrl &url)
|
||||
}
|
||||
if (item->download == 3)
|
||||
{
|
||||
ui->downloadButton->setEnabled(true);
|
||||
ui->downloadButton->setText(tr("Reinstall"));
|
||||
ui->downloadButton->show();
|
||||
ui->pushButton_3->show();
|
||||
QString packageName = info["Pkgname"].toString();
|
||||
QProcess process;
|
||||
process.start("/opt/durapps/spark-store/bin/store-helper/check-is-installed", {packageName});
|
||||
process.waitForFinished(-1);
|
||||
|
||||
int exitCode = process.exitCode();
|
||||
QProcess::ExitStatus exitStatus = process.exitStatus();
|
||||
process.close();
|
||||
|
||||
if (exitCode == 0 && exitStatus == QProcess::NormalExit)
|
||||
{
|
||||
ui->downloadButton->setEnabled(true);
|
||||
ui->downloadButton->setText(tr("Reinstall"));
|
||||
ui->downloadButton->show();
|
||||
ui->pushButton_3->show();
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->downloadButton->setEnabled(true);
|
||||
ui->downloadButton->setText(tr("Download and Install"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -490,22 +507,24 @@ void AppIntoPage::on_pushButton_3_clicked()
|
||||
QProcess uninstall;
|
||||
uninstall.start("pkexec", QStringList() << "apt" << "autopurge" << "-y" << info["Pkgname"].toString().toLower());
|
||||
uninstall.waitForFinished(-1);
|
||||
uninstall.close();
|
||||
|
||||
QProcess check;
|
||||
check.start("dpkg", QStringList() << "-s" << info["Pkgname"].toString().toLower());
|
||||
check.waitForFinished(10*1000);
|
||||
check.waitForFinished(-1);
|
||||
|
||||
if (check.readAllStandardOutput().isEmpty())
|
||||
if (check.exitCode() != 0 || check.exitStatus() != QProcess::NormalExit)
|
||||
{
|
||||
ui->downloadButton->setText(tr("Download and Install"));
|
||||
ui->pushButton_3->hide();
|
||||
|
||||
updatesEnabled();
|
||||
Utils::sendNotification("spark-store",tr("Spark Store"),tr("Uninstall succeeded"));
|
||||
}
|
||||
|
||||
ui->downloadButton->setEnabled(true);
|
||||
ui->pushButton_3->setEnabled(true);
|
||||
|
||||
check.close();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#define TMP_PATH "/tmp/spark-store"
|
||||
#define DEFAULT_SERVER_URL "https://cdn.d.store.deepinos.org.cn/"
|
||||
#define DEFAULT_CHECK_DOMAIN "deepinos"
|
||||
|
||||
|
||||
bool SettingsPage::needUncompatibleNotification = true;
|
||||
bool SettingsPage::isdownload = false;
|
||||
@@ -57,10 +57,7 @@ void SettingsPage::readServerList()
|
||||
|
||||
// 创建 QTextStream 对象
|
||||
QTextStream textStream(&file);
|
||||
if (!textStream.readAll().contains(DEFAULT_CHECK_DOMAIN)) // 校验配置文件有效性
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
textStream.seek(0); // 回到开头
|
||||
QString lineData = textStream.readLine(); // 读取文件的第一行
|
||||
ui->comboBox_server->addItem(lineData);
|
||||
|
||||
19
tool/aptss
19
tool/aptss
@@ -1,5 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
SPARK_DOWNLOAD_SERVER_URL="https://d.store.deepinos.org.cn/"
|
||||
SPARK_DOWNLOAD_SERVER_URL_NO_PROTOCOL="d.store.deepinos.org.cn"
|
||||
source /opt/durapps/spark-store/bin/bashimport/transhell.amber
|
||||
load_transhell
|
||||
|
||||
@@ -44,21 +46,21 @@ if [ ! -e "/tmp/aptss-conf/apt-fast.conf" ];then
|
||||
mkdir -p /tmp/aptss-conf/
|
||||
echo -e "\e[1;32m${TRANSHELL_CONTENT_GETTING_SERVER_CONFIG_AND_MIRROR_LIST}\e[0m"
|
||||
echo
|
||||
curl --progress-bar -o /tmp/aptss-conf/apt-fast.conf "https://d.store.deepinos.org.cn/apt-fast.conf"
|
||||
curl --progress-bar -o /tmp/aptss-conf/apt-fast.conf "${SPARK_DOWNLOAD_SERVER_URL}/apt-fast.conf"
|
||||
chmod -R 755 /tmp/aptss-conf
|
||||
|
||||
fi
|
||||
|
||||
|
||||
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-repository_${STORE_URL}_Packages" ];then
|
||||
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-repository_${STORE_URL}_Packages" ];then
|
||||
|
||||
mkdir -p /tmp/aptss-conf/
|
||||
echo -e "\e[1;32m${TRANSHELL_CONTENT_GETTING_SERVER_CONFIG_AND_MIRROR_LIST}\e[0m"
|
||||
echo
|
||||
curl --silent -o /tmp/aptss-conf/apt-fast.conf "https://d.store.deepinos.org.cn/apt-fast.conf"
|
||||
curl --silent -o /tmp/aptss-conf/apt-fast.conf "${SPARK_DOWNLOAD_SERVER_URL}/apt-fast.conf"
|
||||
chmod -R 755 /tmp/aptss-conf
|
||||
|
||||
curl --silent -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "https://d.store.deepinos.org.cn/sparkstore${STORE_LIST_URL}.list"
|
||||
curl --silent -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "${SPARK_DOWNLOAD_SERVER_URL}/sparkstore${STORE_LIST_URL}.list"
|
||||
/usr/bin/apt update -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf
|
||||
|
||||
#只更新星火源
|
||||
@@ -103,10 +105,10 @@ elif [ "$1" = "ssupdate" ];then
|
||||
mkdir -p /tmp/aptss-conf/
|
||||
echo -e "\e[1;32m${TRANSHELL_CONTENT_GETTING_SERVER_CONFIG_AND_MIRROR_LIST}\e[0m"
|
||||
echo
|
||||
curl --silent -o /tmp/aptss-conf/apt-fast.conf "https://d.store.deepinos.org.cn/apt-fast.conf"
|
||||
curl --silent -o /tmp/aptss-conf/apt-fast.conf "${SPARK_DOWNLOAD_SERVER_URL}/apt-fast.conf"
|
||||
chmod -R 755 /tmp/aptss-conf
|
||||
|
||||
curl --silent -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "https://d.store.deepinos.org.cn/sparkstore${STORE_LIST_URL}.list"
|
||||
curl --silent -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "${SPARK_DOWNLOAD_SERVER_URL}/sparkstore${STORE_LIST_URL}.list"
|
||||
|
||||
|
||||
/usr/bin/apt update -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" -o Dir::Etc::sourcelist="/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list"
|
||||
@@ -116,9 +118,9 @@ curl --silent -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/spar
|
||||
elif [ "$1" = "update" ];then
|
||||
echo -e "\e[1;32m${TRANSHELL_CONTENT_GETTING_SERVER_CONFIG_AND_MIRROR_LIST}\e[0m"
|
||||
echo
|
||||
curl --progress-bar -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "https://d.store.deepinos.org.cn/sparkstore${STORE_LIST_URL}.list"
|
||||
curl --progress-bar -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "${SPARK_DOWNLOAD_SERVER_URL}/sparkstore${STORE_LIST_URL}.list"
|
||||
mkdir -p /tmp/aptss-conf/
|
||||
curl --progress-bar -o /tmp/aptss-conf/apt-fast.conf "https://d.store.deepinos.org.cn/apt-fast.conf"
|
||||
curl --progress-bar -o /tmp/aptss-conf/apt-fast.conf "${SPARK_DOWNLOAD_SERVER_URL}/apt-fast.conf"
|
||||
chmod -R 755 /tmp/aptss-conf
|
||||
### 额外一份拿来给aptss自动补全用
|
||||
/usr/bin/apt "$@" -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf
|
||||
@@ -127,4 +129,3 @@ else
|
||||
/usr/bin/apt "$@" -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf
|
||||
fi
|
||||
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "----------------Running Spark DStore Patch----------------"
|
||||
|
||||
|
||||
|
||||
|
||||
enumAppInfoList() {
|
||||
appInfoList=()
|
||||
apps="/opt/apps"
|
||||
list=$(ls $apps)
|
||||
list=$(ls $apps 2>/dev/null)
|
||||
for appID in $list; do
|
||||
appInfoList+=("$appID")
|
||||
done
|
||||
@@ -26,15 +26,13 @@ linkDir() {
|
||||
targetDir=$(dirname "$target")
|
||||
find "$source" -type f | while read sourceFile; do
|
||||
targetFile="$targetDir/${sourceFile#$sourceDir/}"
|
||||
if [ -L "$targetFile" ] && [ "$(readlink "$targetFile")" = "$sourceFile" ]; then
|
||||
continue
|
||||
else
|
||||
rm -f "$targetFile"
|
||||
fi
|
||||
|
||||
|
||||
ensureTargetDir "$targetFile"
|
||||
sourceFile=$(realpath --relative-to="$(dirname $targetFile)" "$sourceFile" )
|
||||
ln -s "$sourceFile" "$targetFile"
|
||||
if [ ! -e ${targetFile} ];then
|
||||
ln -sv "$sourceFile" "$targetFile"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
@@ -65,61 +63,66 @@ linkApp() {
|
||||
done
|
||||
}
|
||||
|
||||
function exec_uos_package_link(){
|
||||
|
||||
# execute linkApp function for each app and print output
|
||||
for app in $(enumAppInfoList); do
|
||||
linkApp "$app" &
|
||||
|
||||
if [ "$1" = "--debug" ]; then
|
||||
echo "Linking for $app"
|
||||
fi
|
||||
# remove broken links in /usr/share
|
||||
done
|
||||
wait
|
||||
}
|
||||
|
||||
if [ "$1" = "--debug" ]; then
|
||||
echo "Cleaning links and updating databases and caches..."
|
||||
function exec_v23_icon_link(){
|
||||
# Fix v23 broken icon
|
||||
if [ ! -d "/usr/share/icons/hicolor/scalable/apps" ];then
|
||||
mkdir -p /usr/share/icons/hicolor/scalable/apps
|
||||
fi
|
||||
|
||||
for icon_root_icon_path in $(ls /usr/share/icons/*.png /usr/share/icons/*.svg 2>/dev/null)
|
||||
do
|
||||
target_icon_path=/usr/share/icons/hicolor/scalable/apps/$(basename ${icon_root_icon_path})
|
||||
if [ ! -e ${target_icon_path} ];then
|
||||
ln -sv $(realpath --relative-to=/usr/share/icons/hicolor/scalable/apps ${icon_root_icon_path}) /usr/share/icons/hicolor/scalable/apps
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
if [ "$1" = "--debug" ]; then
|
||||
find /usr/share/applications -xtype l -delete &
|
||||
find /usr/share/icons -xtype l -delete &
|
||||
find /usr/share/mime/packages -xtype l -delete &
|
||||
find /usr/share/glib-2.0 -xtype l -delete &
|
||||
find /usr/share/dbus-1/services -xtype l -delete &
|
||||
find /usr/share/fcitx -xtype l -delete &
|
||||
find /usr/share/help -xtype l -delete &
|
||||
find /usr/share/locale -xtype l -delete &
|
||||
find /usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/fcitx -xtype l -delete &
|
||||
find /usr/lib/mozilla/plugins -xtype l -delete &
|
||||
find /usr/share/polkit-1/actions -xtype l -delete &
|
||||
find /usr/share/fonts -xtype l -delete &
|
||||
find /etc/fonts/conf.d -xtype l -delete &
|
||||
update-icon-caches /usr/share/icons/* &
|
||||
update-desktop-database -q &
|
||||
update-mime-database -V /usr/share/mime &
|
||||
glib-compile-schemas /usr/share/glib-2.0/schemas/ &
|
||||
wait
|
||||
else
|
||||
find /usr/share/applications -xtype l -delete > /dev/null 2>&1 &
|
||||
find /usr/share/icons -xtype l -delete > /dev/null 2>&1 &
|
||||
find /usr/share/mime/packages -xtype l -delete > /dev/null 2>&1 &
|
||||
find /usr/share/glib-2.0 -xtype l -delete > /dev/null 2>&1 &
|
||||
find /usr/share/dbus-1/services -xtype l -delete > /dev/null 2>&1 &
|
||||
find /usr/share/fcitx -xtype l -delete > /dev/null 2>&1 &
|
||||
find /usr/share/help -xtype l -delete > /dev/null 2>&1 &
|
||||
find /usr/share/locale -xtype l -delete > /dev/null 2>&1 &
|
||||
find /usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/fcitx -xtype l -delete > /dev/null 2>&1 &
|
||||
find /usr/lib/mozilla/plugins -xtype l -delete > /dev/null 2>&1 &
|
||||
find /usr/share/polkit-1/actions -xtype l -delete > /dev/null 2>&1 &
|
||||
find /usr/share/fonts -xtype l -delete > /dev/null 2>&1 &
|
||||
find /etc/fonts/conf.d -xtype l -delete > /dev/null 2>&1 &
|
||||
function exec_link_clean(){
|
||||
# remove broken links in /usr/share
|
||||
|
||||
find /usr/share/applications -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
|
||||
find /usr/share/icons -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
|
||||
find /usr/share/mime/packages -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
|
||||
find /usr/share/glib-2.0 -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
|
||||
find /usr/share/dbus-1/services -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
|
||||
find /usr/share/fcitx -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
|
||||
find /usr/share/help -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
|
||||
find /usr/share/locale -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
|
||||
find /usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/fcitx -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
|
||||
find /usr/lib/mozilla/plugins -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
|
||||
find /usr/share/polkit-1/actions -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
|
||||
find /usr/share/fonts -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
|
||||
find /etc/fonts/conf.d -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink {} \; 2>/dev/null &
|
||||
|
||||
|
||||
}
|
||||
function exec_uos_package_update(){
|
||||
update-icon-caches /usr/share/icons/* > /dev/null 2>&1 &
|
||||
update-desktop-database -q > /dev/null 2>&1 &
|
||||
update-mime-database -V /usr/share/mime > /dev/null 2>&1 &
|
||||
glib-compile-schemas /usr/share/glib-2.0/schemas/ > /dev/null 2>&1 &
|
||||
|
||||
}
|
||||
|
||||
#########################################################################################
|
||||
echo "----------------Running Spark DStore Patch----------------"
|
||||
if [ ! -e /usr/bin/deepin-app-store-tool ];then
|
||||
# execute linkApp function for each app and print output
|
||||
exec_uos_package_link
|
||||
|
||||
fi
|
||||
|
||||
|
||||
echo "----------------Finished----------------"
|
||||
exec_v23_icon_link
|
||||
exec_link_clean
|
||||
wait
|
||||
exec_uos_package_update
|
||||
echo "----------------Finished----------------"
|
||||
|
||||
@@ -79,6 +79,7 @@ function hash_check() {
|
||||
echo "Running Spark Package Verify..."
|
||||
|
||||
DEB_SHA512SUM=$(sha512sum "$1" | cut -d ' ' -f 1)
|
||||
unset IS_SHA512SUM_CHECKED
|
||||
IS_SHA512SUM_CHECKED=$(cat "$PACKAGES_DATA_PATH" | grep "$DEB_SHA512SUM")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user