xbps-src: simplify dbulk-dump output

* List dependencies of subpackages as part of the source packages
  dependencies, knowing the subpackage they are coming from does
  not matter to a build scheduler as long as xbps-src requires
  those to exist in the same way to main depends= have to exist.
* Resolve virtual? packages through existing means in xbps-src to
  avoid duplicating and possibly diverting from xbps-src's
  behaviour in tools that use dbulk-dump.
* Filter out dependencies on the template itself from sub packages,
  this matches the xbps-src behaviour and there is no need to
  have to duplicate logic for this into the scheduling tool.
* Error out on archs= restrictions as we do already on broken=
  and nocross=, there shouldn't be the need to discover archs=
  restrictions when attempting to build the package.
This commit is contained in:
Duncaen 2021-03-10 22:01:35 +01:00 committed by Toyam Cox
parent e61630a65d
commit 1f6ab168de
3 changed files with 11 additions and 17 deletions

View file

@ -891,33 +891,28 @@ case "$XBPS_TARGET" in
;;
dbulk-dump)
read_pkg
check_pkg_arch "$XBPS_CROSS_BUILD"
for x in pkgname version revision; do
printf '%s: %s\n' "$x" "${!x}"
done
for x in bootstrap; do
[[ ${!x} ]] && printf '%s: %s\n' "$x" "${!x}"
done
for x in hostmakedepends makedepends depends; do
for x in hostmakedepends makedepends; do
arr=(${!x})
if [[ ${#arr} -gt 0 ]]; then
printf '%s:\n' "$x"
printf ' %s\n' "${arr[@]}"
fi
done
_cleandeps=$(setup_pkg_depends "" 1 1 | { grep -vF "$(printf "%s\n" $pkgname $subpackages)" || :; } | sort -u) || exit 1
if [[ $_cleandeps ]]; then
printf 'depends:\n'
printf ' %s\n' $_cleandeps
fi
if [[ $subpackages ]]; then
printf 'subpackages:\n'
for x in ${subpackages}; do
. ${XBPS_COMMONDIR}/environment/setup-subpkg/subpkg.sh
${x}_package
printf ' %s\n' "$x"
for x in depends; do
arr=(${!x})
if [[ ${#arr} -gt 0 ]]; then
printf ' %s:\n' "$x"
printf ' %s\n' "${arr[@]}"
fi
done
done
printf ' %s\n' $subpackages
fi
;;
show-options)