diff options
author | Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de> | 2020-04-08 16:39:47 +0100 |
---|---|---|
committer | Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de> | 2020-04-08 16:39:47 +0100 |
commit | 9b5d4962a3882b4634f7d05eca45626f67fcd505 (patch) | |
tree | e062aa7c853e97752ebde72b96ca0b881c2485ab /subr | |
parent | b03d3cc271d6c91e2d64adeb6b7ed742fa26066e (diff) | |
download | midipix_build-9b5d4962a3882b4634f7d05eca45626f67fcd505.tar.bz2 midipix_build-9b5d4962a3882b4634f7d05eca45626f67fcd505.tar.xz |
subr/build_init.subr:buildp_init_args(): move ${BUILD_HNAME} check & default from buildp_init_env().
midipix.env:${DEFAULT_CLEAR_ENV_VARS_EXCEPT}: adds BUILD_HNAME.
etc/README.md: updated.
Diffstat (limited to 'subr')
-rw-r--r-- | subr/build_init.subr | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/subr/build_init.subr b/subr/build_init.subr index 668c0861..48e4fcf3 100644 --- a/subr/build_init.subr +++ b/subr/build_init.subr @@ -4,7 +4,10 @@ buildp_init_args() { local _group="" _last_pkg="" _pkg_names_unknown="" _rc=0; _status=""; - if [ "${ARG_DUMP_ON_ABORT:-0}" -eq 1 ]\ + if [ -z "${BUILD_HNAME:-}" ]\ + && ! BUILD_HNAME="$(hostname)"; then + _rc=1; _status="Error: failed to obtain hostname."; + elif [ "${ARG_DUMP_ON_ABORT:-0}" -eq 1 ]\ && [ "${ARG_RELAXED:-0}" -eq 1 ]; then _rc=1; _status="Error: --dump-on-abort excludes -R."; elif [ "${ARG_AS_NEEDED:-0}" -eq 1 ]\ @@ -90,8 +93,6 @@ buildp_init_env() { printf "Error: failed to change working directory to \`${0%/*}'." >&2; exit 1; elif ! umask 022; then printf "Error: failed to set umask(2).\n" >&2; exit 1; - elif ! BUILD_HNAME="$(hostname)"; then - printf "Error: failed to obtain hostname." >&2; exit 1; elif ! BUILD_USER="$(id -nu)"; then printf "Error: failed to obtain username." >&2; exit 1; else for _fname in $(find subr -name *.subr); do |