feat: 彻底抛弃bwrap,提升aptss响应速度。现已可将aptss当apt用

This commit is contained in:
2023-03-06 21:45:12 +08:00
parent aa85ee53a8
commit 9a7a80223a
8 changed files with 43 additions and 34 deletions

View File

@@ -37,7 +37,7 @@ curl --silent -o /tmp/aptss-conf/apt-fast.conf "https://d.store.deepinos.org.c
chmod -R 755 /tmp/aptss-conf
sudo curl --silent -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "https://d.store.deepinos.org.cn/sparkstore${STORE_LIST_URL}.list"
sudo 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 update -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
sudo apt update -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf
#只更新星火源
@@ -53,17 +53,15 @@ if [ "$1" = "install" ] || [ "$1" = "upgrade" ] || [ "$1" = "full-upgrade" ] ;
###执行
bwrap --dev-bind / / \
--bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list \
${SS_APT_FAST} "$@" --allow-downgrades
${SS_APT_FAST} "$@" --allow-downgrades -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf
elif [ "$1" = "download" ];then
###执行
bwrap --dev-bind / / \
--bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list \
${SS_APT_FAST} "$@" --allow-downgrades
${SS_APT_FAST} "$@" --allow-downgrades -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf
elif [ "$1" = "policy" ] || [ "$1" = "search" ];then
@@ -71,9 +69,7 @@ elif [ "$1" = "policy" ] || [ "$1" = "search" ];then
###执行
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 "$@"
apt "$@" -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf
elif [ "$1" = "ssupdate" ];then
@@ -85,7 +81,8 @@ curl --silent -o /tmp/aptss-conf/apt-fast.conf "https://d.store.deepinos.org.c
chmod -R 755 /tmp/aptss-conf
sudo curl --silent -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "https://d.store.deepinos.org.cn/sparkstore${STORE_LIST_URL}.list"
sudo 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 update -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
sudo cp -r /var/lib/apt/lists/* /var/lib/aptss/lists/
sudo apt update -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
#只更新星火源
@@ -100,18 +97,10 @@ echo
curl --progress-bar -o /tmp/aptss-conf/apt-fast.conf "https://d.store.deepinos.org.cn/apt-fast.conf"
chmod -R 755 /tmp/aptss-conf
### 额外一份拿来给aptss自动补全用
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 "$@" -o APT::Get::List-Cleanup="0"
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 "$@" -o APT::Get::List-Cleanup="0" -o Dir::Cache="/etc/aptss/"
apt "$@" -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf
else
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 "$@"
apt "$@" -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf
fi