mirror of
https://github.com/LSPosed/MagiskOnWSALocal.git
synced 2025-04-18 06:29:09 +00:00
Add support for arch (#556)
* For Arch, confirm before any operation --------- Co-authored-by: Howard Wu <HowardWu20@outlook.com>
This commit is contained in:
parent
02862b2c65
commit
3d819b9ba5
2 changed files with 33 additions and 5 deletions
|
@ -8,10 +8,11 @@
|
|||
|
||||
The following dependencies are required:
|
||||
|
||||
| DistrOS | | | | |
|
||||
|:-------------------:|--------------------------------------------------------------------------------|------------|--------------|--------------------|
|
||||
| Debian | `lzip patchelf e2fsprogs python3 python3-pip aria2 p7zip-full attr unzip sudo` | `whiptail` | `qemu-utils` | `python3-venv` |
|
||||
| openSUSE Tumbleweed | Same as above | `dialog` | `qemu-tools` | `python3-venvctrl` |
|
||||
| DistrOS | | | | | | |
|
||||
|:-------------------:|---------------------------------------------------------|------------|--------------|--------------------|---------------|--------------|
|
||||
| Debian | `lzip patchelf e2fsprogs python3 aria2 attr unzip sudo` | `whiptail` | `qemu-utils` | `python3-venv` | `python3-pip` | `p7zip-full` |
|
||||
| openSUSE Tumbleweed | Same as above | `dialog` | `qemu-tools` | `python3-venvctrl` | Same as above |
|
||||
| Arch | Same as Debian | `libnewt` | `qemu-img` | Same as Debian | `python-pip` | `p7zip` |
|
||||
|
||||
The python3 library `requests` is used.
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ check_dependencies
|
|||
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/arch-release"]=pacman
|
||||
# os_pm_install["/etc/gentoo-release"]=emerge
|
||||
os_pm_install["/etc/SuSE-release"]=zypper
|
||||
os_pm_install["/etc/debian_version"]=apt-get
|
||||
|
@ -107,6 +107,22 @@ require_su
|
|||
if [ -z "$PM" ]; then
|
||||
echo "Unable to determine package manager: Unsupported distros"
|
||||
abort
|
||||
elif [ "$PM" = "pacman" ]; then
|
||||
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
|
||||
:
|
||||
done
|
||||
[[ $answer == [yY] ]] && answer=Yes || answer=No
|
||||
echo "$answer"
|
||||
case "$answer" in
|
||||
Yes)
|
||||
if ! ($SUDO "$PM" "${UPDATE_OPTION[@]}" ca-certificates); then abort; fi
|
||||
;;
|
||||
*)
|
||||
abort "Operation cancelled by user"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
if ! ($SUDO "$PM" "${UPDATE_OPTION[@]}" && $SUDO "$PM" "${UPGRADE_OPTION[@]}" ca-certificates); then abort; fi
|
||||
fi
|
||||
|
@ -127,6 +143,17 @@ if [ -n "${NEED_INSTALL[*]}" ]; then
|
|||
NEED_INSTALL_FIX=${NEED_INSTALL[*]}
|
||||
readarray -td ' ' NEED_INSTALL <<<"${NEED_INSTALL_FIX//p7zip-full/p7zip} "
|
||||
unset 'NEED_INSTALL[-1]'
|
||||
elif [ "$PM" = "pacman" ]; then
|
||||
NEED_INSTALL_FIX=${NEED_INSTALL[*]}
|
||||
{
|
||||
NEED_INSTALL_FIX=${NEED_INSTALL_FIX//whiptail/libnewt} 2>&1
|
||||
NEED_INSTALL_FIX=${NEED_INSTALL_FIX//qemu-utils/qemu-img} 2>&1
|
||||
NEED_INSTALL_FIX=${NEED_INSTALL_FIX//python3-pip/python-pip} 2>&1
|
||||
NEED_INSTALL_FIX=${NEED_INSTALL_FIX//p7zip-full/p7zip} 2>&1
|
||||
} >>/dev/null
|
||||
|
||||
readarray -td ' ' NEED_INSTALL <<<"$NEED_INSTALL_FIX "
|
||||
unset 'NEED_INSTALL[-1]'
|
||||
fi
|
||||
if ! ($SUDO "$PM" "${INSTALL_OPTION[@]}" "${NEED_INSTALL[@]}"); then abort; fi
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue