From f55c188e49c06e3fc9fb8805685cbd86360d0256 Mon Sep 17 00:00:00 2001 From: Sora Lee <25336289+soleera@users.noreply.github.com> Date: Tue, 24 Oct 2023 15:35:45 +0200 Subject: [PATCH] Add support for Gentoo (#625) - Avoid unneeded rebuilds by using `-U` instead of `-D` - Avoid adding ca-cetificates to @selected by using `-1` - Ensure aria2 is built with the `adns` USE flag - Use dialog instead of whiptail to limit dependencies --- scripts/install_deps.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/scripts/install_deps.sh b/scripts/install_deps.sh index f9363de..e0bd35b 100755 --- a/scripts/install_deps.sh +++ b/scripts/install_deps.sh @@ -55,7 +55,7 @@ osrel=$(sed -n '/^ID_LIKE=/s/^.*=//p' /etc/os-release) declare -A os_pm_install # os_pm_install["/etc/redhat-release"]=yum os_pm_install["/etc/arch-release"]=pacman -# os_pm_install["/etc/gentoo-release"]=emerge +os_pm_install["/etc/gentoo-release"]=emerge os_pm_install["/etc/SuSE-release"]=zypper os_pm_install["/etc/debian_version"]=apt-get # os_pm_install["/etc/alpine-release"]=apk @@ -63,7 +63,7 @@ os_pm_install["/etc/debian_version"]=apt-get declare -A PM_UPDATE_MAP PM_UPDATE_MAP["yum"]="check-update" PM_UPDATE_MAP["pacman"]="-Syu --noconfirm" -PM_UPDATE_MAP["emerge"]="-auDN @world" +PM_UPDATE_MAP["emerge"]="-auDU1 @world" PM_UPDATE_MAP["zypper"]="ref" PM_UPDATE_MAP["apt-get"]="update" PM_UPDATE_MAP["apk"]="update" @@ -105,7 +105,8 @@ require_su if [ -z "$PM" ]; then echo "Unable to determine package manager: Unsupported distros" abort -elif [ "$PM" = "pacman" ]; then +elif [[ "$PM" =~ pacman|emerge ]]; then + [ "$PM" = "emerge" ] && (sudo emerge -qoO aria2[adns] || abort) i=30 while ((i-- > 1)) && ! read -r -sn 1 -t 1 -p $'\r:: Proceed with full system upgrade? Cancel after '$i$'s.. [y/N]\e[0K ' answer; do @@ -149,6 +150,17 @@ if [ -n "${NEED_INSTALL[*]}" ]; then NEED_INSTALL_FIX=${NEED_INSTALL_FIX//p7zip-full/p7zip} 2>&1 } >>/dev/null + readarray -td ' ' NEED_INSTALL <<<"$NEED_INSTALL_FIX " + unset 'NEED_INSTALL[-1]' + elif [ "$PM" = "emerge" ]; then + NEED_INSTALL_FIX=${NEED_INSTALL[*]} + { + NEED_INSTALL_FIX=${NEED_INSTALL_FIX//whiptail/dialog} 2>&1 + NEED_INSTALL_FIX=${NEED_INSTALL_FIX//python3-pip/dev-python/pip} 2>&1 + NEED_INSTALL_FIX=${NEED_INSTALL_FIX//p7zip-full/p7zip} 2>&1 + NEED_INSTALL_FIX=${NEED_INSTALL_FIX//qemu-utils/qemu} 2>&1 + } >>/dev/null + readarray -td ' ' NEED_INSTALL <<<"$NEED_INSTALL_FIX " unset 'NEED_INSTALL[-1]' fi