mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-15 21:32:05 +08:00
Compare commits
34 Commits
4.2.3.2Rea
...
lts-3.5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2cd976491f | ||
|
|
60d336e2dd | ||
| 4957e006d0 | |||
|
|
a3d803477a | ||
| 9897ba84ba | |||
| ca29afa425 | |||
| 97098f794d | |||
| ebaeca359a | |||
| 63ca640c31 | |||
| e67d3fab76 | |||
| d01fe44152 | |||
| 43042b5ae7 | |||
| 9614efa0aa | |||
| b1499b5942 | |||
| e8c344f75d | |||
| a388535361 | |||
| e94ee00ade | |||
| 0119b21c82 | |||
| 601b086923 | |||
| f1a2886161 | |||
| e2f1a344c4 | |||
| 9fc5153f37 | |||
|
|
b93f6362b7 | ||
| 32350cf519 | |||
| c27c922d0b | |||
| 6dee04f5e8 | |||
| 924d8d18a9 | |||
| f027a2fa7e | |||
| 89c4b968f3 | |||
| ab36e76032 | |||
| f49db42c3a | |||
| 58b31f182a | |||
| a30c26a7f2 | |||
| 4dbd79a1ac |
@@ -18,7 +18,7 @@ stages:
|
|||||||
name: execute_by_docker
|
name: execute_by_docker
|
||||||
displayName: 基于镜像的脚本执行
|
displayName: 基于镜像的脚本执行
|
||||||
certificate: ''
|
certificate: ''
|
||||||
image: docker.io/debian:buster-slim
|
image: docker.io/debian:buster
|
||||||
command:
|
command:
|
||||||
- sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
|
- sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
|
||||||
- '# 换源'
|
- '# 换源'
|
||||||
|
|||||||
@@ -14,31 +14,40 @@ stages:
|
|||||||
trigger: auto
|
trigger: auto
|
||||||
executor: []
|
executor: []
|
||||||
steps:
|
steps:
|
||||||
- step: build@nodejs
|
- step: execute@docker
|
||||||
name: build_dtk
|
name: execute_by_docker
|
||||||
displayName: DTK构建
|
displayName: 基于镜像的DTK构建
|
||||||
nodeVersion: 14.16.0
|
certificate: ''
|
||||||
commands:
|
image: docker.io/debian:buster
|
||||||
- git clone https://gitlink.org.cn/shenmo7192/debian-10-container.git
|
command:
|
||||||
- mv debian-10-container/Debian-10.tar.xz /mnt
|
- sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
|
||||||
- rm -rf debian-10-container
|
- '# 换源'
|
||||||
- WORK_DIR=`pwd`
|
- apt update
|
||||||
- yum install xz -y
|
- export DEBIAN_FRONTEND=noninteractive
|
||||||
- cd /mnt/
|
- echo "安装git devscripts equivs curl..."
|
||||||
- tar -xf Debian-10.tar.xz
|
- 'apt install git devscripts equivs curl -y '
|
||||||
- cd Debian-10
|
- git clone https://gitlink.org.cn/shenmo7192/dtk-old-bundle.git
|
||||||
- wget https://gitee.com/deepin-community-store/repo_auto_update_script/raw/master/spark-build.sh
|
- cd dtk-old-bundle
|
||||||
- chmod +x spark-build.sh
|
- apt install ./*.deb -y
|
||||||
- mkdir build-spark
|
- cd ..
|
||||||
- cp -r $WORK_DIR build-spark/spark-store
|
- rm -rf dtk-old-bundle
|
||||||
- echo "进入Debian 10环境"
|
- ''
|
||||||
- chroot /mnt/Debian-10 /bin/bash /spark-build.sh
|
- 'mk-build-deps --install --tool "apt-get -o Debug::pkgProblemResolver=yes -y" '
|
||||||
- cd /mnt/Debian-10/build-spark
|
- ''
|
||||||
|
- dpkg-buildpackage -b -us -uc
|
||||||
|
- cd ..
|
||||||
|
- ls -all
|
||||||
|
- pwd
|
||||||
|
- ''
|
||||||
|
- 'mkdir target '
|
||||||
|
- for f in $(find . -type f -name "*.deb")
|
||||||
|
- do
|
||||||
|
- ' mv $f target'
|
||||||
|
- done
|
||||||
artifacts:
|
artifacts:
|
||||||
- name: BUILD_ARTIFACT
|
- name: BUILD_ARTIFACT
|
||||||
path:
|
path:
|
||||||
- /mnt/Debian-10/build-spark/target
|
- ../target
|
||||||
caches: []
|
|
||||||
notify: []
|
notify: []
|
||||||
strategy:
|
strategy:
|
||||||
retry: '0'
|
retry: '0'
|
||||||
|
|||||||
36
debian/changelog
vendored
36
debian/changelog
vendored
@@ -1,3 +1,39 @@
|
|||||||
|
spark-store (3.5.3) stable; urgency=medium
|
||||||
|
|
||||||
|
* fix: sender-d功能修复
|
||||||
|
|
||||||
|
|
||||||
|
-- shenmo <shenmo@spark-app.store> Fri, 30 Jan 2022 00:00:00 +0800
|
||||||
|
|
||||||
|
spark-store (3.5.2) stable; urgency=medium
|
||||||
|
|
||||||
|
* fix: aptss 转为使用内置的ss-apt-fast指令
|
||||||
|
|
||||||
|
|
||||||
|
-- shenmo <shenmo@spark-app.store> Fri, 30 Jan 2022 00:00:00 +0800
|
||||||
|
|
||||||
|
spark-store (3.5.1.1) stable; urgency=medium
|
||||||
|
|
||||||
|
* fix: aptss shebang 修复
|
||||||
|
|
||||||
|
|
||||||
|
-- shenmo <shenmo@spark-app.store> Fri, 30 Jan 2022 00:00:00 +0800
|
||||||
|
|
||||||
|
spark-store (3.5.1) stable; urgency=medium
|
||||||
|
|
||||||
|
* fix: 搜索修复,在appinfo界面可以正常搜索
|
||||||
|
|
||||||
|
|
||||||
|
-- shenmo <shenmo@spark-app.store> Fri, 30 Jan 2022 00:00:00 +0800
|
||||||
|
|
||||||
|
spark-store (3.5) stable; urgency=medium
|
||||||
|
|
||||||
|
* feat: 搜索转为使用网页,提高加载速度和用户体验
|
||||||
|
* 下载软件时指定DNS,修复移动网络问题
|
||||||
|
* 准备进入LTS阶段
|
||||||
|
|
||||||
|
-- shenmo <shenmo@spark-app.store> Fri, 30 Jan 2022 00:00:00 +0800
|
||||||
|
|
||||||
spark-store (3.4~test1) stable; urgency=medium
|
spark-store (3.4~test1) stable; urgency=medium
|
||||||
|
|
||||||
* feat: aptss不再尝试安装apt-fast,转而自带
|
* feat: aptss不再尝试安装apt-fast,转而自带
|
||||||
|
|||||||
3
debian/spark-store.postinst
vendored
3
debian/spark-store.postinst
vendored
@@ -30,6 +30,9 @@ case "$1" in
|
|||||||
|
|
||||||
ln -s -f /opt/durapps/spark-store/bin/aptss /usr/bin/aptss
|
ln -s -f /opt/durapps/spark-store/bin/aptss /usr/bin/aptss
|
||||||
|
|
||||||
|
# Create symbol links for SSINSTALL
|
||||||
|
ln -s -f /opt/durapps/spark-store/bin/auto-install-policy/store.spark-app.ssinstall.policy /usr/share/polkit-1/actions/store.spark-app.ssinstall.policy
|
||||||
|
|
||||||
# Compile the Sender module
|
# Compile the Sender module
|
||||||
|
|
||||||
gcc /opt/durapps/spark-store/bin/ss-feedback/sender-d.sh.c -o /opt/durapps/spark-store/bin/ss-feedback/sender-d
|
gcc /opt/durapps/spark-store/bin/ss-feedback/sender-d.sh.c -o /opt/durapps/spark-store/bin/ss-feedback/sender-d
|
||||||
|
|||||||
2
debian/spark-store.prerm
vendored
2
debian/spark-store.prerm
vendored
@@ -8,8 +8,10 @@ rm /usr/local/bin/spark-dstore-patch
|
|||||||
rm /usr/local/bin/ussinstall
|
rm /usr/local/bin/ussinstall
|
||||||
rm /usr/local/bin/ussremove
|
rm /usr/local/bin/ussremove
|
||||||
rm /usr/local/bin/ss-apt-fast
|
rm /usr/local/bin/ss-apt-fast
|
||||||
|
|
||||||
rm /usr/bin/aptss
|
rm /usr/bin/aptss
|
||||||
|
|
||||||
|
|
||||||
rm -rf /etc/aptss/
|
rm -rf /etc/aptss/
|
||||||
|
|
||||||
# Remove Sender module
|
# Remove Sender module
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ void downloadlist::install(int t)
|
|||||||
|
|
||||||
QProcess isInstall;
|
QProcess isInstall;
|
||||||
isInstall.start("dpkg -s " + pkgName);
|
isInstall.start("dpkg -s " + pkgName);
|
||||||
isInstall.waitForFinished(180); // 默认超时 3 分钟
|
isInstall.waitForFinished(180*1000); // 默认超时 3 分钟
|
||||||
int error = QString::fromStdString(isInstall.readAllStandardError().toStdString()).length();
|
int error = QString::fromStdString(isInstall.readAllStandardError().toStdString()).length();
|
||||||
if(error == 0)
|
if(error == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ void DownloadController::startDownload(const QString &url)
|
|||||||
QProcess mailProcess;
|
QProcess mailProcess;
|
||||||
mailProcess.start(SenderdPath.toUtf8() + " " + metaUrl.toUtf8() + " " + "HD70642");
|
mailProcess.start(SenderdPath.toUtf8() + " " + metaUrl.toUtf8() + " " + "HD70642");
|
||||||
mailProcess.waitForStarted();
|
mailProcess.waitForStarted();
|
||||||
mailProcess.waitForFinished(3);
|
mailProcess.waitForFinished();
|
||||||
mailProcess.deleteLater();
|
mailProcess.deleteLater();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ DWIDGET_USE_NAMESPACE
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
// Get build time
|
// Get build time
|
||||||
static const QString version = "Version 3.4~test1";
|
static const QString version = "Version 3.5.3";
|
||||||
static const QDate buildDate = QLocale( QLocale::English ).toDate( QString(__DATE__).replace(" ", " 0"), "MMM dd yyyy");
|
static const QDate buildDate = QLocale( QLocale::English ).toDate( QString(__DATE__).replace(" ", " 0"), "MMM dd yyyy");
|
||||||
static const QTime buildTime = QTime::fromString(__TIME__, "hh:mm:ss");
|
static const QTime buildTime = QTime::fromString(__TIME__, "hh:mm:ss");
|
||||||
|
|
||||||
|
|||||||
@@ -789,8 +789,10 @@ void Widget::searchApp(QString text)
|
|||||||
}else{
|
}else{
|
||||||
ui->webEngineView->setUrl(serverUrl + "store/#/darksearch?keywords=" + text);
|
ui->webEngineView->setUrl(serverUrl + "store/#/darksearch?keywords=" + text);
|
||||||
}
|
}
|
||||||
|
ui->stackedWidget->setCurrentIndex(0);
|
||||||
// spinner->stop();
|
// spinner->stop();
|
||||||
// spinner->hide();
|
// spinner->hide();
|
||||||
|
ui->stackedWidget->setCurrentIndex(0);
|
||||||
mutex.unlock();
|
mutex.unlock();
|
||||||
|
|
||||||
|
|
||||||
@@ -1198,7 +1200,7 @@ void Widget::on_pushButton_uninstall_clicked()
|
|||||||
|
|
||||||
QProcess check;
|
QProcess check;
|
||||||
check.start("dpkg", QStringList() << "-s" << pkgName.toLower());
|
check.start("dpkg", QStringList() << "-s" << pkgName.toLower());
|
||||||
check.waitForFinished(180); // 默认超时 3 分钟
|
check.waitForFinished(180*1000); // 默认超时 3 分钟
|
||||||
|
|
||||||
if (check.readAllStandardOutput().isEmpty())
|
if (check.readAllStandardOutput().isEmpty())
|
||||||
{
|
{
|
||||||
@@ -1238,10 +1240,15 @@ void Widget::on_pushButton_clearWebCache_clicked()
|
|||||||
{
|
{
|
||||||
QtConcurrent::run([=]()
|
QtConcurrent::run([=]()
|
||||||
{
|
{
|
||||||
|
|
||||||
QString dataLocal = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation);
|
QString dataLocal = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation);
|
||||||
QDir cacheDir(dataLocal );
|
qDebug() << dataLocal;
|
||||||
cacheDir.removeRecursively(); });
|
QDir dataDir(dataLocal);
|
||||||
|
dataDir.removeRecursively();
|
||||||
|
dataLocal = QStandardPaths::writableLocation(QStandardPaths::TempLocation);
|
||||||
|
qDebug() << dataLocal;
|
||||||
|
QDir cacheDir(dataLocal);
|
||||||
|
cacheDir.removeRecursively();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
quint64 Widget::dirFileSize(const QString &path)
|
quint64 Widget::dirFileSize(const QString &path)
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ void SpkAppInfoLoaderThread::run()
|
|||||||
QProcess isInstall;
|
QProcess isInstall;
|
||||||
packagename = json["Pkgname"].toString();
|
packagename = json["Pkgname"].toString();
|
||||||
isInstall.start("dpkg -s " + json["Pkgname"].toString());
|
isInstall.start("dpkg -s " + json["Pkgname"].toString());
|
||||||
isInstall.waitForFinished(180); // 默认超时 3 分钟
|
isInstall.waitForFinished(180*1000); // 默认超时 3 分钟
|
||||||
int error = QString::fromStdString(isInstall.readAllStandardError().toStdString()).length();
|
int error = QString::fromStdString(isInstall.readAllStandardError().toStdString()).length();
|
||||||
if(error == 0)
|
if(error == 0)
|
||||||
{
|
{
|
||||||
@@ -100,12 +100,12 @@ void SpkAppInfoLoaderThread::run()
|
|||||||
|
|
||||||
QProcess isUpdate;
|
QProcess isUpdate;
|
||||||
isUpdate.start("dpkg-query --showformat='${Version}' --show " + json["Pkgname"].toString());
|
isUpdate.start("dpkg-query --showformat='${Version}' --show " + json["Pkgname"].toString());
|
||||||
isUpdate.waitForFinished(180); // 默认超时 3 分钟
|
isUpdate.waitForFinished(180*1000); // 默认超时 3 分钟
|
||||||
QString localVersion = isUpdate.readAllStandardOutput();
|
QString localVersion = isUpdate.readAllStandardOutput();
|
||||||
localVersion.replace("'", "");
|
localVersion.replace("'", "");
|
||||||
|
|
||||||
isUpdate.start("dpkg --compare-versions " + localVersion + " ge " + json["Version"].toString());
|
isUpdate.start("dpkg --compare-versions " + localVersion + " ge " + json["Version"].toString());
|
||||||
isUpdate.waitForFinished(180); // 默认超时 3 分钟
|
isUpdate.waitForFinished(180*1000); // 默认超时 3 分钟
|
||||||
if(!isUpdate.exitCode())
|
if(!isUpdate.exitCode())
|
||||||
{
|
{
|
||||||
isUpdated = true;
|
isUpdated = true;
|
||||||
|
|||||||
10
tool/aptss
10
tool/aptss
@@ -1,8 +1,6 @@
|
|||||||
#/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
apt-fast(){
|
|
||||||
/opt/durapps/spark-store/bin/apt-fast/ss-apt-fast "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ ! -e "/tmp/aptss-conf/apt-fast.conf" ];then
|
if [ ! -e "/tmp/aptss-conf/apt-fast.conf" ];then
|
||||||
###刷新apt-fast配置
|
###刷新apt-fast配置
|
||||||
@@ -27,7 +25,7 @@ sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sou
|
|||||||
bwrap --dev-bind / / \
|
bwrap --dev-bind / / \
|
||||||
--bind '/tmp/aptss-conf/apt-fast.conf' /etc/apt-fast.conf \
|
--bind '/tmp/aptss-conf/apt-fast.conf' /etc/apt-fast.conf \
|
||||||
--bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list \
|
--bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list \
|
||||||
apt-fast "$@" --allow-downgrades
|
/opt/durapps/spark-store/bin/apt-fast/ss-apt-fast "$@" --allow-downgrades
|
||||||
|
|
||||||
|
|
||||||
elif [ "$1" = "download" ];then
|
elif [ "$1" = "download" ];then
|
||||||
@@ -36,7 +34,7 @@ elif [ "$1" = "download" ];then
|
|||||||
bwrap --dev-bind / / \
|
bwrap --dev-bind / / \
|
||||||
--bind '/tmp/aptss-conf/apt-fast.conf' /etc/apt-fast.conf \
|
--bind '/tmp/aptss-conf/apt-fast.conf' /etc/apt-fast.conf \
|
||||||
--bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list \
|
--bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list \
|
||||||
apt-fast "$@" --allow-downgrades
|
/opt/durapps/spark-store/bin/apt-fast/ss-apt-fast "$@" --allow-downgrades
|
||||||
|
|
||||||
|
|
||||||
elif [ "$1" = "policy" ] || [ "$1" = "search" ];then
|
elif [ "$1" = "policy" ] || [ "$1" = "search" ];then
|
||||||
|
|||||||
@@ -1,12 +1,20 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#将来可能可以换成apt-metalink来直接用种子/链接下载
|
|
||||||
|
|
||||||
apt-fast(){
|
|
||||||
/opt/durapps/spark-store/bin/apt-fast/ss-apt-fast "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "Spark Store Install script.星火商店安装脚本"
|
echo "Spark Store Install script.星火商店安装脚本"
|
||||||
|
|
||||||
|
function pkexec_as_current_user() {
|
||||||
|
#Detect the name of the display in use
|
||||||
|
local display=":$(ls /tmp/.X11-unix/* | sed 's#/tmp/.X11-unix/X##' | head -n 1)"
|
||||||
|
|
||||||
|
#Detect the user using such display
|
||||||
|
local user=$(who | grep '('$display')' | awk '{print $1}' | head -n 1)
|
||||||
|
|
||||||
|
#Detect the id of the user
|
||||||
|
local uid=$(id -u $user)
|
||||||
|
|
||||||
|
sudo -u $user DISPLAY=$display DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$uid/bus pkexec "$@"
|
||||||
|
}
|
||||||
|
|
||||||
#################检测文件是否存在
|
#################检测文件是否存在
|
||||||
if [ $# -eq 0 ];then
|
if [ $# -eq 0 ];then
|
||||||
echo "没有接收到参数,退出"
|
echo "没有接收到参数,退出"
|
||||||
@@ -19,39 +27,38 @@ then
|
|||||||
echo "文件不存在"
|
echo "文件不存在"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
#################root校验+要密码
|
|
||||||
if [ "$(id -u)" != "0" ]
|
|
||||||
then
|
|
||||||
echo "ssinstall需要在root下运行";
|
|
||||||
uname=`whoami`
|
|
||||||
echo "Now input the password of $uname"
|
|
||||||
read -e upass
|
|
||||||
################检查密码对不对
|
|
||||||
echo "$upass" | sudo -S echo "i love amber forever"
|
|
||||||
passcheck=`echo "$upass" | sudo -S echo "i love amber forever"`
|
|
||||||
if [ "$passcheck" != "i love amber forever" ];then
|
|
||||||
echo "-----------------------------------------------------"
|
|
||||||
echo "E:密码错误,退出脚本!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
##############判断是否是root运行,如果是,则正常走;如果不是,则代输密码
|
|
||||||
if [ "$(id -u)" != "0" ];then
|
if [ "$(id -u)" != "0" ];then
|
||||||
#############################无root权限时
|
#############################无root权限时
|
||||||
----------------------------------------------------------------------------------
|
echo "请使用root启动ssinstall"
|
||||||
echo "$upass" | sudo -S dpkg -i $1 || sudo aptss install -yf
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
|
|
||||||
|
if [ ! -e "/var/lib/apt/lists/d.store.deepinos.org.cn_Packages" ];then
|
||||||
|
echo "接收星火仓库软件信息中..."
|
||||||
|
aptss ssupdate
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "正在计算hash并与星火仓库匹配..."
|
||||||
|
|
||||||
|
DEB_MD5SUM=`md5sum "$1" | cut -c -32`
|
||||||
|
|
||||||
|
IS_MD5SUM_CHECKD=`cat /var/lib/apt/lists/d.store.deepinos.org.cn_Packages | grep $DEB_MD5SUM`
|
||||||
|
if [ ! -z "$IS_MD5SUM_CHECKD" ];then
|
||||||
|
|
||||||
|
echo "校验成功,开始安装"
|
||||||
|
echo ----------------------------------------------------------------------------------
|
||||||
|
dpkg -i "$1" || aptss install -yf
|
||||||
|
|
||||||
else
|
else
|
||||||
###########################有root权限时
|
|
||||||
|
|
||||||
echo ----------------------------------------------------------------------------------
|
|
||||||
dpkg -i $1 || aptss install -yf
|
|
||||||
|
|
||||||
|
echo "校验失败,该deb不是星火已经上架的软件包,这可能是因为你正在尝试安装一个尚未上架的软件包"
|
||||||
|
echo "如果你是审核人员,这是正常的"
|
||||||
|
echo "为确保安全,将会询问密码"
|
||||||
|
|
||||||
|
pkexec_as_current_user bash -c "dpkg -i "$1" || aptss install -yf "
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,19 +1,32 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
if [ "$(id -u)" != "0" ];then
|
if [ "$(id -u)" != "0" ] ; then
|
||||||
pkexec "$0" "$@"
|
pkexec "$0" "$@"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
ssupdate)
|
ssupdate)
|
||||||
aptss ssupdate 2>&1 | tee /tmp/spark-store-app-ssupdate-log.txt
|
aptss ssupdate 2>&1 | tee /tmp/spark-store-app-ssupdate-log.txt
|
||||||
IS_SSUPDATE_ERROR=`cat /tmp/spark-store-app-ssupdate-log.txt | grep "E: "`
|
IS_SSUPDATE_ERROR=`cat /tmp/spark-store-app-ssupdate-log.txt | grep "E: "`
|
||||||
echo "$IS_SSUPDATE_ERROR" > /tmp/spark-store-app-ssupdate-status.txt
|
echo "$IS_SSUPDATE_ERROR" > /tmp/spark-store-app-ssupdate-status.txt
|
||||||
;;
|
;;
|
||||||
|
|
||||||
upgradable-list)
|
upgradable-list)
|
||||||
bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt list --upgradable -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" | awk 'BEGIN {FS="/"} {print $1}' | awk NR\>1
|
output=$(env LANGUAGE=en_US bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt list --upgradable -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="/dev/null" -o APT::Get::List-Cleanup="0" | awk NR\>1)
|
||||||
|
|
||||||
|
IFS_OLD="$IFS"
|
||||||
|
IFS=$'\n'
|
||||||
|
|
||||||
|
for line in $output ; do
|
||||||
|
PKG_NAME=$(echo $line | awk -F '/' '{print $1}')
|
||||||
|
PKG_NEW_VER=$(echo $line | awk -F ' ' '{print $2}')
|
||||||
|
PKG_CUR_VER=$(echo $line | awk -F ' ' '{print $6}' | awk -F ']' '{print $1}')
|
||||||
|
echo "${PKG_NAME} ${PKG_NEW_VER} ${PKG_CUR_VER}"
|
||||||
|
done
|
||||||
|
|
||||||
|
IFS="$IFS_OLD"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
upgrade-app)
|
upgrade-app)
|
||||||
aptss install "${@:2}" --only-upgrade 2>&1 | tee /tmp/spark-store-app-upgrade-log.txt
|
aptss install "${@:2}" --only-upgrade 2>&1 | tee /tmp/spark-store-app-upgrade-log.txt
|
||||||
IS_UPGRADE_ERROR=`cat /tmp/spark-store-app-upgrade-log.txt | grep "Package manager quit with exit code."`
|
IS_UPGRADE_ERROR=`cat /tmp/spark-store-app-upgrade-log.txt | grep "Package manager quit with exit code."`
|
||||||
|
|||||||
@@ -1,58 +1,81 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
touch /tmp/spark-store/upgradeStatus.txt
|
touch /tmp/spark-store/upgradeStatus.txt
|
||||||
|
|
||||||
|
# 执行 apt update
|
||||||
pkexec /opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh ssupdate | zenity --progress --auto-close --pulsate --no-cancel --text="正在检查更新,请稍候..." --height 70 --width 400 --title="星火商店更新模块" --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
|
pkexec /opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh ssupdate | zenity --progress --auto-close --pulsate --no-cancel --text="正在检查更新,请稍候..." --height 70 --width 400 --title="星火商店更新模块" --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
|
||||||
|
|
||||||
if [ -z `cat /tmp/spark-store-app-ssupdate-status.txt` != "0" ];then
|
if [ -z `cat /tmp/spark-store-app-ssupdate-status.txt` ] ; then
|
||||||
echo "无错误"
|
echo "无错误"
|
||||||
|
pkexec /opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh clean-log
|
||||||
else
|
else
|
||||||
zenity --error --text "检查更新进程出现错误!按确定查看报错,可用于反馈" --title "星火商店更新检测模块" --height 200 --width 350 --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
|
zenity --error --text "检查更新进程出现错误!按确定查看报错,可用于反馈" --title "星火商店更新检测模块" --height 200 --width 350 --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
|
||||||
zenity --text-info --filename=/tmp/spark-store-app-ssupdate-log.txt --checkbox="我已复制了此文本框中的日志,且将会在反馈时附上 。反馈渠道可以在右上角菜单的设置中找到" --title="反馈渠道在商店右上角的设置里" --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
|
zenity --text-info --filename=/tmp/spark-store-app-ssupdate-log.txt --checkbox="我已复制了此文本框中的日志,且将会在反馈时附上。反馈渠道可以在右上角菜单的设置中找到" --title="反馈渠道在商店右上角的设置里" --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
|
||||||
pkexec /opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh clean-log
|
pkexec /opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh clean-log
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
pkexec /opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh clean-log
|
|
||||||
|
|
||||||
|
# 获取可更新应用列表
|
||||||
PKG_LIST="$(pkexec /opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh upgradable-list)"
|
PKG_LIST="$(pkexec /opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh upgradable-list)"
|
||||||
####如果没更新,就弹出不需要更新
|
## 如果没更新,就弹出不需要更新
|
||||||
if [ -z "$PKG_LIST" ];then
|
if [ -z "$PKG_LIST" ] ; then
|
||||||
zenity --info --text "没有软件需要更新\n但是你并没有站在世界之巅" --title "星火商店更新检测模块" --height 150 --width 300 --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
|
zenity --info --text "没有软件需要更新\n但是你并没有站在世界之巅" --title "星火商店更新检测模块" --height 150 --width 300 --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
|
||||||
else
|
else
|
||||||
PKG_UPGRADE_LIST=`for PKG_NAME in $PKG_LIST;
|
## 获取用户选择的要更新的应用
|
||||||
do
|
### 指定分隔符为 \n
|
||||||
#### 检测是否是hold状态
|
IFS_OLD="$IFS"
|
||||||
if [ "$(dpkg-query -W -f='${Status}' $PKG_NAME | grep hold)" = "" ];then
|
IFS=$'\n'
|
||||||
|
|
||||||
|
PKG_UPGRADE_LIST=`for line in $PKG_LIST ; do
|
||||||
|
PKG_NAME=$(echo $line | awk -F ' ' '{print $1}')
|
||||||
|
PKG_NEW_VER=$(echo $line | awk -F ' ' '{print $2}')
|
||||||
|
PKG_CUR_VER=$(echo $line | awk -F ' ' '{print $3}')
|
||||||
|
|
||||||
|
dpkg --compare-versions $PKG_NEW_VER le $PKG_CUR_VER
|
||||||
|
if [ $? -eq 0 ] ; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
#### 检测是否是 hold 状态
|
||||||
|
PKG_STA=$(dpkg-query -W -f='${db:Status-Want}' $PKG_NAME)
|
||||||
|
if [ "$PKG_STA" != "hold" ] ; then
|
||||||
echo "true"
|
echo "true"
|
||||||
echo "$PKG_NAME"
|
echo "$PKG_NAME"
|
||||||
echo "$PKG_NAME"
|
echo "$PKG_NEW_VER"
|
||||||
|
echo "$PKG_CUR_VER"
|
||||||
else
|
else
|
||||||
echo "false"
|
echo "false"
|
||||||
echo "$PKG_NAME(无法更新:已被标记为保留)"
|
echo "$PKG_NAME(无法更新:已被标记为保留)"
|
||||||
echo "$PKG_NAME"
|
echo "$PKG_NEW_VER"
|
||||||
|
echo "$PKG_CUR_VER"
|
||||||
fi
|
fi
|
||||||
done | zenity --list --text="选择你想更新的应用" --column=是否更新 --column=应用包名 --column="真的应用包名" --separator=" " --checklist --print-column=3 --multiple --height 350 --width 550 --hide-column=3 --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg`
|
done`
|
||||||
|
|
||||||
#### 如果没有选择,则直接退出
|
### 还原分隔符
|
||||||
|
IFS="$IFS_OLD"
|
||||||
|
|
||||||
if [ "$PKG_UPGRADE_LIST" = "" ];then
|
## 如果没有应用需要更新,则直接退出
|
||||||
zenity --info --text "没有选中任何软件\n但是你并没有站在世界之巅" --title "星火商店更新检测服务" --height 150 --width 300 --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
|
if [ -z "$PKG_UPGRADE_LIST" ] ; then
|
||||||
else
|
zenity --info --text "没有软件需要更新\n但是你并没有站在世界之巅" --title "星火商店更新检测服务" --height 150 --width 300 --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
|
||||||
|
else
|
||||||
pkexec /opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh upgrade-app $PKG_UPGRADE_LIST -y | zenity --progress --auto-close --no-cancel --pulsate --text=正在更新已选中的应用,请稍候... --height 70 --width 400 --title="星火商店更新模块" --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
|
PKG_UPGRADE_LIST=$(echo "$PKG_UPGRADE_LIST" | zenity --list --text="选择你想更新的应用" --column="是否更新" --column="包名" --column="新版本" --column="从该版本更新" --separator=" " --checklist --multiple --print-column=2 --height 350 --width 550 --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg)
|
||||||
|
## 如果没有选择,则直接退出
|
||||||
if [ -z "`cat /tmp/spark-store-app-upgrade-status.txt`" ];then
|
if [ -z "$PKG_UPGRADE_LIST" ] ; then
|
||||||
|
zenity --info --text "没有选中任何软件\n但是你并没有站在世界之巅" --title "星火商店更新检测服务" --height 150 --width 300 --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
|
||||||
zenity --info --text "选中的软件已经更新完毕" --title "星火商店更新检测模块" --height 150 --width 300 --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
|
else
|
||||||
else
|
### 更新用户选择的应用
|
||||||
zenity --error --text "更新出现错误!按确定查看报错,可用于反馈" --title "星火商店更新检测模块" --height 200 --width 350 --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
|
pkexec /opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh upgrade-app $PKG_UPGRADE_LIST -y | zenity --progress --auto-close --no-cancel --pulsate --text="正在更新已选中的应用,请稍候..." --height 70 --width 400 --title="星火商店更新模块" --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
|
||||||
zenity --text-info --filename=/tmp/spark-store-app-upgrade-log.txt --checkbox="我已复制了此文本框中的日志,且将会在反馈时附上 。反馈渠道可以在右上角菜单的设置中找到" --title="反馈渠道在商店右上角的设置里往下拉" --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
#### 更新成功
|
||||||
|
if [ -z "`cat /tmp/spark-store-app-upgrade-status.txt`" ] ; then
|
||||||
|
zenity --info --text "选中的软件已经更新完毕" --title "星火商店更新检测模块" --height 150 --width 300 --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
|
||||||
|
else
|
||||||
|
#### 更新异常
|
||||||
|
zenity --error --text "更新出现错误!按确定查看报错,可用于反馈" --title "星火商店更新检测模块" --height 200 --width 350 --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
|
||||||
|
zenity --text-info --filename=/tmp/spark-store-app-upgrade-log.txt --checkbox="我已复制了此文本框中的日志,且将会在反馈时附上 。反馈渠道可以在右上角菜单的设置中找到" --title="反馈渠道在商店右上角的设置里往下拉" --window-icon=/usr/share/icons/hicolor/scalable/apps/spark-store.svg
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f touch /tmp/spark-store/upgradeStatus.txt
|
rm -f touch /tmp/spark-store/upgradeStatus.txt
|
||||||
####从最开头
|
# 从最开头
|
||||||
|
|||||||
@@ -13,14 +13,9 @@ else
|
|||||||
text_update_open="开启"
|
text_update_open="开启"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f /usr/share/polkit-1/actions/store.spark-app.ssinstall.policy ];then
|
|
||||||
text_auto_install_open="关闭"
|
|
||||||
#已经开启了就显示关闭
|
|
||||||
else
|
|
||||||
text_auto_install_open="开启"
|
|
||||||
fi
|
|
||||||
|
|
||||||
option=`zenity --list --text="欢迎使用星火更新和安装设置工具\n请在以下操作中选择一个进行~" --column 数字 --column=操作选项 --print-column=2 --height 350 --width 760 0 "查看自动更新相关功能使用前须知(重要)" 1 "$text_update_open星火更新检测工具(如果开启则会在系统启动后自动检测更新。如有更新则会弹出通知)" 2 查看可更新软件包列表并决定是否更新 3 "$text_auto_install_open点击安装免输入密码功能" 4 退出脚本 --hide-column=1 --print-column=1`
|
|
||||||
|
option=`zenity --list --text="欢迎使用星火更新和安装设置工具\n请在以下操作中选择一个进行~" --column 数字 --column=操作选项 --print-column=2 --height 350 --width 760 0 "查看自动更新相关功能使用前须知(重要)" 1 "$text_update_open星火更新检测工具(如果开启则会在系统启动后自动检测更新。如有更新则会弹出通知)" 2 查看可更新软件包列表并决定是否更新 4 退出脚本 --hide-column=1 --print-column=1`
|
||||||
|
|
||||||
case $option in
|
case $option in
|
||||||
0)
|
0)
|
||||||
@@ -42,25 +37,7 @@ case $option in
|
|||||||
2)
|
2)
|
||||||
/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade.sh
|
/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade.sh
|
||||||
;;
|
;;
|
||||||
3)
|
|
||||||
if [ -f /usr/share/polkit-1/actions/store.spark-app.ssinstall.policy ];then
|
|
||||||
zenity --info --icon-name=spark-store --height 150 --width 200 --text "---检测到已经启动了免输入密码,执行关闭" --timeout=2
|
|
||||||
pkexec rm /usr/share/polkit-1/actions/store.spark-app.ssinstall.policy
|
|
||||||
zenity --info --icon-name=spark-store --height 150 --width 200 --text "已关闭" --timeout=2
|
|
||||||
else
|
|
||||||
|
|
||||||
is_accept_polkiy=`zenity --list --height 350 --width 300 --text "请注意:这个功能尚未开发完成,一旦开启,则运行pkexec ssinstall时不再需要授权\n仅对星火内置安装器生效\n理论上会存在一定的安全风险" --column 数字 --column=操作选项 --hide-column=1 --print-column=1 1 同意 2 拒绝`
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if [ "$is_accept_polkiy" = "1" ];then
|
|
||||||
pkexec ln -s /opt/durapps/spark-store/bin/auto-install-policy/store.spark-app.ssinstall.policy /usr/share/polkit-1/actions/store.spark-app.ssinstall.policy
|
|
||||||
zenity --info --icon-name=spark-store --height 150 --width 200 --text "---已启动"
|
|
||||||
else
|
|
||||||
zenity --info --icon-name=spark-store --height 150 --width 200 --text "---未同意,返回"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
4)
|
4)
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -1,96 +1,93 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
LANGUAGE=en_US
|
||||||
LANG=en.US
|
|
||||||
|
|
||||||
|
# 发送通知
|
||||||
function notify-send() {
|
function notify-send() {
|
||||||
#Detect the name of the display in use
|
# Detect name of the display in use
|
||||||
local display=":$(ls /tmp/.X11-unix/* | sed 's#/tmp/.X11-unix/X##' | head -n 1)"
|
local display=":$(ls /tmp/.X11-unix/* | sed 's#/tmp/.X11-unix/X##' | head -n 1)"
|
||||||
|
|
||||||
#Detect the user using such display
|
# Detect user using the display
|
||||||
local user=$(who | grep '('$display')' | awk '{print $1}' | head -n 1)
|
local user=$(who | grep '('$display')' | awk '{print $1}' | head -n 1)
|
||||||
|
|
||||||
#Detect the id of the user
|
# Detect uid of the user
|
||||||
local uid=$(id -u $user)
|
local uid=$(id -u $user)
|
||||||
|
|
||||||
sudo -u $user DISPLAY=$display DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$uid/bus notify-send "$@"
|
sudo -u $user DISPLAY=$display DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${uid}/bus notify-send "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
#检测网络链接畅通
|
# 检测网络链接畅通
|
||||||
function network()
|
function network()
|
||||||
{
|
{
|
||||||
#超时时间
|
# 超时时间
|
||||||
local timeout=15
|
local timeout=15
|
||||||
|
|
||||||
#目标网站
|
# 目标网站
|
||||||
local target=www.baidu.com
|
local target=www.baidu.com
|
||||||
|
|
||||||
#获取响应状态码
|
# 获取响应状态码
|
||||||
local ret_code=`curl -I -s --connect-timeout ${timeout} ${target} -w %{http_code} | tail -n1`
|
local ret_code=`curl -I -s --connect-timeout ${timeout} ${target} -w %{http_code} | tail -n1`
|
||||||
|
|
||||||
if [ "x$ret_code" = "x200" ]; then
|
if [ "x$ret_code" = "x200" ] ; then
|
||||||
#网络畅通
|
# 网络畅通
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
#网络不畅通
|
# 网络不畅通
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
network
|
network
|
||||||
if [ $? -eq 1 ];then
|
if [ $? -ne 0 ] ; then
|
||||||
echo "Network fail. Stop to avoid bother dpkg"
|
echo "Network fail. Stop to avoid bother dpkg"
|
||||||
exit -1
|
exit -1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#The code above is modified from https://blog.csdn.net/yaxuan88521/article/details/120516298
|
# The code above is modified from https://blog.csdn.net/yaxuan88521/article/details/120516298
|
||||||
|
|
||||||
curl --progress-bar -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "https://gitee.com/deepin-community-store/repo_auto_update_script/raw/master/mirror-list-for-apt-fast/sources.list.d/sparkstore.list"
|
|
||||||
# 每日更新星火源文件
|
# 每日更新星火源文件
|
||||||
mkdir -p /etc/apt/preferences.d
|
curl --progress-bar -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "https://gitee.com/deepin-community-store/repo_auto_update_script/raw/master/mirror-list-for-apt-fast/sources.list.d/sparkstore.list"
|
||||||
touch /etc/apt/preferences.d/sparkstore
|
|
||||||
cat << EOF >/etc/apt/preferences.d/sparkstore
|
|
||||||
Package: *
|
|
||||||
Pin: origin *.deepinos.org.cn
|
|
||||||
Pin-Priority: 100
|
|
||||||
|
|
||||||
EOF
|
|
||||||
|
|
||||||
updatetext=`aptss ssupdate`
|
updatetext=`aptss ssupdate`
|
||||||
|
|
||||||
rm /etc/apt/preferences.d/sparkstore
|
|
||||||
|
|
||||||
|
|
||||||
isupdate=`echo ${updatetext: -5}`
|
isupdate=`echo ${updatetext: -5}`
|
||||||
if [ "$isupdate" = "date." ];then
|
if [ "$isupdate" = "date." ] ; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
#### 从这里开始,只有检测到了更新才会进行
|
|
||||||
|
|
||||||
|
## 从这里开始,只有检测到了更新才会进行
|
||||||
update_app_number=`echo ${updatetext%package*} #从右向左截取第一个 src 后的字符串`
|
update_app_number=`echo ${updatetext%package*} #从右向左截取第一个 src 后的字符串`
|
||||||
update_app_number=`echo ${update_app_number##*information...}`
|
update_app_number=`echo ${update_app_number##*information...}`
|
||||||
|
|
||||||
|
# 获取用户选择的要更新的应用
|
||||||
|
PKG_LIST="$(/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh upgradable-list)"
|
||||||
|
# 指定分隔符为 \n
|
||||||
|
IFS_OLD="$IFS"
|
||||||
|
IFS=$'\n'
|
||||||
|
|
||||||
PKG_LIST="$(bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt list --upgradable -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" | awk 'BEGIN {FS="/"} {print $1}' | awk NR\>1)"
|
for line in $PKG_LIST ; do
|
||||||
|
PKG_NAME=$(echo $line | awk -F ' ' '{print $1}')
|
||||||
|
PKG_NEW_VER=$(echo $line | awk -F ' ' '{print $2}')
|
||||||
|
PKG_CUR_VER=$(echo $line | awk -F ' ' '{print $3}')
|
||||||
|
|
||||||
|
dpkg --compare-versions $PKG_NEW_VER le $PKG_CUR_VER
|
||||||
|
|
||||||
|
if [ $? -eq 0 ] ; then
|
||||||
for PKG_NAME in $PKG_LIST;do
|
|
||||||
if [ "$(dpkg-query -W -f='${Status}' $PKG_NAME | grep hold)" != "" ];then
|
|
||||||
let update_app_number=$update_app_number-1
|
let update_app_number=$update_app_number-1
|
||||||
echo $update_app_number
|
continue
|
||||||
echo $PKG_NAME
|
fi
|
||||||
fi
|
|
||||||
|
## 检测是否是 hold 状态
|
||||||
|
PKG_STA=$(dpkg-query -W -f='${db:Status-Want}' $PKG_NAME)
|
||||||
|
if [ "$PKG_STA" = "hold" ] ; then
|
||||||
|
let update_app_number=$update_app_number-1
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# 还原分隔符
|
||||||
|
IFS="$IFS_OLD"
|
||||||
|
|
||||||
|
if [ $update_app_number -le 0 ] ; then
|
||||||
if [ $update_app_number -lt 1 ];then
|
exit 0
|
||||||
exit
|
|
||||||
fi
|
fi
|
||||||
#### 如果都是hold的那就直接退出,否则把剩余的给提醒了
|
|
||||||
|
|
||||||
notify-send -i spark-store "星火更新提醒" "星火商店仓库中有$update_app_number个软件包可以更新啦!请到星火商店的菜单处理"
|
|
||||||
|
|
||||||
|
|
||||||
|
## 如果都是hold或者版本一致的那就直接退出,否则把剩余的给提醒了
|
||||||
|
notify-send -a spark-store "星火更新提醒" "星火商店仓库中有$update_app_number个软件包可以更新啦!请到星火商店的菜单处理"
|
||||||
|
|||||||
Reference in New Issue
Block a user