summaryrefslogtreecommitdiffhomepage
path: root/subr.ex
diff options
context:
space:
mode:
authorLucía Andrea Illanes Albornoz <lucia@luciaillanes.de>2023-03-28 12:47:20 +0200
committerLucía Andrea Illanes Albornoz <lucia@luciaillanes.de>2023-03-28 12:47:20 +0200
commit34eeaf1a6548710a7f9496be2e4ca71acb0c6be2 (patch)
tree52855174b02e2fb6fdf148bf495aa9599590508b /subr.ex
parent07bfbd1de0220f6e4ee4078e92e630e1cae7465c (diff)
downloadmidipix_build-34eeaf1a6548710a7f9496be2e4ca71acb0c6be2.tar.bz2
midipix_build-34eeaf1a6548710a7f9496be2e4ca71acb0c6be2.tar.xz
Fix printing of package variables in ./pkgtool.sh -i.
Diffstat (limited to 'subr.ex')
-rw-r--r--subr.ex/ex_pkg.subr23
1 files changed, 23 insertions, 0 deletions
diff --git a/subr.ex/ex_pkg.subr b/subr.ex/ex_pkg.subr
index 6f326e1b..c064b408 100644
--- a/subr.ex/ex_pkg.subr
+++ b/subr.ex/ex_pkg.subr
@@ -158,6 +158,29 @@ ex_pkg_get_packages() {
};
#
+# ex_pkg_get_package_vars() - get package variable names
+# @_rpkg_vnames: out reference to package variable names variable
+# @_build_vars_default: list of default build variables
+# @_pkg_name: single package name
+#
+# Returns: zero (0) on success, non-zero (>0) on failure, list of package names on stdout on success.
+#
+ex_pkg_get_package_vars() {
+ local _epgpv_rpkg_vnames="${1#\$}" _epgpv_build_vars_default="${2}" _epgpv_pkg_name="${3}" \
+ _epgpv_pkg_name_uc="" _epgpv_vname="" _epgpv_vnames="";
+ rtl_toupper2 \$_epgpv_pkg_name \$_epgpv_pkg_name_uc;
+
+ for _epgpv_vname in ${_epgpv_build_vars_default}; do
+ if eval [ \"\${PKG_${_epgpv_pkg_name_uc}_${_epgpv_vname}:+1}\" = 1 ]; then
+ rtl_lconcat \$_epgpv_vnames "PKG_${_epgpv_pkg_name_uc}_${_epgpv_vname}";
+ fi;
+ done;
+
+ eval ${_epgpv_rpkg_vnames}='${_epgpv_vnames}';
+ return 0;
+}
+
+#
# ex_pkg_load_vars() - load build variables
# @_rstatus: out reference to status string
# @_rbuild_arch: in reference to build architecture