Arch pacman package name remappings and zfs installation script

This commit is contained in:
oddlama 2021-05-29 22:56:32 +02:00
parent 1b7fc257e2
commit 762c879497
No known key found for this signature in database
GPG Key ID: 14EFE510775FE39A
1 changed files with 26 additions and 1 deletions

View File

@ -336,9 +336,34 @@ function check_has_programs() {
echo " ${failed[@]}" >&2 echo " ${failed[@]}" >&2
if type pacman &>/dev/null; then if type pacman &>/dev/null; then
local pacman_packages=(
[ntpd]=openntpd
[zfs]=""
)
echo "We have detected that pacman is available." echo "We have detected that pacman is available."
if ask "Do you want to install the missing programs automatically?"; then if ask "Do you want to install the missing programs automatically?"; then
pacman -Sy "${failed[@]}" local packages
local need_zfs=false
for program in "${failed[@]}"; do
if [[ -v pacman_packages[$program] ]]; then
packages+=("$program")
else
# Assignments to the empty string are explcitly ignored,
# as for example zfs needs to be handeled separately.
[[ -n "${pacman_packages[$program]}" ]] \
&& packages+=("${pacman_packages[$program]}")
fi
done
pacman -Sy "${packages[@]}"
if [[ "$need_zfs" == true ]]; then
echo "On an Arch live-stick you need the archzfs repository and some tools and modifications to use zfs."
echo "There is an automated installer available at https://eoli3n.github.io/archzfs/init."
if ask "Do you want to automatically download and execute this zfs installation script?"; then
curl -s "https://eoli3n.github.io/archzfs/init" | bash
fi
fi
return return
fi fi
fi fi