xbps-src: fix masterdir creation if "masterdir" exists

need to check if masterdir is for the requested arch or not
This commit is contained in:
classabbyamp 2024-01-27 15:51:37 -08:00
parent 0ebcc38000
commit 33a5320079
No known key found for this signature in database
GPG Key ID: 6BE0755918A4C7F5
1 changed files with 2 additions and 1 deletions

View File

@ -535,7 +535,8 @@ if [ "$XBPS_CHROOT_CMD" = ethereal ]; then
else else
: "${XBPS_MASTERDIR:=$XBPS_DISTDIR/masterdir-$XBPS_MACHINE}" : "${XBPS_MASTERDIR:=$XBPS_DISTDIR/masterdir-$XBPS_MACHINE}"
# but use $XBPS_DISTDIR/masterdir if it exists and the new style doesn't # but use $XBPS_DISTDIR/masterdir if it exists and the new style doesn't
if [ ! -d "${XBPS_MASTERDIR}" ] && [ -d "${XBPS_DISTDIR}/masterdir" ]; then if [ ! -d "${XBPS_MASTERDIR}" ] && [ -d "${XBPS_DISTDIR}/masterdir" ] \
&& [ "$(cat "${XBPS_DISTDIR}"/masterdir/.xbps_chroot_init)" = "$XBPS_MACHINE" ]; then
XBPS_MASTERDIR="${XBPS_DISTDIR}/masterdir" XBPS_MASTERDIR="${XBPS_DISTDIR}/masterdir"
fi fi
fi fi