mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-13 20:32:05 +08:00
更新系统zenity,适配apt-mark hold
This commit is contained in:
7
debian/changelog
vendored
7
debian/changelog
vendored
@@ -1,3 +1,10 @@
|
|||||||
|
spark-store (3.3~test1) stable; urgency=medium
|
||||||
|
|
||||||
|
* zenity,选择可更新应用
|
||||||
|
* 自动更新检测现在会跳过hold
|
||||||
|
|
||||||
|
-- shenmo <shenmo@spark-app.store> Fri, 30 Jan 2022 00:00:00 +0800
|
||||||
|
|
||||||
spark-store (3.2.4) stable; urgency=medium
|
spark-store (3.2.4) stable; urgency=medium
|
||||||
|
|
||||||
* 修改tag相关的文案内容:wine相关环境已可自动配置了
|
* 修改tag相关的文案内容:wine相关环境已可自动配置了
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ int main(int argc, char *argv[])
|
|||||||
DAboutDialog dialog;
|
DAboutDialog dialog;
|
||||||
a.setAboutDialog(&dialog);
|
a.setAboutDialog(&dialog);
|
||||||
dialog.setLicense(QObject::tr("We publish this program under GPL V3"));
|
dialog.setLicense(QObject::tr("We publish this program under GPL V3"));
|
||||||
dialog.setVersion(DApplication::buildVersion("Version 3.2.4"));
|
dialog.setVersion(DApplication::buildVersion("Version 3.3~test1"));
|
||||||
dialog.setProductIcon(QIcon::fromTheme("spark-store")); // 设置Logo
|
dialog.setProductIcon(QIcon::fromTheme("spark-store")); // 设置Logo
|
||||||
dialog.setProductName(QLabel::tr("Spark Store"));
|
dialog.setProductName(QLabel::tr("Spark Store"));
|
||||||
dialog.setDescription(
|
dialog.setDescription(
|
||||||
@@ -58,7 +58,7 @@ int main(int argc, char *argv[])
|
|||||||
a.setOrganizationName("spark-union");
|
a.setOrganizationName("spark-union");
|
||||||
a.setOrganizationDomain("https://www.deepinos.org/");
|
a.setOrganizationDomain("https://www.deepinos.org/");
|
||||||
a.setApplicationName("Spark Store"); //不需要翻译,否则 ~/.local/share/ 下文件夹名称也被翻译为中文
|
a.setApplicationName("Spark Store"); //不需要翻译,否则 ~/.local/share/ 下文件夹名称也被翻译为中文
|
||||||
a.setApplicationVersion(DApplication::buildVersion("3.2.4"));
|
a.setApplicationVersion(DApplication::buildVersion("3.3~test1"));
|
||||||
a.setApplicationAcknowledgementPage("https://gitee.com/deepin-community-store/spark-store");
|
a.setApplicationAcknowledgementPage("https://gitee.com/deepin-community-store/spark-store");
|
||||||
a.setApplicationDescription(
|
a.setApplicationDescription(
|
||||||
QObject::tr(
|
QObject::tr(
|
||||||
|
|||||||
@@ -1,24 +1,26 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
echo "以上可升级,是否升级?[y/n]"
|
|
||||||
read yes_or_no
|
|
||||||
if [ "$yes_or_no" = "y" ];then ###这是确定是否同意
|
|
||||||
|
|
||||||
echo "获取更新列表..."
|
|
||||||
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)"
|
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)"
|
||||||
|
####如果没更新,就弹出不需要更新
|
||||||
|
if [ -z "$PKG_LIST" ];then
|
||||||
|
zenity --info --icon-name=spark-store --text "没有软件需要更新\n但是你并没有站在世界之巅" --title "星火商店更新检测服务" --height 150 --width 300
|
||||||
|
else
|
||||||
|
PKG_UPGRADE_LIST=`for PKG_NAME in $PKG_LIST;
|
||||||
|
do
|
||||||
|
#### 检测是否是hold状态
|
||||||
|
if [ "${dpkg-query -W -f='${Status}' $PKG_NAME | grep hold}" != "" ];then
|
||||||
|
echo "true"
|
||||||
|
echo "$PKG_NAME"
|
||||||
|
else
|
||||||
|
echo "false"
|
||||||
|
echo "$PKG_NAME (无法更新:请先执行 sudo apt-mark unhold 后再更新)"
|
||||||
|
fi
|
||||||
|
done | zenity --list --text="选择你想更新的应用" --column=是否更新 --column=应用包名 --separator=" " --checklist --print-column=2 --multiple --height 350 --width 550 `
|
||||||
|
|
||||||
|
#### 如果没有选择,则直接退出
|
||||||
|
|
||||||
for PKG_NAME in $PKG_LIST;
|
if [ "$PKG_UPGRADE_LIST" = "" ];then
|
||||||
do
|
zenity --info --icon-name=spark-store --text "没有选中任何软件\n但是你并没有站在世界之巅" --title "星火商店更新检测服务" --height 150 --width 300
|
||||||
echo "$PKG_NAME 正在更新..."
|
else
|
||||||
if sudo aptss install "$PKG_NAME" -y >/dev/null 2>&1;
|
sudo aptss install $PKG_UPGRADE_LIST -y
|
||||||
then
|
fi
|
||||||
echo "$PKG_NAME 已更新"
|
|
||||||
else
|
|
||||||
echo "WARNING: $PKG_NAME 无法更新"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
fi ###这是确定是否同意
|
|
||||||
@@ -68,8 +68,7 @@ case $option in
|
|||||||
2)
|
2)
|
||||||
echo "执行以下操作需要授权..."
|
echo "执行以下操作需要授权..."
|
||||||
sudo aptss ssupdate
|
sudo aptss ssupdate
|
||||||
/opt/durapps/spark-store/bin/update-upgrade/ss-upgrade-list.sh
|
sudo /opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade.sh
|
||||||
/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade.sh
|
|
||||||
echo "---请按回车返回"
|
echo "---请按回车返回"
|
||||||
read
|
read
|
||||||
reset
|
reset
|
||||||
|
|||||||
@@ -66,11 +66,23 @@ 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="$(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
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ $update_app_number -lt 1 ];then
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
#### 如果都是hold的那就直接退出,否则把剩余的给提醒了
|
||||||
|
|
||||||
notify-send -i spark-store "星火更新提醒" "星火商店仓库中有$update_app_number个软件包可以更新啦!请到星火商店的菜单处理"
|
notify-send -i spark-store "星火更新提醒" "星火商店仓库中有$update_app_number个软件包可以更新啦!请到星火商店的菜单处理"
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
|
|
||||||
echo "---可更新的应用有:"
|
|
||||||
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"
|
|
||||||
Reference in New Issue
Block a user