xbps-src: add show host/makedepends subcommand

This commit is contained in:
Cameron Nemo 2019-01-26 11:29:36 -08:00 committed by maxice8
parent 6b07fe3040
commit 2b569f1ef8
2 changed files with 31 additions and 4 deletions

View File

@ -58,15 +58,14 @@ show_avail() {
check_pkg_arch "$XBPS_CROSS_BUILD" 2>/dev/null
}
show_pkg_build_deps() {
show_pkg_build_depends() {
local f x _pkgname _srcpkg _dep found result
setup_pkg_depends
local _deps="$1"
result=$(mktemp || exit 1)
# build time deps
for f in ${host_build_depends} ${build_depends} ${run_depends}; do
for f in ${_deps}; do
# ignore virtual deps
local _rpkg="${f%\?*}"
local _vpkg="${f#*\?}"
@ -105,6 +104,20 @@ show_pkg_build_deps() {
rm -f $result
}
show_pkg_build_deps() {
setup_pkg_depends
show_pkg_build_depends "${host_build_depends} ${build_depends} ${run_depends}"
}
show_pkg_hostmakedepends() {
setup_pkg_depends
show_pkg_build_depends "${host_build_depends}"
}
show_pkg_makedepends() {
setup_pkg_depends
show_pkg_build_depends "${build_depends}"
}
show_pkg_build_options() {
local f opt desc

View File

@ -91,6 +91,12 @@ show-deps <pkgname>
show-files <pkgname>
Show files installed by <pkgname>. Package must be installed into destdir.
show-hostmakedepends <pkgname>
Show required host build dependencies for <pkgname>.
show-makedepends <pkgname>
Show required target build dependencies for <pkgname>.
show-options <pkgname>
Show available build options by <pkgname>.
@ -750,6 +756,14 @@ case "$XBPS_TARGET" in
read_pkg ignore-problems
show_pkg_build_deps
;;
show-hostmakedepends)
read_pkg ignore-problems
show_pkg_hostmakedepends
;;
show-makedepends)
read_pkg ignore-problems
show_pkg_makedepends
;;
show-pkg-var)
read_pkg ignore-problems
for sub_name in $subpackages; do