* 修复: 420t1版本中ssinstall有时会重新下载软件包的问题

* 新增: 安装前会对软件包安装进行dry run以判断是否能正确安装

  * 调整: aptss在进行任何操作前均检测是否存在包文件

  * 调整: 修改apt-fast源代码以指定conf位置为/tmp/apt-fast,这部分不再使用bwrap模拟
This commit is contained in:
shenmo 2023-01-07 10:34:59 +08:00
parent f856060d3d
commit d4e84344c3
5 changed files with 41 additions and 16 deletions

5
debian/changelog vendored

@ -1,6 +1,9 @@
spark-store (4.2~test2) stable; urgency=medium
* 修复: 420t1版本中ssinstall有时会重新下载软件包的问题
* 新增: 安装前会对软件包安装进行dry run以判断是否能正确安装
* 调整: aptss在进行任何操作前均检测是否存在包文件
* 调整: 修改apt-fast源代码以指定conf位置为/tmp/apt-fast,这部分不再使用bwrap模拟
-- shenmo <shenmo@spark-app.store> Fri, 30 Jan 2022 00:00:00 +0800

@ -161,7 +161,8 @@ VERBOSE_OUTPUT=
_DOWNLOADER='aria2c --no-conf -c -j ${_MAXNUM} -x ${_MAXCONPERSRV} -s ${_SPLITCON} -i ${DLLIST} --min-split-size=${_MINSPLITSZ} --stream-piece-selector=${_PIECEALGO} --connect-timeout=600 --timeout=600 -m0'
# Load config file.
CONFFILE="/etc/apt-fast.conf"
CONFFILE="/tmp/aptss-conf/apt-fast.conf"
#### Spark Store apt-fast conf is in /tmp
if [ -e "$CONFFILE" ]; then
source "$CONFFILE"
fi

@ -14,42 +14,39 @@ chmod -R 755 /tmp/aptss-conf
fi
if [ "$1" = "install" ] || [ "$1" = "upgrade" ] || [ "$1" = "full-upgrade" ] ; then
if [ ! -e "/var/lib/apt/lists/d.store.deepinos.org.cn_Packages" ];then
if [ ! -e "/var/lib/apt/lists/d.store.deepinos.org.cn_Packages" ] && [ ! -e "/var/lib/apt/lists/d.store.deepinos.org.cn_store_Packages" ];then
echo "接收星火仓库软件信息中..."
aptss ssupdate
fi
SS_APT_FAST="/opt/durapps/spark-store/bin/apt-fast/ss-apt-fast"
if [ "$1" = "install" ] || [ "$1" = "upgrade" ] || [ "$1" = "full-upgrade" ] ; then
###执行
bwrap --dev-bind / / \
--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 \
/opt/durapps/spark-store/bin/apt-fast/ss-apt-fast "$@" --allow-downgrades
${SS_APT_FAST} "$@" --allow-downgrades
elif [ "$1" = "download" ];then
###执行
bwrap --dev-bind / / \
--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 \
/opt/durapps/spark-store/bin/apt-fast/ss-apt-fast "$@" --allow-downgrades
${SS_APT_FAST} "$@" --allow-downgrades
elif [ "$1" = "policy" ] || [ "$1" = "search" ];then
if [ ! -e "/var/lib/apt/lists/d.store.deepinos.org.cn_Packages" ];then
echo "接收星火仓库软件信息中..."
aptss ssupdate
fi
###执行
bwrap --dev-bind / / \
--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 \
apt "$@"

@ -28,6 +28,17 @@ fi
DEBPATH=`realpath $1`
echo ----------------------------------------------------------------------------------
try_run_output=$(aptss --dry-run install $DEBPATH)
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
dpkg -i "$DEBPATH" || aptss install -yf

@ -78,6 +78,19 @@ if [ ! -z "$IS_MD5SUM_CHECKD" ];then
echo "校验成功,开始安装"
echo ----------------------------------------------------------------------------------
try_run_output=$(aptss --dry-run install $DEBPATH)
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
dpkg -i "$DEBPATH" || aptss install -yf
else