From 9b5d4962a3882b4634f7d05eca45626f67fcd505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 8 Apr 2020 16:39:47 +0100 Subject: 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. --- subr/build_init.subr | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'subr') 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 -- cgit v1.2.3