Revert "xbps-src: improve bulk_sortdeps()."
This reverts commit 3b73edbaa5
.
This commit is contained in:
parent
0eb55debee
commit
7da591e1e4
1 changed files with 13 additions and 18 deletions
|
@ -1,29 +1,24 @@
|
||||||
# vim: set ts=4 sw=4 et:
|
# vim: set ts=4 sw=4 et:
|
||||||
|
|
||||||
bulk_sortdeps() {
|
bulk_sortdeps() {
|
||||||
local pkgs="$@"
|
local _pkgs _pkg pkgs pkg found f x tmpf
|
||||||
local pkg _pkg
|
|
||||||
local NPROCS=$(($(nproc)*2))
|
|
||||||
local NRUNNING=0
|
|
||||||
|
|
||||||
|
pkgs="$@"
|
||||||
tmpf=$(mktemp) || exit 1
|
tmpf=$(mktemp) || exit 1
|
||||||
|
|
||||||
# Perform a topological sort of all build dependencies.
|
# Now make the real dependency graph of all pkgs to build.
|
||||||
if [ $NRUNNING -eq $NPROCS ]; then
|
# Perform a topological sort of all pkgs but only with build dependencies
|
||||||
NRUNNING=0
|
# that are found in previous step.
|
||||||
wait
|
|
||||||
fi
|
|
||||||
|
|
||||||
for pkg in ${pkgs}; do
|
for pkg in ${pkgs}; do
|
||||||
# async/parallel execution
|
_pkgs="$(./xbps-src show-build-deps $pkg 2>/dev/null)"
|
||||||
(
|
found=0
|
||||||
for _pkg in $(./xbps-src show-build-deps $pkg 2>/dev/null); do
|
for x in ${_pkgs}; do
|
||||||
echo "$pkg $_pkg" >> $tmpf
|
for f in ${pkgs}; do
|
||||||
|
[[ $f == $x ]] && found=1 && echo "${pkg} ${f}" >> $tmpf
|
||||||
done
|
done
|
||||||
echo "$pkg $pkg" >> $tmpf
|
|
||||||
) &
|
|
||||||
done
|
done
|
||||||
wait
|
[[ $found -eq 0 ]] && echo "${pkg} ${pkg}" >> $tmpf
|
||||||
|
done
|
||||||
tsort $tmpf|tac
|
tsort $tmpf|tac
|
||||||
rm -f $tmpf
|
rm -f $tmpf
|
||||||
}
|
}
|
||||||
|
@ -35,7 +30,7 @@ bulk_build() {
|
||||||
export XBPS_ARCH=${XBPS_TARGET_MACHINE}
|
export XBPS_ARCH=${XBPS_TARGET_MACHINE}
|
||||||
fi
|
fi
|
||||||
if ! command -v xbps-checkvers &>/dev/null; then
|
if ! command -v xbps-checkvers &>/dev/null; then
|
||||||
msg_error "xbps-src: cannot find xbps-checkvers(1) command!\n"
|
msg_error "xbps-src: cannot find xbps-checkvers(8) command!\n"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
bulk_sortdeps "$(xbps-checkvers -f '%n' ${1} --distdir=$XBPS_DISTDIR)"
|
bulk_sortdeps "$(xbps-checkvers -f '%n' ${1} --distdir=$XBPS_DISTDIR)"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue