xbps-src: fix clean-repocache

xbps-remove needs the right rootdir to not remove packages still required
by repos. Without it it will just delete everything since it can't be
found in any of the registered repositories.
This commit is contained in:
Duncaen
2026-04-21 18:56:07 +02:00
parent 523feecb5e
commit d4a940874c
2 changed files with 11 additions and 3 deletions
+10 -2
View File
@@ -866,8 +866,16 @@ case "$XBPS_TARGET" in
fi
;;
clean-repocache)
export XBPS_TARGET_ARCH="${XBPS_CROSS_BUILD:-$XBPS_TARGET_MACHINE}"
$XBPS_REMOVE_CMD -C /dev/null -c $XBPS_HOSTDIR/repocache-${XBPS_TARGET_ARCH} -O
if [ -n "$CHROOT_READY" -a -z "$IN_CHROOT" ]; then
chroot_handler $XBPS_TARGET $XBPS_TARGET_PKG || exit $?
else
if [ "$XBPS_CROSS_BUILD" ]; then
setup_env "$XBPS_CROSS_BUILD"
$XBPS_REMOVE_XCMD -c "$XBPS_HOSTDIR/repocache-${XBPS_TARGET_MACHINE}" -O
else
$XBPS_REMOVE_CMD -c "$XBPS_HOSTDIR/repocache-${XBPS_TARGET_MACHINE}" -O
fi
fi
;;
consistency-check)
consistency_check