支持在安装前进行测试(ss-do-upgrade-worker)

用法:pkexec /opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh test-install-app pkgname
This commit is contained in:
2023-01-20 00:15:24 +08:00
parent 19a1ba4289
commit 384d4b300d
3 changed files with 23 additions and 1 deletions

View File

@@ -32,6 +32,21 @@ case $1 in
IS_UPGRADE_ERROR=`cat /tmp/spark-store-app-upgrade-log.txt | grep "Package manager quit with exit code."`
echo "$IS_UPGRADE_ERROR" > /tmp/spark-store-app-upgrade-status.txt
;;
test-install-app)
try_run_output=$(aptss --dry-run install $@)
try_run_ret="$?"
if [ "$try_run_ret" -ne 0 ]
then
echo "Package manager quit with exit code.Here is the log"
echo "包管理器以错误代码退出.日志如下"
echo
echo -e "${try_run_output}"
exit "$try_run_ret"
fi
exit 0
;;
clean-log)
rm -f /tmp/spark-store-app-ssupdate-status.txt /tmp/spark-store-app-ssupdate-log.txt /tmp/spark-store-app-upgrade-log.txt /tmp/spark-store-app-upgrade-status.txt