From 5d4ac6f523ccf01ca32106ecdeb8252468cd002e Mon Sep 17 00:00:00 2001 From: shenmo Date: Mon, 28 Aug 2023 23:42:25 +0800 Subject: [PATCH] =?UTF-8?q?=20=20*=20=E4=BF=AE=E5=A4=8D=EF=BC=9Aaptss?= =?UTF-8?q?=E5=8A=A0=E9=94=81=E5=A4=B1=E8=B4=A5=E7=8E=B0=E5=9C=A8=E4=BC=9A?= =?UTF-8?q?=E6=AD=A3=E5=B8=B8=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 新增:在aptss的特定操作时添加了提示 * 新增:在aptss提示加粗 --- debian/changelog | 9 ++++++++ .../aptss/transhell/aptss_en_US.transhell | 1 + .../aptss/transhell/aptss_zh_CN.transhell | 1 + tool/aptss | 23 +++++++++++-------- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index e98c87f..ada0027 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +spark-store (4.2.7.1) stable; urgency=medium + + * 修复:aptss加锁失败现在会正常报错 + * 新增:在aptss的特定操作时添加了提示 + * 新增:在aptss提示加粗 + + -- shenmo Sun, 5 Mar 2022 11:45:14 +0800 + + spark-store (4.2.7) stable; urgency=medium * 修复:更新星火商店后禁止更新提醒的配置失效 diff --git a/pkg/usr/share/aptss/transhell/aptss_en_US.transhell b/pkg/usr/share/aptss/transhell/aptss_en_US.transhell index 28a9715..4178521 100644 --- a/pkg/usr/share/aptss/transhell/aptss_en_US.transhell +++ b/pkg/usr/share/aptss/transhell/aptss_en_US.transhell @@ -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="INFO:sources.list.d directory is empty,will 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\")." diff --git a/pkg/usr/share/aptss/transhell/aptss_zh_CN.transhell b/pkg/usr/share/aptss/transhell/aptss_zh_CN.transhell index 1f16da5..8e51569 100644 --- a/pkg/usr/share/aptss/transhell/aptss_zh_CN.transhell +++ b/pkg/usr/share/aptss/transhell/aptss_zh_CN.transhell @@ -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)." diff --git a/tool/aptss b/tool/aptss index 21a6ae5..518e6eb 100755 --- a/tool/aptss +++ b/tool/aptss @@ -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自动补全用