xbps-src: add show-pkg-var mode for dxpb's usage

This commit is contained in:
Toyam Cox 2017-08-07 00:43:41 -04:00
parent f7e3ea1a7e
commit 52a560fa39
1 changed files with 29 additions and 0 deletions

View File

@ -742,6 +742,35 @@ case "$XBPS_TARGET" in
read_pkg ignore-problems
show_pkg_build_deps
;;
show-pkg-var)
read_pkg ignore-problems
for sub_name in $subpackages; do
if [ $sub_name = $XBPS_TARGET_PKG ]; then
${sub_name}_package
fi
done
while IFS= read -r pkg_var; do
print_var=
case "${pkg_var}" in
bootstrap) print_var="$bootstrap ";;
broken) print_var="$broken ";;
depends) print_var="$depends ";;
hostmakedepends) print_var="$hostmakedepends ";;
makedepends) print_var="$makedepends ";;
noarch) print_var="$noarch ";;
nocross) print_var="$nocross ";;
only_for_archs) print_var="$only_for_archs ";;
pkgname) print_var="$pkgname ";;
restricted) print_var="$restricted ";;
revision) print_var="$revision ";;
subpackages) print_var="$subpackages ";;
version) print_var="$version ";;
esac # the space at the end of each is essential for unset vars
if [ -n "$print_var" ]; then
printf "%s\n" "$(printf "${print_var% }" | tr -t '\n\r' ' ')"
fi # The trailing space gets stripped before printing anyway
done
;;
show-options)
read_pkg ignore-problems
show_pkg_build_options