From 8a9c6d103349557632d95e656ad80e977904002d Mon Sep 17 00:00:00 2001 From: Juan RP Date: Thu, 13 May 2010 22:21:08 +0200 Subject: [PATCH] xbps-src: install required deps if necessary in the configure/build target. --- xbps-src/xbps-src.sh.in | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/xbps-src/xbps-src.sh.in b/xbps-src/xbps-src.sh.in index 4fd819d9628..e61ca608b64 100644 --- a/xbps-src/xbps-src.sh.in +++ b/xbps-src/xbps-src.sh.in @@ -194,6 +194,8 @@ if [ "$(id -u)" -eq 0 ]; then fi fi +[ -z "$dontrm_builddir" ] && dontrm_builddir=no + # Main switch case "$target" in bootstrap) @@ -202,7 +204,6 @@ bootstrap) [ ! -d $XBPS_SRCPKGDIR/xbps-base-chroot ] && \ msg_error "Cannot find $XBPS_SRCPKGDIR/xbps-base-chroot directory!" cd $XBPS_SRCPKGDIR/xbps-base-chroot && setup_tmpl $(basename_cwd) - [ -z "$dontrm_builddir" ] && dontrm_builddir=no install_pkg $pkgname ;; build|configure) @@ -214,7 +215,18 @@ build|configure) . $XBPS_SHUTILSDIR/chroot.sh xbps_chroot_handler $target $(basename_cwd) else - setup_tmpl $(basename_cwd) + originpkg="$(basename_cwd)" + setup_tmpl $originpkg + # If pkg has dependencies, install them first. + . $XBPS_SHUTILSDIR/pkgtarget_funcs.sh + . $XBPS_SHUTILSDIR/builddep_funcs.sh + install_dependencies_pkg "$pkgname-$version" + if [ $? -ne 0 ]; then + msg_red "cannot install required deps for $pkgname." + exit 1 + fi + # All deps were installed, continue with the origin pkg... + setup_tmpl $originpkg . $XBPS_SHUTILSDIR/fetch_funcs.sh fetch_distfiles if [ ! -f "$XBPS_EXTRACT_DONE" ]; then @@ -280,7 +292,6 @@ install|install-destdir) install_destdir_target=no [ "$target" = "install-destdir" ] && install_destdir_target=yes - [ -z "$dontrm_builddir" ] && dontrm_builddir=no if [ -z "$in_chroot" -a -z "$base_chroot" ]; then . $XBPS_SHUTILSDIR/chroot.sh