From 5562e2b5d1475457f7ef9700af42acf374b30088 Mon Sep 17 00:00:00 2001 From: shenmo Date: Fri, 21 Oct 2022 13:59:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=B8=8D=E6=AD=A3=E7=A1=AE=E5=9C=B0?= =?UTF-8?q?=E8=B7=B3=E8=BF=87unhold?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tool/update-upgrade/ss-update-notifier.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tool/update-upgrade/ss-update-notifier.sh b/tool/update-upgrade/ss-update-notifier.sh index 2e92a89..0a376d1 100755 --- a/tool/update-upgrade/ss-update-notifier.sh +++ b/tool/update-upgrade/ss-update-notifier.sh @@ -71,14 +71,21 @@ fi update_app_number=`echo ${updatetext%package*} #从右向左截取第一个 src 后的字符串` update_app_number=`echo ${update_app_number##*information...}` + 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 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 +if [ "$(dpkg-query -W -f='${Status}' $PKG_NAME | grep hold)" != "" ];then + let update_app_number=$update_app_number-1 + echo $update_app_number + echo $PKG_NAME fi done + + if [ $update_app_number -lt 1 ];then exit fi