diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rwxr-xr-x | build.sh | 4 | ||||
-rwxr-xr-x | pkgtool.sh | 4 | ||||
-rw-r--r-- | subr.ex/ex_init.subr | 13 |
4 files changed, 17 insertions, 5 deletions
@@ -1,3 +1,4 @@ +etc/*.theme.host.* etc/*.theme.local .gdbhistory *.sw[op] @@ -78,7 +78,9 @@ buildp_init() { || ! ex_init_getopts \ "${_bi_rstatus}" "buildp_init_getopts_fn" \ "${_bi_optstring}" "${@}" \ - || ! ex_init_theme "${_bi_rstatus}" "${_bi_name_base}" "${ARG_THEME:-}" \ + || ! ex_init_theme \ + "${_bi_rstatus}" "${BUILD_HNAME}" \ + "${_bi_name_base}" "${ARG_THEME:-}" \ || ! ex_init_logging "${_bi_rstatus}" \$ARG_VERBOSE_TAGS "${ARG_VERBOSE}" \ || ! ex_pkg_load_vars "${_bi_rstatus}" \$ARCH \$BUILD_KIND \ || ! ex_init_prereqs "${_bi_rstatus}" "${DEFAULT_PREREQS}" \ @@ -33,8 +33,8 @@ pkgtoolp_init() { "${_pi_rstatus}" "pkgtoolp_init_getopts_fn" \ "${_pi_optstring}" "${@}" \ || ! ex_init_theme \ - "${_pi_rstatus}" "${_pi_name_base}" \ - "${ARG_THEME:-}" \ + "${_pi_rstatus}" "${BUILD_HNAME}" \ + "${_pi_name_base}" "${ARG_THEME:-}" \ || ! ex_init_prereqs "${_pi_rstatus}" "${_pi_prereqs}" \ || ! ex_pkg_load_vars \ "${_pi_rstatus}" \$ARCH \$BUILD_KIND \ diff --git a/subr.ex/ex_init.subr b/subr.ex/ex_init.subr index fcabce07..5d1035ad 100644 --- a/subr.ex/ex_init.subr +++ b/subr.ex/ex_init.subr @@ -410,16 +410,25 @@ ex_init_prereqs() { # # ex_init_theme() - initialise theme # @_rstatus: reference to out variable of status string on failure +# @_hname: build hostname # @_name_base: base name for theme file(s) # @_theme: theme name # # Return: zero (0) on success, non-zero (>0) on failure # ex_init_theme() { - local _eit_rstatus="${1#\$}" _eit_name_base="${2}" _eit_theme="${3}" \ + local _eit_rstatus="${1#\$}" _eit_hname="${2}" _eit_name_base="${3}" _eit_theme="${4}" \ _eit_rc=0 _eit_theme_fname=""; - _eit_theme_fname="etc/${_eit_name_base}${_eit_theme:+.${_eit_theme}}.theme"; + if [ "${_eit_theme:+1}" = 1 ]; then + _eit_theme_fname="etc/${_eit_name_base}.${_eit_theme}.theme"; + else + _eit_theme_fname="etc/${_eit_name_base}.theme.host.${_eit_hname}"; + if ! [ -e "${_eit_theme_fname}" ]; then + _eit_theme_fname="etc/${_eit_name_base}.theme"; + fi; + fi; + if ! [ -e "${_eit_theme_fname}" ]; then _eit_rc=1; exp_setrstatus "${_eit_rstatus}" 'failed to source \`'"${_eit_theme_fname}"''\''.'; |