From 3510865ca124561cd8851572bfed02fc3c119b69 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Sat, 23 Nov 2024 23:50:13 +0800 Subject: [PATCH] =?UTF-8?q?debian:=20=E4=BC=98=E5=8C=96=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=20Priority=20=E7=9A=84=E9=80=9F=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reinstall.sh | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/reinstall.sh b/reinstall.sh index 5ffb313..81f3fcd 100644 --- a/reinstall.sh +++ b/reinstall.sh @@ -2725,28 +2725,27 @@ mod_initrd_debian_kali() { get_ip_conf_cmd | insert_into_file $postinst after ": get_ip_conf_cmd" # cat $postinst - # shellcheck disable=SC2317 change_priority() { while IFS= read -r line; do - key_=$(echo "$line" | cut -d' ' -f1) - value=$(echo "$line" | cut -d' ' -f2-) + if [[ "$line" = Package:* ]]; then + package=$(echo "$line" | cut -d' ' -f2-) - case "$key_" in - Package:) - package="$value" - ;; - Priority:) + elif [[ "$line" = Priority:* ]]; then # shellcheck disable=SC2154 - if [ "$value" = standard ] && echo "$disabled_list" | grep -qx "$package"; then - line="Priority: optional" + if [ "$line" = "Priority: standard" ]; then + for p in $disabled_list; do + if [ "$package" = "$p" ]; then + line="Priority: optional" + break + fi + done elif [[ "$package" = ata-modules* ]]; then # 改成强制安装 # 因为是 pata-modules sata-modules scsi-modules 的依赖 # 但我们没安装它们,也就不会自动安装 ata-modules line="Priority: standard" fi - ;; - esac + fi echo "$line" done }