Revert "xbps-src: improve bulk code a bit more."

This reverts commit 42624509281ad8d289d64b53579079565f7afe0f.
This commit is contained in:
Jürgen Buchmüller 2019-07-05 12:08:41 +02:00
parent a5968491c7
commit 0eb55debee

View File

@ -8,13 +8,14 @@ bulk_sortdeps() {
tmpf=$(mktemp) || exit 1 tmpf=$(mktemp) || exit 1
# Perform a topological sort of all *direct* build dependencies. # Perform a topological sort of all build dependencies.
for pkg in ${pkgs}; do
if [ $NRUNNING -eq $NPROCS ]; then if [ $NRUNNING -eq $NPROCS ]; then
NRUNNING=0 NRUNNING=0
wait wait
fi fi
NRUNNING=$((NRUNNING+1))
for pkg in ${pkgs}; do
# async/parallel execution
( (
for _pkg in $(./xbps-src show-build-deps $pkg 2>/dev/null); do for _pkg in $(./xbps-src show-build-deps $pkg 2>/dev/null); do
echo "$pkg $_pkg" >> $tmpf echo "$pkg $_pkg" >> $tmpf
@ -28,9 +29,6 @@ bulk_sortdeps() {
} }
bulk_build() { bulk_build() {
local sys="$1"
local NPROCS=$(($(nproc)*2))
local NRUNNING=0
if [ "$XBPS_CROSS_BUILD" ]; then if [ "$XBPS_CROSS_BUILD" ]; then
source ${XBPS_COMMONDIR}/cross-profiles/${XBPS_CROSS_BUILD}.sh source ${XBPS_COMMONDIR}/cross-profiles/${XBPS_CROSS_BUILD}.sh
@ -40,38 +38,21 @@ bulk_build() {
msg_error "xbps-src: cannot find xbps-checkvers(1) command!\n" msg_error "xbps-src: cannot find xbps-checkvers(1) command!\n"
fi fi
# Compare installed pkg versions vs srcpkgs bulk_sortdeps "$(xbps-checkvers -f '%n' ${1} --distdir=$XBPS_DISTDIR)"
if [[ $sys ]]; then
xbps-checkvers -f '%n' -I -D $XBPS_DISTDIR
return $?
fi
# compare repo pkg versions vs srcpkgs
for f in $(xbps-checkvers -f '%n' -D $XBPS_DISTDIR); do
if [ $NRUNNING -eq $NPROCS ]; then
NRUNNING=0
wait
fi
NRUNNING=$((NRUNNING+1))
(
if ./xbps-src show-avail $f &>/dev/null; then
echo "$f"
fi
) &
done
wait
return $?
} }
bulk_update() { bulk_update() {
local args="$1" pkgs f rval local args="$1" pkgs f rval
pkgs="$(bulk_build ${args})" pkgs="$(bulk_build ${args})"
[[ -z $pkgs ]] && return 0 if [ -z "$pkgs" ]; then
return 0
fi
msg_normal "xbps-src: the following packages must be rebuilt and updated:\n" msg_normal "xbps-src: the following packages must be rebuilt and updated:\n"
for f in ${pkgs}; do for f in ${pkgs}; do
echo " $f" echo " $f"
done done
echo
for f in ${pkgs}; do for f in ${pkgs}; do
XBPS_TARGET_PKG=$f XBPS_TARGET_PKG=$f
read_pkg read_pkg