From 80e4bcbf90ebfef9af2d63da9f07533f9dff3c63 Mon Sep 17 00:00:00 2001 From: oddlama Date: Sat, 29 May 2021 22:59:38 +0200 Subject: [PATCH] make pacman package mapping associative --- scripts/utils.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/utils.sh b/scripts/utils.sh index db326d4..8bdfc9d 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -333,10 +333,11 @@ function check_has_programs() { && return echo "The following programs are required for the installer to work, but are currently missing on your system:" >&2 - echo " ${failed[@]}" >&2 + echo " ${failed[*]}" >&2 if type pacman &>/dev/null; then - local pacman_packages=( + declare -A pacman_packages + pacman_packages=( [ntpd]=openntpd [zfs]="" ) @@ -345,7 +346,7 @@ function check_has_programs() { local packages local need_zfs=false for program in "${failed[@]}"; do - if [[ -v pacman_packages[$program] ]]; then + if [[ -v "pacman_packages[$program]" ]]; then packages+=("$program") else # Assignments to the empty string are explcitly ignored,