mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-13 12:22:05 +08:00
feat: aptss log enhance && upgrade-experience-enhance
This commit is contained in:
34
tool/aptss
34
tool/aptss
@@ -26,7 +26,17 @@ is_empty_dir(){
|
||||
return `ls -A $1|wc -w`
|
||||
}
|
||||
|
||||
function update_list(){
|
||||
curl --progress-bar -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "${SPARK_DOWNLOAD_SERVER_URL}/sparkstore${STORE_LIST_URL}.list"
|
||||
echo "sparkstore${STORE_LIST_URL}.list update done"
|
||||
}
|
||||
|
||||
function update_conf(){
|
||||
mkdir -p /tmp/aptss-conf/
|
||||
curl --progress-bar -o /tmp/aptss-conf/apt-fast.conf "${SPARK_DOWNLOAD_SERVER_URL}/apt-fast.conf"
|
||||
echo "apt-fast.conf update done"
|
||||
chmod -R 755 /tmp/aptss-conf
|
||||
}
|
||||
|
||||
if [ "$(id -u)" != "0" ];then
|
||||
#############################无root权限时
|
||||
@@ -46,8 +56,7 @@ if [ ! -e "/tmp/aptss-conf/apt-fast.conf" ];then
|
||||
mkdir -p /tmp/aptss-conf/
|
||||
echo -e "\e[1;32m${TRANSHELL_CONTENT_GETTING_SERVER_CONFIG_AND_MIRROR_LIST}\e[0m"
|
||||
echo
|
||||
curl --silent -o /tmp/aptss-conf/apt-fast.conf "${SPARK_DOWNLOAD_SERVER_URL}/apt-fast.conf"
|
||||
chmod -R 755 /tmp/aptss-conf
|
||||
update_conf
|
||||
|
||||
fi
|
||||
|
||||
@@ -57,11 +66,9 @@ if [ ! -e "/var/lib/aptss/lists/${SPARK_DOWNLOAD_SERVER_URL_NO_PROTOCOL}_${STORE
|
||||
mkdir -p /tmp/aptss-conf/
|
||||
echo -e "\e[1;32m${TRANSHELL_CONTENT_GETTING_SERVER_CONFIG_AND_MIRROR_LIST}\e[0m"
|
||||
echo
|
||||
curl --silent -o /tmp/aptss-conf/apt-fast.conf "${SPARK_DOWNLOAD_SERVER_URL}/apt-fast.conf"
|
||||
chmod -R 755 /tmp/aptss-conf
|
||||
|
||||
curl --silent -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "${SPARK_DOWNLOAD_SERVER_URL}/sparkstore${STORE_LIST_URL}.list"
|
||||
/usr/bin/apt update -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf
|
||||
update_list
|
||||
update_conf
|
||||
|
||||
#只更新星火源
|
||||
|
||||
@@ -93,12 +100,11 @@ elif [ "$1" = "ssupdate" ];then
|
||||
mkdir -p /tmp/aptss-conf/
|
||||
echo -e "\e[1;32m${TRANSHELL_CONTENT_GETTING_SERVER_CONFIG_AND_MIRROR_LIST}\e[0m"
|
||||
echo
|
||||
curl --silent -o /tmp/aptss-conf/apt-fast.conf "${SPARK_DOWNLOAD_SERVER_URL}/apt-fast.conf"
|
||||
chmod -R 755 /tmp/aptss-conf
|
||||
|
||||
curl --silent -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "${SPARK_DOWNLOAD_SERVER_URL}/sparkstore${STORE_LIST_URL}.list"
|
||||
|
||||
|
||||
|
||||
update_list
|
||||
update_conf
|
||||
|
||||
/usr/bin/apt update -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" -o Dir::Etc::sourcelist="/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list"
|
||||
|
||||
#只更新星火源
|
||||
@@ -107,10 +113,8 @@ elif [ "$1" = "update" ];then
|
||||
|
||||
echo -e "\e[1;32m${TRANSHELL_CONTENT_GETTING_SERVER_CONFIG_AND_MIRROR_LIST}\e[0m"
|
||||
echo
|
||||
curl --silent -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "${SPARK_DOWNLOAD_SERVER_URL}/sparkstore${STORE_LIST_URL}.list"
|
||||
mkdir -p /tmp/aptss-conf/
|
||||
curl --silent -o /tmp/aptss-conf/apt-fast.conf "${SPARK_DOWNLOAD_SERVER_URL}/apt-fast.conf"
|
||||
chmod -R 755 /tmp/aptss-conf
|
||||
update_list
|
||||
update_conf
|
||||
### 额外一份拿来给aptss自动补全用
|
||||
|
||||
${SS_APT_FAST} "$@" -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf
|
||||
|
||||
Reference in New Issue
Block a user