Skip to content

Commit

Permalink
Add support for Gentoo (#625)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
soleera authored Oct 24, 2023
1 parent 34576be commit f55c188
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions scripts/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ 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

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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f55c188

Please sign in to comment.