xbps-src: builddep_funcs.sh: use install_pkg_from_repos for just 1 pkgdep.
This commit is contained in:
parent
fad3f96d37
commit
31452a3a22
1 changed files with 15 additions and 8 deletions
|
@ -71,16 +71,15 @@ install_pkglist_from_repos()
|
||||||
#
|
#
|
||||||
install_pkg_from_repos()
|
install_pkg_from_repos()
|
||||||
{
|
{
|
||||||
local cmd rval pkgdepname pkg="$1"
|
local cmd rval pkgdepname tmplogf pkg="$1"
|
||||||
|
|
||||||
[ ! -d "${wrksrc}" ] && return 1
|
|
||||||
|
|
||||||
pkgdepname=$($XBPS_PKGDB_CMD getpkgdepname "$pkg")
|
pkgdepname=$($XBPS_PKGDB_CMD getpkgdepname "$pkg")
|
||||||
cmd="${fakeroot_cmd} ${fakeroot_cmd_args} ${XBPS_BIN_CMD} -Ay install"
|
cmd="${fakeroot_cmd} ${fakeroot_cmd_args} ${XBPS_BIN_CMD} -Ay install"
|
||||||
|
|
||||||
msg_normal "$pkgver: installing required dependency '$pkg' ...\n"
|
msg_normal "$pkgver: installing required dependency '$pkg' ...\n"
|
||||||
|
|
||||||
${cmd} "${pkg}" >${wrksrc}/.xbps_install_dependency_${pkgdepname}.log 2>&1
|
tmplogf=$(mktemp)
|
||||||
|
${cmd} "${pkg}" >${tmplogf} 2>&1
|
||||||
rval=$?
|
rval=$?
|
||||||
if [ $rval -ne 0 -a $rval -ne 6 ]; then
|
if [ $rval -ne 0 -a $rval -ne 6 ]; then
|
||||||
# xbps-bin can return:
|
# xbps-bin can return:
|
||||||
|
@ -93,9 +92,10 @@ install_pkg_from_repos()
|
||||||
# Any other error returned is critical.
|
# Any other error returned is critical.
|
||||||
autoremove_pkg_dependencies $KEEP_AUTODEPS
|
autoremove_pkg_dependencies $KEEP_AUTODEPS
|
||||||
msg_red "$pkgver: failed to install '${pkg}' dependency! (error $rval)\n"
|
msg_red "$pkgver: failed to install '${pkg}' dependency! (error $rval)\n"
|
||||||
cat ${wrksrc}/.xbps_install_${pkgdepname}.log
|
cat $tmplogf && rm -f $tmplogf
|
||||||
msg_error "Please see above for the real error, exiting...\n"
|
msg_error "Please see above for the real error, exiting...\n"
|
||||||
fi
|
fi
|
||||||
|
rm -f $tmplogf
|
||||||
|
|
||||||
return $rval
|
return $rval
|
||||||
}
|
}
|
||||||
|
@ -247,9 +247,9 @@ install_pkg_deps()
|
||||||
#
|
#
|
||||||
install_dependencies_pkg()
|
install_dependencies_pkg()
|
||||||
{
|
{
|
||||||
local pkg="$1" rval
|
local pkg="$1"
|
||||||
local lpkgname=$(${XBPS_PKGDB_CMD} getpkgname ${pkg})
|
local lpkgname=$(${XBPS_PKGDB_CMD} getpkgname ${pkg})
|
||||||
local i j pkgn iver reqver notinstalled_deps pkglist
|
local rval i j pkgn iver reqver notinstalled_deps pkglist pkgcount
|
||||||
|
|
||||||
[ -z "$pkg" ] && return 2
|
[ -z "$pkg" ] && return 2
|
||||||
[ -z "$build_depends" ] && return 0
|
[ -z "$build_depends" ] && return 0
|
||||||
|
@ -275,14 +275,21 @@ install_dependencies_pkg()
|
||||||
# Install direct build dependencies from binary packages.
|
# Install direct build dependencies from binary packages.
|
||||||
if [ -n "$XBPS_PREFER_BINPKG_DEPS" -a -z "$bootstrap" ]; then
|
if [ -n "$XBPS_PREFER_BINPKG_DEPS" -a -z "$bootstrap" ]; then
|
||||||
msg_normal "$pkgver: installing dependencies from repositories ...\n"
|
msg_normal "$pkgver: installing dependencies from repositories ...\n"
|
||||||
|
pkgcount=0
|
||||||
for i in ${notinstalled_deps}; do
|
for i in ${notinstalled_deps}; do
|
||||||
if [ -z "$pkglist" ]; then
|
if [ -z "$pkglist" ]; then
|
||||||
|
pkgcount=1
|
||||||
pkglist="${i}"
|
pkglist="${i}"
|
||||||
else
|
else
|
||||||
pkglist="${pkglist} ${i}"
|
pkglist="${pkglist} ${i}"
|
||||||
|
pkgcount=$(($pkgcount + 1))
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
if [ "$pkgcount" -eq 1 ]; then
|
||||||
|
install_pkg_from_repos "${pkglist}"
|
||||||
|
else
|
||||||
install_pkglist_from_repos "${pkglist}"
|
install_pkglist_from_repos "${pkglist}"
|
||||||
|
fi
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
# Install successfully
|
# Install successfully
|
||||||
return 0
|
return 0
|
||||||
|
|
Loading…
Add table
Reference in a new issue