From 1aa81cefeb666b6a56abb477d1a2c319a957d9b2 Mon Sep 17 00:00:00 2001 From: LucĂ­a Andrea Illanes Albornoz Date: Feb 19 2023 13:23:40 +0000 Subject: subr.ex/ex_pkg.subr:ex_pkg_load_vars(): prepend ${PREFIX} w/ ${PWD%/}/ if not absolute pathname. --- diff --git a/build.sh b/build.sh index 0733a4f..3934c97 100755 --- a/build.sh +++ b/build.sh @@ -75,7 +75,7 @@ buildp_init() { "${_bi_rstatus}" "buildp_init_getopts_fn" \ "${_bi_optstring}" "${@}" \ || ! ex_init_logging "${_bi_rstatus}" \$ARG_VERBOSE_TAGS "${ARG_VERBOSE}" \ - || ! ex_pkg_load_vars "${_bi_rstatus}" \$ARCH \$BUILD_KIND \$PREFIX \ + || ! ex_pkg_load_vars "${_bi_rstatus}" \$ARCH \$BUILD_KIND \ || ! ex_init_prereqs "${_bi_rstatus}" "${DEFAULT_PREREQS}" \ || ! buildp_init_args "${_bi_rstatus}" \ || ! ex_init_files \ diff --git a/pkgtool.sh b/pkgtool.sh index 65a4a84..24f0233 100755 --- a/pkgtool.sh +++ b/pkgtool.sh @@ -30,7 +30,7 @@ pkgtoolp_init() { "${_pi_optstring}" "${@}" \ || ! ex_init_prereqs "${_pi_rstatus}" "${_pi_prereqs}" \ || ! ex_pkg_load_vars \ - "${_pi_rstatus}" \$ARCH \$BUILD_KIND \$PREFIX \ + "${_pi_rstatus}" \$ARCH \$BUILD_KIND \ || ! pkgtoolp_init_args "${_pi_rstatus}"; then _pi_rc=1; diff --git a/subr.ex/ex_pkg.subr b/subr.ex/ex_pkg.subr index c66c5ca..3e7ee82 100644 --- a/subr.ex/ex_pkg.subr +++ b/subr.ex/ex_pkg.subr @@ -103,13 +103,11 @@ ex_pkg_get_packages() { # @_rstatus: out reference to status string # @_rbuild_arch: in reference to build architecture # @_rbuild_kind: in reference to build kind -# @_rprefix: in reference to absolute pathname to top-level prefix # # Return: zero (0) on success, non-zero (>0) on failure, build variables post-return on success. # ex_pkg_load_vars() { - local _eplv_rstatus="${1#\$}" _eplv_rbuild_arch="${2#\$}" \ - _eplv_rbuild_kind="${3#\$}" _eplv_rprefix="${4#\$}" \ + local _eplv_rstatus="${1#\$}" _eplv_rbuild_arch="${2#\$}" _eplv_rbuild_kind="${3#\$}" \ _eplv_build_arch="" _eplv_rc=0 _eplv_fname=""; if ! rtl_lmatch "${_eplv_rbuild_arch}" "nt32 nt64"; then @@ -125,6 +123,10 @@ ex_pkg_load_vars() { nt64) DEFAULT_TARGET="x86_64-nt64-midipix"; ;; esac; + if [ "${PREFIX#/}" = "${PREFIX}" ]; then + PREFIX="${PWD%/}/${PREFIX}"; + fi; + for _eplv_fname in \ "${HOME}/midipix_build.vars" \ "${HOME}/.midipix_build.vars" \ @@ -135,11 +137,6 @@ ex_pkg_load_vars() { rtl_fileop source "${_eplv_fname}"; fi; done; - - if eval [ \"\${${_eplv_rprefix}:+1}\" != 1 ]; then - _eplv_rc=1; - rtl_setrstatus "${_eplv_rstatus}" '\${PREFIX} empty or unset.'; - fi; fi; return "${_eplv_rc}";