Fix OpenSUSE need install package

This commit is contained in:
Howard Wu 2022-09-23 17:18:19 +08:00
parent 0e31e695b3
commit 2564ad0387

View File

@ -102,12 +102,13 @@ if [ -n "${NEED_INSTALL[*]}" ]; then
abort abort
else else
if [ "$PM" = "zypper" ]; then if [ "$PM" = "zypper" ]; then
NEED_INSTALL=${NEED_INSTALL[*]} NEED_INSTALL_FIX=${NEED_INSTALL[*]}
readarray -td ' ' NEED_INSTALL <<<"${NEED_INSTALL//setools/setools-console} "; unset 'NEED_INSTALL[-1]'; NEED_INSTALL_FIX=${NEED_INSTALL_FIX//setools/setools-console} >> /dev/null 2>&1
readarray -td ' ' NEED_INSTALL <<<"${NEED_INSTALL//whiptail/dialog} "; unset 'NEED_INSTALL[-1]'; NEED_INSTALL_FIX=${NEED_INSTALL_FIX//whiptail/dialog} >> /dev/null 2>&1
readarray -td ' ' NEED_INSTALL <<<"$NEED_INSTALL_FIX "; unset 'NEED_INSTALL[-1]';
elif [ "$PM" = "apk" ]; then elif [ "$PM" = "apk" ]; then
NEED_INSTALL=${NEED_INSTALL[*]} NEED_INSTALL_FIX=${NEED_INSTALL[*]}
readarray -td ' ' NEED_INSTALL <<<"${NEED_INSTALL//p7zip-full/p7zip} "; unset 'NEED_INSTALL[-1]'; readarray -td ' ' NEED_INSTALL <<<"${NEED_INSTALL_FIX//p7zip-full/p7zip} "; unset 'NEED_INSTALL[-1]';
fi fi
require_su require_su
if ! ($SUDO "$PM" "${UPDATE_OPTION[@]}" && $SUDO "$PM" "${INSTALL_OPTION[@]}" "${NEED_INSTALL[@]}") then abort; fi if ! ($SUDO "$PM" "${UPDATE_OPTION[@]}" && $SUDO "$PM" "${INSTALL_OPTION[@]}" "${NEED_INSTALL[@]}") then abort; fi