From 89979ec02fa99ab716223b85a88b8d91dd16ffb9 Mon Sep 17 00:00:00 2001 From: Jessie Hildebrandt Date: Fri, 2 Jun 2023 13:42:47 -0400 Subject: [PATCH] Reorganize feature-based pattern installation --- opensuse-personalizer.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/opensuse-personalizer.sh b/opensuse-personalizer.sh index 779bdb1..a6c6d7f 100755 --- a/opensuse-personalizer.sh +++ b/opensuse-personalizer.sh @@ -260,7 +260,7 @@ detected_features=() # Mobile system detection case "${system_chassis}" in "latop"|"convertible"|"tablet") - PATTERNS+=('patterns-desktop-mobile') + detected_features+=('Mobile') ;; esac @@ -269,7 +269,7 @@ CPU_FLAGS=$(cat /proc/cpuinfo | grep flags | head -n 1 | cut -d: -f2) if echo CPU_FLAGS | awk '/avx/&&/avx2/&&/bmi1/&&/bmi2/&&/f16c/&&/fma/&&/abm/&&/movbe/&&/xsave/ {found=1} END {exit !found}' then - PATTERNS+=('patterns-glibc-hwcaps-x86_64_v3') + detected_features+=('x86-64-v3') fi # Touchpad detection @@ -296,7 +296,15 @@ fi # Package operations echo "Setting up packages..." + sudo zypper --non-interactive in ${PATTERNS[@]} +if [[ "${detected_features[@]}" == *"Mobile"* ]]; then + sudo zypper in patterns-desktop-mobile +fi +if [[ "${detected_features[@]}" == *"x86-64-v3"* ]]; then + sudo zypper in patterns-glibc-hwcaps-x86_64_v3 +fi + sudo zypper --non-interactive rm ${RM[@]} ${AL[@]} sudo zypper --non-interactive al ${AL[@]} sudo zypper --non-interactive in ${IN[@]}