diff --git a/configure b/configure index f99665f..ccd8e44 100755 --- a/configure +++ b/configure @@ -44,7 +44,7 @@ while [[ $# -gt 0 ]]; do shift done -check_has_programs dialog ncurses +check_has_programs dialog ncurses=ncursesw6-config # Wrap dialog in two functions to prevent it from cluttering stderr. function dialog_wrapper() { dialog_out=$(command dialog --colors "$@" 3>&2 2>&1 1>&3 3>&-); } diff --git a/scripts/utils.sh b/scripts/utils.sh index 80d601f..5d5447a 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -331,10 +331,22 @@ function parse_arguments() { function check_has_programs() { local failed=() + local tuple local program - for program in "$@"; do - type "$program" &>/dev/null \ - || failed+=("$program") + local checkfile + for tuple in "$@"; do + program="${tuple%%=*}" + checkfile="${tuple##*=}" + if [[ -z "$checkfile" ]]; then + type "$program" &>/dev/null \ + || failed+=("$program") + elif [[ "${checkfile:0:1}" == "/" ]] + [[ -e "$checkfile" ]] \ + || failed+=("$program") + else + type "$checkfile" &>/dev/null \ + || failed+=("$program") + fi done [[ "${#failed[@]}" -eq 0 ]] \