diff --git a/etc/README.md b/etc/README.md index 36feae9..149a55b 100644 --- a/etc/README.md +++ b/etc/README.md @@ -410,6 +410,7 @@ env ARCH=nt64 BUILD=release PREFIX_ROOT="${HOME}/midipix_tmp" ./build.sh -D mini | ARCH | nt64 | Target 32-bit (nt32) or 64-bit (nt64) architecture | | BUILD | debug | Build w/ debugging (debug) or release compiler flags | | BUILD_DLCACHEDIR | ${PREFIX_ROOT}/dlcache | Absolute pathname to package downloads cache root directory | +| BUILD_HNAME | $(hostname) | Build system hostname | | BUILD_WORKDIR | ${PREFIX}/tmp | Absolute pathname to temporary package build root directory | | PREFIX | ${PREFIX_ROOT}/${ARCH}/${BUILD} | Absolute pathname to architecture- & build type-specific build root directory | | PREFIX_CROSS | ${PREFIX}/${DEFAULT_TARGET} | Absolute pathname to toolchain root directory | diff --git a/midipix.env b/midipix.env index 15ede3c..3dfaec7 100644 --- a/midipix.env +++ b/midipix.env @@ -43,8 +43,8 @@ DEFAULT_BUILD_VARS=" : ${DEFAULT_CHECK_PATH_VARS:="PREFIX PREFIX_NATIVE PREFIX_CROSS BUILD_DLCACHEDIR BUILD_WORKDIR"}; : ${DEFAULT_CLEAR_ENV_VARS_EXCEPT:=" HOME PATH TERM USER \ - ARCH BUILD - BUILD_DLCACHEDIR BUILD_WORKDIR + ARCH BUILD \ + BUILD_DLCACHEDIR BUILD_HNAME BUILD_WORKDIR \ PREFIX PREFIX_CROSS PREFIX_MINGW32 PREFIX_MINIPIX PREFIX_NATIVE PREFIX_ROOT PREFIX_RPM"}; : ${DEFAULT_CLEAR_PREFIX_PATHS:=" bin i686-nt32-midipix doc include info lib lib64 libexec man minipix minipix_dist native diff --git a/subr/build_init.subr b/subr/build_init.subr index 668c086..48e4fcf 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