xbps-src: per-architecture handling of repo confs

The new behavior is basically this:

1) Local repos are installed same as before.
2) Multilib configs are now handled only if they exist. They follow
   a naming system repos-{local,remote}-ARCH-multilib.conf.
3) Remote repo files follow naming repos-remote-ARCH.conf. If that
   does not exist, repos-remote.conf or repos-remote-musl.conf is
   used instead (fallback).
4) Cross follows the same behavior, just without multilib.

[ci skip]
This commit is contained in:
q66 2020-01-30 15:14:30 +01:00 committed by Daniel Kolesa
parent 7b663b891b
commit cd2e132ea1
4 changed files with 38 additions and 47 deletions

View File

@ -230,40 +230,33 @@ chroot_sync_repodata() {
sed -e "s,/host,$hostdir,g" ${XBPS_DISTDIR}/etc/xbps.d/repos-local.conf \ sed -e "s,/host,$hostdir,g" ${XBPS_DISTDIR}/etc/xbps.d/repos-local.conf \
> $confdir/10-repository-local.conf > $confdir/10-repository-local.conf
# Install multilib conf for local repos if it exists for the architecture
if [ -s "${XBPS_DISTDIR}/etc/xbps.d/repos-local-${XBPS_MACHINE}-multilib.conf" ]; then
install -Dm644 ${XBPS_DISTDIR}/etc/xbps.d/repos-local-${XBPS_MACHINE}-multilib.conf \
$confdir/12-repository-local-multilib.conf
fi
if [ "$XBPS_SKIP_REMOTEREPOS" ]; then if [ "$XBPS_SKIP_REMOTEREPOS" ]; then
rm -f $confdir/*remote* rm -f $confdir/*remote*
case "$XBPS_MACHINE" in
x86_64)
# x86_64/glibc
install -Dm644 ${XBPS_DISTDIR}/etc/xbps.d/repos-local-x86_64.conf \
$confdir/12-repository-local-x86_64.conf
;;
esac
else else
case "$XBPS_MACHINE" in if [ -s "${XBPS_DISTDIR}/etc/xbps.d/repos-remote-${XBPS_MACHINE}.conf" ]; then
*-musl) # If per-architecture base remote repo config exists, use that
install -Dm644 ${XBPS_DISTDIR}/etc/xbps.d/repos-remote-musl.conf \ install -Dm644 ${XBPS_DISTDIR}/etc/xbps.d/repos-remote-${XBPS_MACHINE}.conf \
$confdir/20-repository-remote.conf $confdir/20-repository-remote.conf
;; else
*) # Otherwise use generic base for musl or glibc
install -Dm644 ${XBPS_DISTDIR}/etc/xbps.d/repos-remote.conf \ local suffix=
$confdir/20-repository-remote.conf case "$XBPS_MACHINE" in
;; *-musl) suffix="-musl";;
esac esac
case "$XBPS_MACHINE" in install -Dm644 ${XBPS_DISTDIR}/etc/xbps.d/repos-remote${suffix}.conf \
x86_64) $confdir/20-repository-remote.conf
# x86_64/glibc fi
install -Dm644 ${XBPS_DISTDIR}/etc/xbps.d/repos-local-x86_64.conf \ # Install multilib conf for remote repos if it exists for the architecture
$confdir/12-repository-local-x86_64.conf if [ -s "${XBPS_DISTDIR}/etc/xbps.d/repos-remote-${XBPS_MACHINE}-multilib.conf" ]; then
install -Dm644 ${XBPS_DISTDIR}/etc/xbps.d/repos-remote-x86_64.conf \ install -Dm644 ${XBPS_DISTDIR}/etc/xbps.d/repos-remote-${XBPS_MACHINE}-multilib.conf \
$confdir/22-repository-remote-x86_64.conf $confdir/22-repository-remote-multilib.conf
;; fi
aarch64*)
# aarch64 glibc/musl
install -Dm644 ${XBPS_DISTDIR}/etc/xbps.d/repos-remote-aarch64.conf \
$confdir/22-repository-remote-aarch64.conf
;;
esac
fi fi
# Copy host repos to the cross root. # Copy host repos to the cross root.
@ -276,24 +269,18 @@ chroot_sync_repodata() {
if [ "$XBPS_SKIP_REMOTEREPOS" ]; then if [ "$XBPS_SKIP_REMOTEREPOS" ]; then
rm -f $crossconfdir/*remote* rm -f $crossconfdir/*remote*
else else
# and then remote repos for target machine # Same general logic as above, just into cross root, and no multilib
case "$XBPS_TARGET_MACHINE" in if [ -s "${XBPS_DISTDIR}/etc/xbps.d/repos-remote-${XBPS_TARGET_MACHINE}.conf" ]; then
aarch64*) install -Dm644 ${XBPS_DISTDIR}/etc/xbps.d/repos-remote-${XBPS_TARGET_MACHINE}.conf \
# aarch64 glibc/musl
install -Dm644 ${XBPS_DISTDIR}/etc/xbps.d/repos-remote-aarch64.conf \
$crossconfdir/22-repository-remote-aarch64.conf
;;
*-musl)
# !aarch64 && musl
install -Dm644 ${XBPS_DISTDIR}/etc/xbps.d/repos-remote-musl.conf \
$crossconfdir/20-repository-remote.conf $crossconfdir/20-repository-remote.conf
;; else
*) local suffix=
# !aarch64 && glibc case "$XBPS_TARGET_MACHINE" in
install -Dm644 ${XBPS_DISTDIR}/etc/xbps.d/repos-remote.conf \ *-musl) suffix="-musl"
esac
install -Dm644 ${XBPS_DISTDIR}/etc/xbps.d/repos-remote${suffix}.conf \
$crossconfdir/20-repository-remote.conf $crossconfdir/20-repository-remote.conf
;; fi
esac
fi fi
fi fi

View File

@ -0,0 +1,4 @@
# aarch64 voidlinux remote repositories
repository=https://alpha.de.repo.voidlinux.org/current/aarch64
repository=https://alpha.de.repo.voidlinux.org/current/aarch64/nonfree
repository=https://alpha.de.repo.voidlinux.org/current/aarch64/debug