From faaa22877bf2317b366a5c65b6d312e5246d9a51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 20 Feb 2020 16:27:17 +0100 Subject: subr/build_init.subr:buildp_init_prereqs(): print missing prerequisite package(s). --- subr/build_init.subr | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/subr/build_init.subr b/subr/build_init.subr index 0fe59ba0..163e0c2a 100644 --- a/subr/build_init.subr +++ b/subr/build_init.subr @@ -160,14 +160,19 @@ buildp_init_getopts() { }; buildp_init_prereqs() { - local _rc=0; _status=""; - if ! which \ + local _cmd="" _cmds_missing="" _rc=0; _status=""; + for _cmd in \ awk bunzip2 cat chmod cp date find flock git \ grep gunzip gzip hostname install kill ln lzip \ make mkdir mkfifo mv paste patch pgrep pkill \ printf readlink rm sed seq sha256sum sort stat \ - tail tar test touch tr wget xz >/dev/null; then - _rc=4; _status="Error: missing prerequisite package(s)."; + tail tar test touch tr wget xz; do + if ! which "${_cmd}" >/dev/null; then + _cmds_missing="${_cmds_missing:+${_cmds_missing} }${_cmd}"; + fi; + done; + if [ -n "${_cmds_missing}" ]; then + _rc=4; _status="Error: missing prerequisite package(s): ${_cmds_missing}"; elif ! awk -V 2>/dev/null | grep -q "^GNU Awk "; then _rc=5; _status="Error: awk(1) in \$PATH must be GNU Awk."; elif ! sed --version 2>/dev/null | grep -q "^GNU sed "; then -- cgit v1.2.3