* 修复:aptss加锁失败现在会正常报错

* 新增:在aptss的特定操作时添加了提示

  * 新增:在aptss提示加粗
This commit is contained in:
shenmo 2023-08-28 23:42:25 +08:00
parent 29869dbb9d
commit 5d4ac6f523
4 changed files with 24 additions and 10 deletions

9
debian/changelog vendored
View File

@ -1,3 +1,12 @@
spark-store (4.2.7.1) stable; urgency=medium
* 修复aptss加锁失败现在会正常报错
* 新增在aptss的特定操作时添加了提示
* 新增在aptss提示加粗
-- shenmo <shenmo@spark-app.store> Sun, 5 Mar 2022 11:45:14 +0800
spark-store (4.2.7) stable; urgency=medium
* 修复:更新星火商店后禁止更新提醒的配置失效

View File

@ -2,3 +2,4 @@
TRANSHELL_CONTENT_RUNNING_IN_NOT_ROOT_USER="W:Running in non-root mode! If error occurs, please try to excute me as root."
TRANSHELL_CONTENT_INFO_SOURCES_LIST_D_IS_EMPTY="INFOsources.list.d directory is emptywill not try to sync"
TRANSHELL_CONTENT_GETTING_SERVER_CONFIG_AND_MIRROR_LIST="Getting server and mirror lists..."
TRANSHELL_CONTENT_PLEASE_USE_APTSS_INSTEAD_OF_APT="Please note: Although the error message suggests using \"apt\" (such as \"apt install --fix-broken\"), please use \"aptss\" instead of \"apt\" when troubleshooting errors (for example, change to \"aptss install --fix-broken\")."

View File

@ -2,3 +2,4 @@
TRANSHELL_CONTENT_RUNNING_IN_NOT_ROOT_USER="警告正在使用非root权限模式启动若出现问题请尝试使用root权限执行指令"
TRANSHELL_CONTENT_INFO_SOURCES_LIST_D_IS_EMPTY="信息sources.list.d文件夹是空的将不会尝试同步"
TRANSHELL_CONTENT_GETTING_SERVER_CONFIG_AND_MIRROR_LIST="从服务器获取配置和镜像列表..."
TRANSHELL_CONTENT_PLEASE_USE_APTSS_INSTEAD_OF_APT="注意尽管报错信息中提示使用apt如apt install --fix-broken),请在排查错误的时候使用aptss而不是apt(对于例子,改为使用 aptss install --fix-broken)."

View File

@ -24,7 +24,7 @@ is_empty_dir(){
if [ "$(id -u)" != "0" ];then
#############################无root权限时
echo "${TRANSHELL_CONTENT_RUNNING_IN_NOT_ROOT_USER}"
echo -e "\e[1;32m${TRANSHELL_CONTENT_RUNNING_IN_NOT_ROOT_USER}\e[0m"
else
@ -38,7 +38,7 @@ fi
if [ ! -e "/tmp/aptss-conf/apt-fast.conf" ];then
###刷新apt-fast配置
mkdir -p /tmp/aptss-conf/
echo "${TRANSHELL_CONTENT_GETTING_SERVER_CONFIG_AND_MIRROR_LIST}"
echo -e "\e[1;32m${TRANSHELL_CONTENT_GETTING_SERVER_CONFIG_AND_MIRROR_LIST}\e[0m"
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
@ -49,7 +49,7 @@ fi
if [ ! -e "/var/lib/aptss/lists/d.spark-app.store_${STORE_URL}_Packages" ] && [ ! -e "/var/lib/aptss/lists/d.store.deepinos.org.cn_${STORE_URL}_Packages" ] && [ ! -e "/var/lib/aptss/lists/mirrors.sdu.edu.cn_spark-store-repository_${STORE_URL}_Packages" ];then
mkdir -p /tmp/aptss-conf/
echo "${TRANSHELL_CONTENT_GETTING_SERVER_CONFIG_AND_MIRROR_LIST}"
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 "https://d.store.deepinos.org.cn/apt-fast.conf"
chmod -R 755 /tmp/aptss-conf
@ -73,7 +73,12 @@ if [ "$1" = "install" ] || [ "$1" = "upgrade" ] || [ "$1" = "full-upgrade" ] ;
###执行
${SS_APT_FAST} "$@" --allow-downgrades -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf
EXIT_CODE=$?
if [ "$EXIT_CODE" != "0" ];then
echo -e "\e[1;33m$TRANSHELL_CONTENT_PLEASE_USE_APTSS_INSTEAD_OF_APT\e[0m"
exit
fi
unset EXIT_CODE
elif [ "$1" = "download" ];then
@ -92,7 +97,7 @@ elif [ "$1" = "policy" ] || [ "$1" = "search" ];then
elif [ "$1" = "ssupdate" ];then
mkdir -p /tmp/aptss-conf/
echo "${TRANSHELL_CONTENT_GETTING_SERVER_CONFIG_AND_MIRROR_LIST}"
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 "https://d.store.deepinos.org.cn/apt-fast.conf"
chmod -R 755 /tmp/aptss-conf
@ -105,12 +110,10 @@ apt update -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf -o Dir::
#只更新星火源
elif [ "$1" = "update" ];then
curl --progress-bar -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"
mkdir -p /tmp/aptss-conf/
echo "${TRANSHELL_CONTENT_GETTING_SERVER_CONFIG_AND_MIRROR_LIST}"
echo -e "\e[1;32m${TRANSHELL_CONTENT_GETTING_SERVER_CONFIG_AND_MIRROR_LIST}\e[0m"
echo
curl --progress-bar -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"
mkdir -p /tmp/aptss-conf/
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自动补全用