From 416aa296a43c51cf224de81a632ea8d30a0efcc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Sat, 23 Dec 2023 19:40:53 -0300 Subject: [PATCH] fix sort-dependencies to use checkdepends As it is now, if pkgA checkdepends on pkgB, sort-dependencies will still print pkgA before pkgB. This causes CI to build pkgB twice: first build pkgA which forces implicit build of pkgB; then build of pkgB (explicit, so it will ignore the package is already built). A concrete example: $ ./xbps-src sort-dependencies python3-process-tests python3-pytest-cov python3-pytest-cov python3-process-tests After this commit, the order above is the other way around. --- common/xbps-src/shutils/bulk.sh | 3 ++- common/xbps-src/shutils/show.sh | 4 ++++ xbps-src | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/common/xbps-src/shutils/bulk.sh b/common/xbps-src/shutils/bulk.sh index 69e36f4a43f4e..15a7dc6c94d12 100644 --- a/common/xbps-src/shutils/bulk.sh +++ b/common/xbps-src/shutils/bulk.sh @@ -35,7 +35,8 @@ bulk_sortdeps() { # Perform a topological sort of all pkgs but only with build dependencies # that are found in previous step. for pkg in ${pkgs}; do - _pkgs="$($XBPS_DISTDIR/xbps-src show-build-deps $pkg 2>/dev/null)" + _pkgs="$($XBPS_DISTDIR/xbps-src show-build-deps $pkg 2>/dev/null) + $($XBPS_DISTDIR/xbps-src show-check-deps $pkg 2>/dev/null)" found=0 for x in ${_pkgs}; do _pkg=$(bulk_getlink $x) diff --git a/common/xbps-src/shutils/show.sh b/common/xbps-src/shutils/show.sh index 606396d2b4b1a..8af32295d25d5 100644 --- a/common/xbps-src/shutils/show.sh +++ b/common/xbps-src/shutils/show.sh @@ -120,6 +120,10 @@ show_pkg_build_deps() { show_pkg_build_depends "${makedepends} $(setup_pkg_depends '' 1 1)" "${hostmakedepends}" } +show_pkg_check_deps() { + show_pkg_build_depends "${checkdepends}" "" +} + show_pkg_hostmakedepends() { show_pkg_build_depends "" "${hostmakedepends}" } diff --git a/xbps-src b/xbps-src index cdb5f8c6d643e..cf0d31ff903d4 100755 --- a/xbps-src +++ b/xbps-src @@ -91,6 +91,9 @@ show-avail show-build-deps Show required build dependencies for . +show-check-deps + Show required check dependencies for . + show-deps Show required run-time dependencies for . Package must be installed into destdir. @@ -861,6 +864,10 @@ case "$XBPS_TARGET" in read_pkg ignore-problems show_pkg_build_deps ;; + show-check-deps) + read_pkg ignore-problems + show_pkg_check_deps + ;; show-hostmakedepends) read_pkg ignore-problems show_pkg_hostmakedepends