diff --git a/docs/README.md b/docs/README.md index f5afc72..43143b5 100644 --- a/docs/README.md +++ b/docs/README.md @@ -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. diff --git a/scripts/install_deps.sh b/scripts/install_deps.sh index a8ad62a..0261d19 100755 --- a/scripts/install_deps.sh +++ b/scripts/install_deps.sh @@ -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