xbps-src: (zap) correctly empty the masterdir
Instead of relying on a potentially outdated list of files and dirs to remove, just remove+recreate the whole masterdir. This previously led to leftover .xbps* files, which broke subsequent operations Fixes #14476
This commit is contained in:
parent
427af2c864
commit
80e4a39926
18
xbps-src
18
xbps-src
|
@ -329,21 +329,9 @@ bootstrap_update() {
|
||||||
}
|
}
|
||||||
|
|
||||||
masterdir_zap() {
|
masterdir_zap() {
|
||||||
for f in bin boot builddir destdir dev etc home lib lib32 lib64 mnt \
|
rm -rf "$XBPS_MASTERDIR"
|
||||||
opt proc root run sbin sys tmp usr var host media xbps \
|
mkdir -p "$XBPS_MASTERDIR"
|
||||||
void-packages .xbps_chroot_init .xbps_chroot_configured; do
|
msg_normal "$XBPS_MASTERDIR masterdir cleaned up."
|
||||||
if [ -d "$XBPS_MASTERDIR/$f" ]; then
|
|
||||||
echo "Removing directory $XBPS_MASTERDIR/$f ..."
|
|
||||||
rm -rf $XBPS_MASTERDIR/$f
|
|
||||||
elif [ -h "$XBPS_MASTERDIR/$f" ]; then
|
|
||||||
echo "Removing link $XBPS_MASTERDIR/$f ..."
|
|
||||||
rm -f $XBPS_MASTERDIR/$f
|
|
||||||
elif [ -f "$XBPS_MASTERDIR/$f" ]; then
|
|
||||||
echo "Removing file $XBPS_MASTERDIR/$f ..."
|
|
||||||
rm -f $XBPS_MASTERDIR/$f
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
echo "$XBPS_MASTERDIR masterdir cleaned up."
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exit_func() {
|
exit_func() {
|
||||||
|
|
Loading…
Reference in New Issue