xbps-src: work around autodeps removal needing multiple passes

This commit is contained in:
q66 2019-10-21 20:58:31 +02:00 committed by Juan RP
parent 90f5f8ffe1
commit 0a38409da6
2 changed files with 27 additions and 7 deletions

View File

@ -1,7 +1,7 @@
# vim: set ts=4 sw=4 et: # vim: set ts=4 sw=4 et:
remove_pkg_cross_deps() { remove_pkg_cross_deps() {
local rval= tmplogf= local rval= tmplogf= prevs=0
[ -z "$XBPS_CROSS_BUILD" ] && return 0 [ -z "$XBPS_CROSS_BUILD" ] && return 0
cd $XBPS_MASTERDIR || return 1 cd $XBPS_MASTERDIR || return 1
@ -14,7 +14,18 @@ remove_pkg_cross_deps() {
fi fi
$XBPS_REMOVE_XCMD -Ryo > $tmplogf 2>&1 $XBPS_REMOVE_XCMD -Ryo > $tmplogf 2>&1
if [ $? -ne 0 ]; then rval=$?
while [ $rval -eq 0 ]; do
local curs=$(stat -c %s $tmplogf)
if [ $curs -eq $prevs ]; then
break
fi
prevs=$curs
$XBPS_REMOVE_XCMD -Ryo >> $tmplogf 2>&1
rval=$?
done
if [ $rval -ne 0 ]; then
msg_red "${pkgver:-xbps-src}: failed to remove autocrossdeps:\n" msg_red "${pkgver:-xbps-src}: failed to remove autocrossdeps:\n"
cat $tmplogf && rm -f $tmplogf cat $tmplogf && rm -f $tmplogf
msg_error "${pkgver:-xbps-src}: cannot continue!\n" msg_error "${pkgver:-xbps-src}: cannot continue!\n"

View File

@ -44,27 +44,36 @@ pkg_available() {
} }
remove_pkg_autodeps() { remove_pkg_autodeps() {
local rval= tmplogf= local rval= tmplogf= errlogf= prevs=
cd $XBPS_MASTERDIR || return 1 cd $XBPS_MASTERDIR || return 1
msg_normal "${pkgver:-xbps-src}: removing autodeps, please wait...\n" msg_normal "${pkgver:-xbps-src}: removing autodeps, please wait...\n"
tmplogf=$(mktemp) || exit 1 tmplogf=$(mktemp) || exit 1
errlogf=$(mktemp) || exit 1
remove_pkg_cross_deps remove_pkg_cross_deps
$XBPS_RECONFIGURE_CMD -a >> $tmplogf 2>&1 $XBPS_RECONFIGURE_CMD -a >> $tmplogf 2>&1
echo yes | $XBPS_REMOVE_CMD -Ryod >> $tmplogf 2>&1 prevs=$(stat -c %s $tmplogf)
echo yes | $XBPS_REMOVE_CMD -Ryod 2>> $errlogf 1>> $tmplogf
rval=$? rval=$?
if [ $rval -eq 0 ]; then while [ $rval -eq 0 ]; do
echo yes | $XBPS_REMOVE_CMD -Ryod >> $tmplogf 2>&1 local curs=$(stat -c %s $tmplogf)
if [ $curs -eq $prevs ]; then
break
fi
prevs=$curs
echo yes | $XBPS_REMOVE_CMD -Ryod 2>> $errlogf 1>> $tmplogf
rval=$? rval=$?
fi done
if [ $rval -ne 0 ]; then if [ $rval -ne 0 ]; then
msg_red "${pkgver:-xbps-src}: failed to remove autodeps: (returned $rval)\n" msg_red "${pkgver:-xbps-src}: failed to remove autodeps: (returned $rval)\n"
cat $tmplogf && rm -f $tmplogf cat $tmplogf && rm -f $tmplogf
cat $errlogf && rm -f $errlogf
msg_error "${pkgver:-xbps-src}: cannot continue!\n" msg_error "${pkgver:-xbps-src}: cannot continue!\n"
fi fi
rm -f $tmplogf rm -f $tmplogf
rm -f $errlogf
} }
remove_pkg_wrksrc() { remove_pkg_wrksrc() {