summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLucía Andrea Illanes Albornoz <lucia@luciaillanes.de>2023-02-19 14:23:40 +0100
committerLucía Andrea Illanes Albornoz <lucia@luciaillanes.de>2023-02-19 14:23:40 +0100
commit1aa81cefeb666b6a56abb477d1a2c319a957d9b2 (patch)
tree19348b69d629eb798328275c4ab8ee2ef8bab317
parent4b1007106488bc46d8e68ffeab1c84eb27bd6d86 (diff)
downloadmidipix_build-1aa81cefeb666b6a56abb477d1a2c319a957d9b2.tar.bz2
midipix_build-1aa81cefeb666b6a56abb477d1a2c319a957d9b2.tar.xz
subr.ex/ex_pkg.subr:ex_pkg_load_vars(): prepend ${PREFIX} w/ ${PWD%/}/ if not absolute pathname.
-rwxr-xr-xbuild.sh2
-rwxr-xr-xpkgtool.sh2
-rw-r--r--subr.ex/ex_pkg.subr13
3 files changed, 7 insertions, 10 deletions
diff --git a/build.sh b/build.sh
index 0733a4f8..3934c971 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 65a4a84a..24f0233b 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 c66c5ca2..3e7ee829 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}";