mirror of
https://github.com/LSPosed/MagiskOnWSALocal.git
synced 2025-04-18 06:29:09 +00:00
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
This commit is contained in:
parent
34576beeb8
commit
f55c188e49
1 changed files with 15 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue