mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-15 21:32:05 +08:00
Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fd4b52e384 | |||
| c65eea12a6 | |||
| d6e01a5803 | |||
| 04aeac62f8 | |||
| db79a59fb6 | |||
| 9b1b432e7c | |||
| cfafc04628 | |||
| 8450e6afa6 | |||
| 2a4d33e73f | |||
| 8c2a10ebbc | |||
| 2bec2de456 | |||
| 90dea4ed2e | |||
| 06ca1b7a97 | |||
| f9e2cea98e | |||
| 1bbf7027d3 | |||
| 6891fc5b87 | |||
| 90ec030f8b | |||
| 347c8ed093 | |||
| d987c840c7 | |||
| 88a28c5658 | |||
| 484a82b00b | |||
| 1506b74b01 | |||
| 09b880fff8 | |||
| c6d3742daa | |||
| 917527cbe6 | |||
| faad17470a |
@@ -34,7 +34,7 @@ If you want to submit an APP to share with others,Please [Click here](https://
|
|||||||
|
|
||||||
If you simply want to install the Spark Store,just enter the [Release] page, find the version you want and install.
|
If you simply want to install the Spark Store,just enter the [Release] page, find the version you want and install.
|
||||||
|
|
||||||
If you are using Debian11/Ubuntu 20.04, you will need extra dependency package. Available [here](https://code.gitlink.org.cn/shenmo7192/spark-store-dependencies/raw/branch/master/spark-store-dependencies-kylin.zip)
|
If you are using Debian11/Ubuntu 20.04, you will need extra dependency package. Available [here](https://zunyun01.store.deepinos.org.cn/spark-store-dependencies-kylin.zip)
|
||||||
|
|
||||||
---
|
---
|
||||||
#### Compile and developement
|
#### Compile and developement
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
如果想安装 `星火应用商店` ,请打开右侧的 [Release] 页面,找到最新版本,并选择适用于当前系统的安装包下载。
|
如果想安装 `星火应用商店` ,请打开右侧的 [Release] 页面,找到最新版本,并选择适用于当前系统的安装包下载。
|
||||||
|
|
||||||
如果你在使用 `Debian 11/Ubuntu 20.04`,你需要额外下载[依赖补充包](https://code.gitlink.org.cn/shenmo7192/spark-store-dependencies/raw/branch/master/spark-store-dependencies-kylin.zip)
|
如果你在使用 `Debian 11/Ubuntu 20.04`,你需要额外下载[依赖补充包](https://zunyun01.store.deepinos.org.cn/spark-store-dependencies-kylin.zip)
|
||||||
|
|
||||||
---
|
---
|
||||||
#### 编译安装
|
#### 编译安装
|
||||||
|
|||||||
20
debian/changelog
vendored
20
debian/changelog
vendored
@@ -1,3 +1,23 @@
|
|||||||
|
spark-store (4.2.6) stable; urgency=medium
|
||||||
|
* 修复:截图加载失败时点击闪退
|
||||||
|
|
||||||
|
-- shenmo <shenmo@spark-app.store>
|
||||||
|
|
||||||
|
|
||||||
|
spark-store (4.2.5.1) stable; urgency=medium
|
||||||
|
* 调整:重写了spark-dstore-patch,速度提升,尤其对机械硬盘下
|
||||||
|
* 调整:优化了aptss源文件同步策略
|
||||||
|
|
||||||
|
-- shenmo <shenmo@spark-app.store>
|
||||||
|
|
||||||
|
|
||||||
|
spark-store (4.2.5) stable; urgency=medium
|
||||||
|
* 修复:ssinstall在文件不存在时仍然报安装成功
|
||||||
|
* 修复:删除不再需要的依赖:libc6-dev
|
||||||
|
* 在aarch64架构安装时也启用32位支持
|
||||||
|
|
||||||
|
-- shenmo <shenmo@spark-app.store>
|
||||||
|
|
||||||
spark-store (4.2.4) stable; urgency=medium
|
spark-store (4.2.4) stable; urgency=medium
|
||||||
* 修复:ssinstall校验失败的时候仍然提示安装成功
|
* 修复:ssinstall校验失败的时候仍然提示安装成功
|
||||||
* 新增:ssinstall可以自动刷新ssupdate以防止仓库更新中导致的安装校验失败
|
* 新增:ssinstall可以自动刷新ssupdate以防止仓库更新中导致的安装校验失败
|
||||||
|
|||||||
3
debian/control
vendored
3
debian/control
vendored
@@ -40,9 +40,8 @@ Depends:${shlibs:Depends}, ${misc:Depends},
|
|||||||
openssl,
|
openssl,
|
||||||
dde-qt5integration,
|
dde-qt5integration,
|
||||||
aria2,
|
aria2,
|
||||||
gcc,
|
gnupg,
|
||||||
zenity,
|
zenity,
|
||||||
libc6-dev,
|
|
||||||
policykit-1,
|
policykit-1,
|
||||||
libnotify-bin
|
libnotify-bin
|
||||||
Description: Spark Store
|
Description: Spark Store
|
||||||
|
|||||||
6
debian/spark-store.postinst
vendored
6
debian/spark-store.postinst
vendored
@@ -8,8 +8,12 @@ case "$1" in
|
|||||||
echo "Enabling i386 arch..."
|
echo "Enabling i386 arch..."
|
||||||
dpkg --add-architecture i386
|
dpkg --add-architecture i386
|
||||||
;;
|
;;
|
||||||
|
aarch64)
|
||||||
|
echo "Enabling armhf arch..."
|
||||||
|
dpkg --add-architecture armhf
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Not amd64, skip enable i386 arch"
|
echo "Unknown architecture, skip enable 32-bit arch"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ TEMPLATE = subdirs
|
|||||||
CONFIG += wayland-compositor
|
CONFIG += wayland-compositor
|
||||||
|
|
||||||
SUBDIRS += \
|
SUBDIRS += \
|
||||||
src/spark-dstore-patch \
|
|
||||||
src/spark-store.pro
|
src/spark-store.pro
|
||||||
|
|
||||||
# https://wiki.debian.org/Hardening
|
# https://wiki.debian.org/Hardening
|
||||||
|
|||||||
@@ -58,8 +58,9 @@ void AppIntoPage::openUrl(const QUrl &url)
|
|||||||
// 获取图标
|
// 获取图标
|
||||||
QNetworkRequest request;
|
QNetworkRequest request;
|
||||||
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
|
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
|
||||||
qDebug() << api->getImgServerUrl() + SparkAPI::getArchDir() + url.path() + "/icon.png";
|
QString pkgUrlBase = api->getImgServerUrl() + SparkAPI::getArchDir() + url.path();
|
||||||
request.setUrl(QUrl(api->getImgServerUrl() + SparkAPI::getArchDir() + url.path() + "/icon.png"));
|
qDebug() << "Icon URL: " << pkgUrlBase + "/icon.png";
|
||||||
|
request.setUrl(QUrl(pkgUrlBase + "/icon.png"));
|
||||||
request.setRawHeader("User-Agent", "Mozilla/5.0");
|
request.setRawHeader("User-Agent", "Mozilla/5.0");
|
||||||
request.setRawHeader("Content-Type", "charset='utf-8'");
|
request.setRawHeader("Content-Type", "charset='utf-8'");
|
||||||
manager->get(request);
|
manager->get(request);
|
||||||
@@ -74,20 +75,13 @@ void AppIntoPage::openUrl(const QUrl &url)
|
|||||||
manager->deleteLater(); });
|
manager->deleteLater(); });
|
||||||
|
|
||||||
// 获取截图
|
// 获取截图
|
||||||
QJsonParseError error;
|
|
||||||
QJsonArray array = QJsonDocument::fromJson(info.value("img_urls").toString().toUtf8(), &error).array();
|
|
||||||
QStringList imglist;
|
|
||||||
foreach (const QJsonValue &value, array) {
|
|
||||||
QString imgUrl = value.toString();
|
|
||||||
imglist.append(imgUrl);
|
|
||||||
}
|
|
||||||
qDebug() << imglist;
|
|
||||||
|
|
||||||
for (int i = 0; i < imglist.size(); i++)
|
for (int i = 0; i < 5 /* 魔法数字,最多五个截图 */; i++)
|
||||||
{
|
{
|
||||||
|
QString imgUrl = pkgUrlBase + "/screen_" + QString::number(i + 1) + ".png";
|
||||||
QNetworkRequest request;
|
QNetworkRequest request;
|
||||||
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
|
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
|
||||||
request.setUrl(QUrl(imglist.value(i)));
|
request.setUrl(QUrl(imgUrl));
|
||||||
request.setRawHeader("User-Agent", "Mozilla/5.0");
|
request.setRawHeader("User-Agent", "Mozilla/5.0");
|
||||||
request.setRawHeader("Content-Type", "charset='utf-8'");
|
request.setRawHeader("Content-Type", "charset='utf-8'");
|
||||||
manager->get(request);
|
manager->get(request);
|
||||||
@@ -95,17 +89,21 @@ void AppIntoPage::openUrl(const QUrl &url)
|
|||||||
{
|
{
|
||||||
QByteArray jpegData = reply->readAll();
|
QByteArray jpegData = reply->readAll();
|
||||||
QPixmap pixmap;
|
QPixmap pixmap;
|
||||||
pixmap.loadFromData(jpegData);
|
if (pixmap.loadFromData(jpegData))
|
||||||
pixmap.scaled(100, 100, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
|
{
|
||||||
image_show *img=new image_show(this);
|
pixmap.scaled(100, 100, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
|
||||||
img->setImage(pixmap);
|
image_show *img = new image_show(this);
|
||||||
//img->setScaledContents(true);
|
img->setImage(pixmap);
|
||||||
QListWidgetItem* pItem = new QListWidgetItem();
|
// img->setScaledContents(true);
|
||||||
pItem->setSizeHint(QSize(280, 200));
|
QListWidgetItem *pItem = new QListWidgetItem();
|
||||||
ui->listWidget->addItem(pItem);
|
pItem->setSizeHint(QSize(280, 200));
|
||||||
ui->listWidget->setItemWidget(pItem, img);
|
ui->listWidget->addItem(pItem);
|
||||||
|
ui->listWidget->setItemWidget(pItem, img);
|
||||||
|
qDebug() << imgUrl;
|
||||||
|
}
|
||||||
|
|
||||||
manager->deleteLater(); });
|
manager->deleteLater();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check UOS
|
// Check UOS
|
||||||
@@ -201,24 +199,20 @@ void AppIntoPage::clear()
|
|||||||
ui->tag_community->hide();
|
ui->tag_community->hide();
|
||||||
ui->icon->clear();
|
ui->icon->clear();
|
||||||
ui->title->clear();
|
ui->title->clear();
|
||||||
|
ui->version->clear();
|
||||||
ui->author->clear();
|
ui->author->clear();
|
||||||
|
ui->d_author->clear();
|
||||||
|
ui->d_size->clear();
|
||||||
|
ui->d_update->clear();
|
||||||
|
ui->d_pkgname->clear();
|
||||||
|
ui->d_website->clear();
|
||||||
|
ui->d_contributor->clear();
|
||||||
ui->label_2->clear();
|
ui->label_2->clear();
|
||||||
ui->downloadButton->hide();
|
ui->downloadButton->hide();
|
||||||
ui->downloadButton->setEnabled(false);
|
ui->downloadButton->setEnabled(false);
|
||||||
ui->pushButton_3->hide();
|
ui->pushButton_3->hide();
|
||||||
|
|
||||||
// QListWidgetItem *item = nullptr;
|
|
||||||
// while ((item = ui->listWidget->takeItem(0)) != nullptr)
|
|
||||||
// {
|
|
||||||
// QWidget *card = ui->listWidget->itemWidget(item);
|
|
||||||
// if (card)
|
|
||||||
// {
|
|
||||||
// card->deleteLater();
|
|
||||||
// card = nullptr;
|
|
||||||
// }
|
|
||||||
// delete item;
|
|
||||||
// item = nullptr;
|
|
||||||
// }
|
|
||||||
|
|
||||||
ui->listWidget->clear(); // NOTE: QListWidget::clear() 会析构所有 items
|
ui->listWidget->clear(); // NOTE: QListWidget::clear() 会析构所有 items
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ void SettingsPage::on_pushButton_updateServer_clicked()
|
|||||||
|
|
||||||
|
|
||||||
QFile::remove(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/server.list");
|
QFile::remove(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/server.list");
|
||||||
auto updateSuccess = system("curl -o " + QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation).toUtf8() + "/server.list https://d.store.deepinos.org.cn/store/server-and-mirror.list");
|
auto updateSuccess = system("curl -o " + QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation).toUtf8() + "/server.list " /* 注意空格的问题 */ + DEFAULT_SERVER_URL + "store/server-and-mirror.list");
|
||||||
qDebug() << "Update serverlist status:" << updateSuccess;
|
qDebug() << "Update serverlist status:" << updateSuccess;
|
||||||
if (updateSuccess != 0) // 更新失败不换服务器配置
|
if (updateSuccess != 0) // 更新失败不换服务器配置
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -140,7 +140,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Take effect when restart</string>
|
<string>Take effect immediately</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
TARGET = spark-dstore-patch
|
|
||||||
TEMPLATE += app
|
|
||||||
QT += widgets
|
|
||||||
SOURCES += spark-dstore-tool.cpp
|
|
||||||
|
|
||||||
# Default rules for deployment.
|
|
||||||
qnx: target.path = /tmp/spark-store/bin
|
|
||||||
else: unix:!android: target.path = /opt/durapps/spark-store/bin
|
|
||||||
!isEmpty(target.path): INSTALLS += target
|
|
||||||
@@ -1,195 +0,0 @@
|
|||||||
#include <QCoreApplication>
|
|
||||||
#include <QDir>
|
|
||||||
#include <QJsonObject>
|
|
||||||
#include <QJsonDocument>
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QDirIterator>
|
|
||||||
#include <QProcess>
|
|
||||||
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
QList<QJsonObject> enumAppInfoList()
|
|
||||||
{
|
|
||||||
QList<QJsonObject> appInfoList;
|
|
||||||
QDir apps("/opt/apps");
|
|
||||||
auto list = apps.entryList(QDir::Dirs | QDir::NoDotAndDotDot);
|
|
||||||
for (auto &appID : list) {
|
|
||||||
auto infoPath = apps.absoluteFilePath(appID + "/info");
|
|
||||||
QFile infoFile(infoPath);
|
|
||||||
if (!infoFile.open(QIODevice::ReadOnly)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
auto doc = QJsonDocument::fromJson(infoFile.readAll());
|
|
||||||
appInfoList.push_back(doc.object());
|
|
||||||
}
|
|
||||||
return appInfoList;
|
|
||||||
}
|
|
||||||
//这段是去找appid和info,没看懂用来干啥的,在此之后info文件也没再用过
|
|
||||||
//可能以后版本的实现会用到,等官方加功能再说
|
|
||||||
void linkDir(const QString &source, const QString &target)
|
|
||||||
{
|
|
||||||
auto ensureTargetDir = [](const QString &targetFile) {
|
|
||||||
QFileInfo t(targetFile);
|
|
||||||
QDir tDir(t.dir());
|
|
||||||
tDir.mkpath(".");
|
|
||||||
};
|
|
||||||
|
|
||||||
QDir sourceDir(source);
|
|
||||||
QDir targetDir(target);
|
|
||||||
QDirIterator iter(source, QDir::Files | QDir::NoDotAndDotDot, QDirIterator::Subdirectories);
|
|
||||||
while (iter.hasNext()) {
|
|
||||||
auto sourceFile = iter.next();
|
|
||||||
auto targetFile = targetDir.absoluteFilePath(sourceDir.relativeFilePath(sourceFile));
|
|
||||||
|
|
||||||
QFileInfo tfi(targetFile);
|
|
||||||
// if (tfi.isSymLink() && (tfi.canonicalFilePath() == sourceFile)) {
|
|
||||||
//这里官方应该是写错了,否则会每触发一次就把所有软链接都删了重新创建一次
|
|
||||||
if (tfi.isSymLink() && (tfi.symLinkTarget() == sourceFile)) {
|
|
||||||
continue;
|
|
||||||
} else {
|
|
||||||
QFile::remove(targetFile);
|
|
||||||
}
|
|
||||||
|
|
||||||
ensureTargetDir(targetFile);
|
|
||||||
auto ret = symlink(sourceFile.toStdString().c_str(), targetFile.toStdString().c_str());
|
|
||||||
if (0 != ret) {
|
|
||||||
qDebug() << "link failed" << sourceFile << "=>" << targetFile << ret;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//reset Dynamic library rpath
|
|
||||||
void setRpath(const QString &file, const QString &path)
|
|
||||||
{
|
|
||||||
if (!QFileInfo::exists(path))
|
|
||||||
return;
|
|
||||||
QProcess p;
|
|
||||||
auto cmd = "patchelf " + file + " --set-rpath " + path;
|
|
||||||
p.start("bash", QStringList {"-c", cmd});
|
|
||||||
p.waitForFinished();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString getGlic()
|
|
||||||
{
|
|
||||||
//get arch & glibc
|
|
||||||
QProcess p;
|
|
||||||
auto cmd = "gcc -dumpmachine";
|
|
||||||
p.start("bash", QStringList {"-c", cmd});
|
|
||||||
p.waitForFinished();
|
|
||||||
return p.readAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
void linkApp(const QJsonObject &app)
|
|
||||||
{
|
|
||||||
auto appID = app.value("appid").toString();
|
|
||||||
auto appEntriesDir = QDir("/opt/apps/" + appID + "/entries");
|
|
||||||
auto appLibsDir = QDir("/opt/apps/" + appID + "/files/lib");
|
|
||||||
auto autoStartDir = QDir(appEntriesDir.absoluteFilePath("autostart"));
|
|
||||||
|
|
||||||
bool autoStart = app.value("permissions").toObject().value("autostart").toBool();
|
|
||||||
if (autoStart) {
|
|
||||||
linkDir(appEntriesDir.absoluteFilePath("autostart"), "/etc/xdg/autostart");
|
|
||||||
}
|
|
||||||
|
|
||||||
// link application
|
|
||||||
auto sysShareDir = QDir("/usr/share");
|
|
||||||
linkDir(appEntriesDir.absoluteFilePath("applications"), sysShareDir.absoluteFilePath("applications"));
|
|
||||||
linkDir(appEntriesDir.absoluteFilePath("icons"), sysShareDir.absoluteFilePath("icons"));
|
|
||||||
linkDir(appEntriesDir.absoluteFilePath("mime"), sysShareDir.absoluteFilePath("mime"));
|
|
||||||
linkDir(appEntriesDir.absoluteFilePath("glib-2.0"), sysShareDir.absoluteFilePath("glib-2.0"));
|
|
||||||
linkDir(appEntriesDir.absoluteFilePath("services"), sysShareDir.absoluteFilePath("dbus-1/services"));
|
|
||||||
linkDir(appEntriesDir.absoluteFilePath("GConf"), sysShareDir.absoluteFilePath("GConf"));
|
|
||||||
linkDir(appEntriesDir.absoluteFilePath("help"), sysShareDir.absoluteFilePath("help"));
|
|
||||||
linkDir(appEntriesDir.absoluteFilePath("locale"), sysShareDir.absoluteFilePath("locale"));
|
|
||||||
linkDir(appEntriesDir.absoluteFilePath("fcitx"), sysShareDir.absoluteFilePath("fcitx"));
|
|
||||||
linkDir(appEntriesDir.absoluteFilePath("polkit"), sysShareDir.absoluteFilePath("polkit-1"));
|
|
||||||
linkDir(appEntriesDir.absoluteFilePath("fonts/conf"), "/etc/fonts/conf.d");
|
|
||||||
linkDir(appEntriesDir.absoluteFilePath("fonts/files"), sysShareDir.absoluteFilePath("fonts"));
|
|
||||||
|
|
||||||
|
|
||||||
//原来会导致Gtk相关应用翻译缺失,补足了
|
|
||||||
|
|
||||||
|
|
||||||
auto pluginDir = QDir(appEntriesDir.absoluteFilePath("plugins"));
|
|
||||||
if (pluginDir.exists()) {
|
|
||||||
QString arch = getGlic();
|
|
||||||
// if (pluginDir.exists()) {
|
|
||||||
// QDirIterator iter(pluginDir.absolutePath(), QDir::Files | QDir::NoDotAndDotDot, QDirIterator::Subdirectories);
|
|
||||||
// while (iter.hasNext()) {
|
|
||||||
// auto sourceFile = iter.next();
|
|
||||||
// setRpath(sourceFile, appLibsDir.absolutePath()); //set rpath
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
linkDir(appEntriesDir.absoluteFilePath("plugins/fcitx"), "/usr/lib/" + arch + "/fcitx");
|
|
||||||
linkDir(appEntriesDir.absoluteFilePath("plugins/browser"), "/usr/lib/mozilla/plugins");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void cleanLink()
|
|
||||||
{
|
|
||||||
auto cleanDirBrokenLink = [](const QString &dir) {
|
|
||||||
QProcess p;
|
|
||||||
auto cmd = "find " + dir + " -xtype l -delete";
|
|
||||||
p.start("bash", QStringList {"-c", cmd});
|
|
||||||
p.waitForFinished();
|
|
||||||
};
|
|
||||||
|
|
||||||
QString arch = getGlic();
|
|
||||||
auto sysShareDir = QDir("/usr/share");
|
|
||||||
cleanDirBrokenLink(sysShareDir.absoluteFilePath("applications"));
|
|
||||||
cleanDirBrokenLink(sysShareDir.absoluteFilePath("icons"));
|
|
||||||
cleanDirBrokenLink(sysShareDir.absoluteFilePath("mime/packages"));
|
|
||||||
cleanDirBrokenLink(sysShareDir.absoluteFilePath("glib-2.0"));
|
|
||||||
cleanDirBrokenLink(sysShareDir.absoluteFilePath("dbus-1/services"));
|
|
||||||
cleanDirBrokenLink("/etc/xdg/autostart");
|
|
||||||
cleanDirBrokenLink(sysShareDir.absoluteFilePath("fcitx"));
|
|
||||||
cleanDirBrokenLink(sysShareDir.absoluteFilePath("help"));
|
|
||||||
cleanDirBrokenLink(sysShareDir.absoluteFilePath("locale"));
|
|
||||||
cleanDirBrokenLink("/usr/lib/" + arch + "/fcitx");
|
|
||||||
cleanDirBrokenLink("/usr/lib/mozilla/plugins");
|
|
||||||
cleanDirBrokenLink(sysShareDir.absoluteFilePath("polkit-1/actions"));
|
|
||||||
cleanDirBrokenLink(sysShareDir.absoluteFilePath("fonts"));
|
|
||||||
cleanDirBrokenLink("/etc/fonts/conf.d");
|
|
||||||
}
|
|
||||||
|
|
||||||
void update()
|
|
||||||
{
|
|
||||||
QProcess p;
|
|
||||||
auto cmd = "glib-compile-schemas /usr/share/glib-2.0/schemas/";
|
|
||||||
p.start("bash", QStringList {"-c", cmd});
|
|
||||||
p.waitForFinished();
|
|
||||||
|
|
||||||
cmd = "update-icon-caches /usr/share/icons/*";
|
|
||||||
p.start("bash", QStringList {"-c", cmd});
|
|
||||||
p.waitForFinished();
|
|
||||||
|
|
||||||
cmd = "update-desktop-database -q";
|
|
||||||
p.start("bash", QStringList {"-c", cmd});
|
|
||||||
p.waitForFinished();
|
|
||||||
|
|
||||||
cmd = "update-mime-database -V /usr/share/mime";
|
|
||||||
p.start("bash", QStringList {"-c", cmd});
|
|
||||||
p.waitForFinished();
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
|
||||||
{
|
|
||||||
QCoreApplication app(argc, argv);
|
|
||||||
|
|
||||||
cleanLink();
|
|
||||||
|
|
||||||
for (auto &a : enumAppInfoList()) {
|
|
||||||
linkApp(a);
|
|
||||||
}
|
|
||||||
qInfo()<<"Spark dstore patch (c) The Spark Project 2022-Now. Modified from deepin-app-store-tool";
|
|
||||||
|
|
||||||
// trigger
|
|
||||||
update();
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
13
tool/aptss
13
tool/aptss
@@ -28,19 +28,10 @@ echo "${TRANSHELL_CONTENT_RUNNING_IN_NOT_ROOT_USER}"
|
|||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
if is_empty_dir /etc/apt/sources.list.d/ ;then
|
|
||||||
echo "${TRANSHELL_CONTENT_INFO_SOURCES_LIST_D_IS_EMPTY}"
|
|
||||||
else
|
|
||||||
ln -sf /etc/apt/sources.list.d/* /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d
|
ln -sf /etc/apt/sources.list.d/* /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d
|
||||||
###让这里和系统同步,先链接,然后清除无效链接
|
###让这里和系统同步,先链接,然后清除无效链接
|
||||||
for a in `find /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d -type l`
|
find /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d -xtype l -delete
|
||||||
do
|
|
||||||
stat -L $a >/dev/null 2>/dev/null
|
|
||||||
if [ $? -gt 0 ];then
|
|
||||||
rm $a
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
124
tool/spark-dstore-patch
Executable file
124
tool/spark-dstore-patch
Executable file
@@ -0,0 +1,124 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "----------------Running Spark DStore Patch----------------"
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
|
enumAppInfoList() {
|
||||||
|
appInfoList=()
|
||||||
|
apps="/opt/apps"
|
||||||
|
list=$(ls $apps)
|
||||||
|
for appID in $list; do
|
||||||
|
appInfoList+=("$appID")
|
||||||
|
done
|
||||||
|
echo "${appInfoList[@]}"
|
||||||
|
}
|
||||||
|
linkDir() {
|
||||||
|
ensureTargetDir() {
|
||||||
|
targetFile=$1
|
||||||
|
t=$(dirname "$targetFile")
|
||||||
|
mkdir -p "$t"
|
||||||
|
}
|
||||||
|
|
||||||
|
source=$1
|
||||||
|
target=$2
|
||||||
|
sourceDir=$(dirname "$source")
|
||||||
|
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"
|
||||||
|
ln -s "$sourceFile" "$targetFile"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
linkApp() {
|
||||||
|
appID=$1
|
||||||
|
appEntriesDir="/opt/apps/$appID/entries"
|
||||||
|
appLibsDir="/opt/apps/$appID/files/lib"
|
||||||
|
autoStartDir="$appEntriesDir/autostart"
|
||||||
|
|
||||||
|
if [ -d "$autoStartDir" ]; then
|
||||||
|
linkDir "$autoStartDir" "/etc/xdg/autostart"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# link application
|
||||||
|
sysShareDir="/usr/share"
|
||||||
|
for folder in "$appEntriesDir/applications" "$appEntriesDir/icons" "$appEntriesDir/mime" "$appEntriesDir/glib-2.0" "$appEntriesDir/services" "$appEntriesDir/GConf" "$appEntriesDir/help" "$appEntriesDir/locale" "$appEntriesDir/fcitx"; do
|
||||||
|
if [ ! -d "$folder" ]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
if [ "$folder" = "$appEntriesDir/polkit" ]; then
|
||||||
|
linkDir "$folder" "/usr/share/polkit-1"
|
||||||
|
elif [ "$folder" = "$appEntriesDir/fonts/conf" ]; then
|
||||||
|
linkDir "$folder" "/etc/fonts/conf.d"
|
||||||
|
else
|
||||||
|
linkDir "$folder" "$sysShareDir/${folder##*/}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# 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..."
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
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 &
|
||||||
|
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 &
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
echo "----------------Finished----------------"
|
||||||
@@ -76,18 +76,21 @@ IS_MD5SUM_CHECKD=`cat $PACKAGES_DATA_PATH | grep $DEB_MD5SUM`
|
|||||||
if [ $# -eq 0 ];then
|
if [ $# -eq 0 ];then
|
||||||
echo "没有接收到参数,退出"
|
echo "没有接收到参数,退出"
|
||||||
echo "用法:$0 deb路径"
|
echo "用法:$0 deb路径"
|
||||||
|
echo "OMG-IT-GOES-WRONG"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "$1" ]
|
if [ ! -f "$1" ]
|
||||||
then
|
then
|
||||||
echo "${TRANSHELL_CONTENT_FILE_NOT_EXIST}"
|
echo "${TRANSHELL_CONTENT_FILE_NOT_EXIST}"
|
||||||
|
echo "OMG-IT-GOES-WRONG"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$(id -u)" != "0" ];then
|
if [ "$(id -u)" != "0" ];then
|
||||||
#############################无root权限时
|
#############################无root权限时
|
||||||
echo "${TRANSHELL_CONTENT_PLEASE_RUN_AS_ROOT}"
|
echo "${TRANSHELL_CONTENT_PLEASE_RUN_AS_ROOT}"
|
||||||
|
echo "OMG-IT-GOES-WRONG"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -565,7 +565,7 @@
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/pages/settingspage.ui" line="143"/>
|
<location filename="../src/pages/settingspage.ui" line="143"/>
|
||||||
<source>Take effect when restart</source>
|
<source>Take effect immediately</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
|
|||||||
@@ -565,7 +565,7 @@
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/pages/settingspage.ui" line="143"/>
|
<location filename="../src/pages/settingspage.ui" line="143"/>
|
||||||
<source>Take effect when restart</source>
|
<source>Take effect immediately</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
|
|||||||
@@ -565,8 +565,8 @@
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/pages/settingspage.ui" line="143"/>
|
<location filename="../src/pages/settingspage.ui" line="143"/>
|
||||||
<source>Take effect when restart</source>
|
<source>Take effect immediately</source>
|
||||||
<translation>重启商店后生效</translation>
|
<translation>设置后立即生效</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/pages/settingspage.ui" line="185"/>
|
<location filename="../src/pages/settingspage.ui" line="185"/>
|
||||||
|
|||||||
@@ -565,8 +565,8 @@
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/pages/settingspage.ui" line="143"/>
|
<location filename="../src/pages/settingspage.ui" line="143"/>
|
||||||
<source>Take effect when restart</source>
|
<source>Take effect immediately</source>
|
||||||
<translation>重启商店后生效</translation>
|
<translation>设置后立即生效</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/pages/settingspage.ui" line="185"/>
|
<location filename="../src/pages/settingspage.ui" line="185"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user