xbps-src: restore show-pkg-var, new under new name

This reverts commit a23934ed94.
This commit is contained in:
Toyam Cox 2020-05-07 19:00:47 -04:00
parent ffd44d6874
commit 4e815ac29e
1 changed files with 46 additions and 15 deletions

View File

@ -823,6 +823,29 @@ case "$XBPS_TARGET" in
read_pkg ignore-problems read_pkg ignore-problems
show_pkg_makedepends show_pkg_makedepends
;; ;;
show-pkg-var-dump)
read_pkg ignore-problems
for sub_name in $subpackages; do
if [ $sub_name = $XBPS_TARGET_PKG ]; then
${sub_name}_package
fi
done
printf "archs: %s\n\n" "$archs"
printf "bootstrap: %s\n\n" "$bootstrap"
printf "broken: %s\n\n" "$broken"
printf "depends: %s\n\n" "$depends"
printf "hostmakedepends: %s\n\n" "$hostmakedepends"
printf "makedepends: %s\n\n" "$makedepends"
printf "nocross: %s\n\n" "$nocross"
printf "pkgname: %s\n\n" "$pkgname"
printf "restricted: %s\n\n" "$restricted"
printf "revision: %s\n\n" "$revision"
printf "subpackages: %s\n\n" "$subpackages"
printf "version: %s\n\n" "$version"
printf "provides: %s\n\n" "$provides"
printf "lib32disabled: %s\n\n" "$lib32disabled"
printf "nodebug: %s\n\n" "$nodebug"
;;
show-pkg-var) show-pkg-var)
read_pkg ignore-problems read_pkg ignore-problems
for sub_name in $subpackages; do for sub_name in $subpackages; do
@ -830,21 +853,29 @@ case "$XBPS_TARGET" in
${sub_name}_package ${sub_name}_package
fi fi
done done
printf "archs: %s\n\n" "$archs" while IFS= read -r pkg_var; do
printf "bootstrap: %s\n\n" "$bootstrap" print_var=
printf "broken: %s\n\n" "$broken" case "${pkg_var}" in
printf "depends: %s\n\n" "$depends" archs) print_var="$archs ";;
printf "hostmakedepends: %s\n\n" "$hostmakedepends" bootstrap) print_var="$bootstrap ";;
printf "makedepends: %s\n\n" "$makedepends" broken) print_var="$broken ";;
printf "nocross: %s\n\n" "$nocross" depends) print_var="$depends ";;
printf "pkgname: %s\n\n" "$pkgname" hostmakedepends) print_var="$hostmakedepends ";;
printf "restricted: %s\n\n" "$restricted" makedepends) print_var="$makedepends ";;
printf "revision: %s\n\n" "$revision" nocross) print_var="$nocross ";;
printf "subpackages: %s\n\n" "$subpackages" pkgname) print_var="$pkgname ";;
printf "version: %s\n\n" "$version" restricted) print_var="$restricted ";;
printf "provides: %s\n\n" "$provides" revision) print_var="$revision ";;
printf "lib32disabled: %s\n\n" "$lib32disabled" subpackages) print_var="$subpackages ";;
printf "nodebug: %s\n\n" "$nodebug" version) print_var="$version ";;
provides) print_var="$provides ";;
lib32disabled) print_var="$lib32disabled ";;
nodebug) print_var="$nodebug ";;
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) show-options)
read_pkg ignore-problems read_pkg ignore-problems