xbps-src: multiple performance improvements

- use xbps-checkvers(1) to resolve dependencies.
- all dependencies are installed at once for the host and target.
- the show-build-deps target is now much faster.
- the update-bulk/show-repo-updates targets are now much faster.
- the update-sys/show-sys-updates targets are now much faster.
- the bootstrap target now works on musl hosts.
- simplified some loops.
- use cut(1) rather than awk(1) where applicable.
- multiple random changes to improve performance.

Based on work started by @Duncaen on #12433

Close #12433
Close #11282
This commit is contained in:
Juan RP 2019-07-10 19:48:54 +02:00
parent 529a019a3f
commit e4984d01ea
15 changed files with 469 additions and 617 deletions

View file

@ -24,11 +24,12 @@ remove_pkg_cross_deps() {
prepare_cross_sysroot() {
local cross="$1"
local statefile="$XBPS_MASTERDIR/.xbps-${cross}-done"
[ -z "$cross" -o "$cross" = "" ] && return 0
[ -z "$cross" -o "$cross" = "" -o -f $statefile ] && return 0
# Check for cross-vpkg-dummy available for the target arch, otherwise build it.
pkg_available 'cross-vpkg-dummy>=0.30_1' $cross
pkg_available 'cross-vpkg-dummy>=0.31_1' $cross
if [ $? -eq 0 ]; then
$XBPS_LIBEXECDIR/build.sh cross-vpkg-dummy cross-vpkg-dummy pkg $cross init || return $?
fi
@ -40,7 +41,7 @@ prepare_cross_sysroot() {
errlog=$(mktemp) || exit 1
$XBPS_INSTALL_XCMD -Syfd cross-vpkg-dummy &>$errlog
rval=$?
if [ $rval -ne 0 -a $rval -ne 17 ]; then
if [ $rval -ne 0 ]; then
msg_red "failed to install cross-vpkg-dummy (error $rval)\n"
cat $errlog
rm -f $errlog
@ -48,11 +49,15 @@ prepare_cross_sysroot() {
fi
rm -f $errlog
# Create top level symlinks in sysroot.
XBPS_ARCH=$XBPS_TARGET_MACHINE xbps-reconfigure -r $XBPS_CROSS_BASE -f base-directories base-files &>/dev/null
XBPS_ARCH=$XBPS_TARGET_MACHINE xbps-reconfigure -r $XBPS_CROSS_BASE -f base-files &>/dev/null
# Create a sysroot/include and sysroot/lib symlink just in case.
ln -s usr/include ${XBPS_CROSS_BASE}/include
ln -s usr/lib ${XBPS_CROSS_BASE}/lib
install_cross_pkg $cross || return 1
touch -f $statefile
return 0
}