xbps-src: improve PREFER_BINPKG_DEPS, take 2.

When installing pkgdeps from repositories more errno values are handled
from xbps-bin, this help us to find why a package failed to install.

Also stdout/stderr output from xbps-bin is redirected to
$wrksrc/.xbps_install_dependency_$pkgdepname.log to see how it was
installed or why it failed to install.

Do autoremove packages in more places to be sure that if something went
wrong those packages are always removed.
This commit is contained in:
Juan RP 2011-06-30 10:23:48 +02:00
parent 9be28af618
commit 87f2599c17
3 changed files with 63 additions and 49 deletions

View file

@ -167,27 +167,9 @@ install_pkg()
remove_tmpl_wrksrc $wrksrc
fi
#
# If XBPS_PREFER_BINPKG_DEPS is set, we should remove those
# package dependencies installed by the target package, do it.
#
if [ -n "$XBPS_PREFER_BINPKG_DEPS" -a -z "$doing_deps" ]; then
msg_normal "Removing binary package dependencies...\n"
${fakeroot_cmd} ${fakeroot_cmd_args} \
${XBPS_BIN_CMD} -Rpyf autoremove
fi
return $?
}
. ${XBPS_SHUTILSDIR}/builddep_funcs.sh
autoremove_binpkgs
#
# Installs a pkg by installing a binary package from
# repository pool, matching the pkg pattern.
#
install_pkg_with_binpkg()
{
msg_normal "'$pkgname': installing dependency '$1'\n"
${fakeroot_cmd} ${fakeroot_cmd_args} ${XBPS_BIN_CMD} \
-Ay install "\"${1}\""
return $?
}
@ -216,10 +198,6 @@ remove_pkg()
[ -z $pkgname ] && msg_error "unexistent package, aborting.\n"
ver=$($XBPS_PKGDB_CMD version $pkgname)
if [ -z "$ver" ]; then
msg_warn "$pkgname is not installed.\n"
fi
. $XBPS_SHUTILSDIR/stow_funcs.sh
stow_pkg_handler unstow || return $?
@ -237,9 +215,9 @@ remove_pkg()
rm -rf "$XBPS_DESTDIR/${pkgname}-${ver%_*}"
fi
rm -f $XBPS_PRE_INSTALL_DONE
rm -f $XBPS_POST_INSTALL_DONE
rm -f $XBPS_INSTALL_DONE
[ -f $XBPS_PRE_INSTALL_DONE ] && rm -f $XBPS_PRE_INSTALL_DONE
[ -f $XBPS_POST_INSTALL_DONE ] && rm -f $XBPS_POST_INSTALL_DONE
[ -f $XBPS_INSTALL_DONE ] && rm -f $XBPS_INSTALL_DONE
return $?
}