diff options
author | Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de> | 2020-03-04 15:37:39 +0000 |
---|---|---|
committer | Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de> | 2020-03-04 16:27:57 +0000 |
commit | 6d9a3c055659820ad044fe8c4de07b8c194c8441 (patch) | |
tree | 360ecc76e2dd9261f491031617ec05c64a2bdd69 /subr | |
parent | 776d3c5cc2bef32615611902f2aa125cbd95b7f1 (diff) | |
download | midipix_build-6d9a3c055659820ad044fe8c4de07b8c194c8441.tar.bz2 midipix_build-6d9a3c055659820ad044fe8c4de07b8c194c8441.tar.xz |
subr/build_init.subr:buildp_init_env(): source subr/*.subr as early as possible (via duvallj.)
subr/build_init.subr:buildp_init_env(): correctly emit errors & exit given early initialisation failure.
etc/README.md: updated.
Diffstat (limited to 'subr')
-rw-r--r-- | subr/build_init.subr | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/subr/build_init.subr b/subr/build_init.subr index 42a5328e..b5867fba 100644 --- a/subr/build_init.subr +++ b/subr/build_init.subr @@ -74,8 +74,13 @@ buildp_init_defaults() { buildp_init_env() { local _cmd="" _cmds_missing="" _fname="" _rc=0; _status=""; if ! cd "$(dirname "${0}")" || ! umask 022; then - _rc=1; _status="Error: failed to setup environment"; - else for _cmd in \ + printf "Error: failed to setup environment.\n"; exit 1; + else for _fname in $(find subr -name *.subr); do + if ! . "${_fname}"; then + printf "Error: failed to source \`%s'.\n" "${_fname}"; exit 1; + fi; + done; + for _cmd in \ awk bunzip2 cat chmod cmake cp date find flock g++ \ gcc git grep gunzip gzip hostname install kill \ ln lzip make mkdir mkfifo mv paste patch perl \ @@ -91,11 +96,7 @@ buildp_init_env() { _rc=1; _status="Error: awk(1) in \$PATH must be GNU Awk."; elif ! sed --version 2>/dev/null | grep -q "^GNU sed "; then _rc=1; _status="Error: sed(1) in \$PATH must be GNU sed."; - else for _fname in $(find subr -name *.subr); do - if ! . "${_fname}"; then - _rc=1; _status="Error: failed to source \`${_fname}'."; break; - fi; - done; fi; + fi; fi; return "${_rc}"; }; |