xbps-src: massive rewrite of builddeps resolving code.

This speeds up the process of resolving builddeps with
XBPS_PREFER_BINPKG_DEPS enabled and disabled by ~15% aproximately.

This fixes also some bugs I've found while building a massive rebuild
of all packages with XBPS_PREFER_BINPKG_DEPS enabled.
This commit is contained in:
Juan RP 2011-07-01 17:48:29 +02:00
parent a09089a9b0
commit 5d7873a5b2
5 changed files with 99 additions and 82 deletions

View file

@ -1,5 +1,5 @@
#-
# Copyright (c) 2008-2010 Juan Romero Pardines.
# Copyright (c) 2008-2011 Juan Romero Pardines.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@ -43,7 +43,13 @@ install_pkg()
fi
pkg="$curpkgn-$version"
[ -n "$doing_deps" ] && setup_tmpl $curpkgn
[ -n "$INSTALLING_DEPS" ] && setup_tmpl $curpkgn
#
# Fetch distfiles before checking its dependencies.
#
. $XBPS_SHUTILSDIR/fetch_funcs.sh
fetch_distfiles
#
# Refuse to install the same package that is already installed.
@ -61,14 +67,14 @@ install_pkg()
#
# Install dependencies required by this package.
#
if [ -z "$doing_deps" ]; then
if [ -z "$INSTALLING_DEPS" ]; then
install_dependencies_pkg $pkg
[ $? -eq 1 ] && return 1
#
# At this point all required deps are installed, and
# only remaining is the origin package; install it.
#
unset doing_deps
unset INSTALLING_DEPS
setup_tmpl $curpkgn
msg_normal "Installing '$pkgname'...\n"
fi
@ -76,8 +82,6 @@ install_pkg()
#
# Fetch, extract, build and install into the destination directory.
#
. $XBPS_SHUTILSDIR/fetch_funcs.sh
fetch_distfiles
if [ ! -f "$XBPS_EXTRACT_DONE" ]; then
. $XBPS_SHUTILSDIR/extract_funcs.sh
@ -112,7 +116,6 @@ install_pkg()
${fakeroot_cmd} ${fakeroot_cmd_args} \
@@XBPS_INSTALL_LIBEXECDIR@@/xbps-src-doinst-helper ${curpkgn}
if [ $? -ne 0 ]; then
msg_red "xbps-src-doinst-helper failed for '$pkgname'!\n"
return 1
fi
@ -167,8 +170,12 @@ install_pkg()
remove_tmpl_wrksrc $wrksrc
fi
#
# Autoremove packages installed as dependencies if
# XBPS_PREFER_BINPKG_DEPS is set.
#
. ${XBPS_SHUTILSDIR}/builddep_funcs.sh
autoremove_binpkgs
autoremove_pkg_dependencies
return $?
}