common/xbps-src/shutils/build_dependencies.sh: implement skip_check_step()

This function contains the logic that determines whether the check step
will be skipped for the current pkg, taking into account `make_check`.

Use this new function in `install_pkg_deps()` so that it uses a more
accurate condition to skip installing check dependencies.

For instance, check dependencies for a pkg with `make_check=extended`
will no longer be installed when using `-Q`. Similar for `make_check=ci-skip`.

Replaces: #46207
This commit is contained in:
Gonzalo Tornaría 2023-12-26 12:28:39 -03:00 committed by Đoàn Trần Công Danh
parent 4adc8fc17d
commit ebe26129ef
1 changed files with 13 additions and 2 deletions

View File

@ -124,6 +124,17 @@ check_installed_pkg() {
return 1
}
#
# Return 0 if we will skip the check step
#
skip_check_step() {
[ -z "$XBPS_CHECK_PKGS" ] ||
[ "$XBPS_CROSS_BUILD" ] ||
[ "$make_check" = ci-skip -a "$XBPS_BUILD_ENVIRONMENT" = void-packages-ci ] ||
[ "$make_check" = extended -a "$XBPS_CHECK_PKGS" != full ] ||
[ "$make_check" = no ]
}
#
# Build all dependencies required to build and run.
#
@ -137,7 +148,7 @@ install_pkg_deps() {
local -a host_missing_deps missing_deps missing_rdeps
[ -z "$pkgname" ] && return 2
[ -z "$XBPS_CHECK_PKGS" ] && unset checkdepends
skip_check_step && unset checkdepends
if [[ $build_style ]] || [[ $build_helper ]]; then
style=" with"
@ -208,7 +219,7 @@ install_pkg_deps() {
#
# Host check dependencies.
#
if [[ ${checkdepends} ]] && [[ $XBPS_CHECK_PKGS ]] && [ -z "$XBPS_CROSS_BUILD" ]; then
if [[ ${checkdepends} ]]; then
templates=""
# check validity
for f in ${checkdepends}; do