1
0
Fork 0
mirror of https://github.com/xHyroM/void-packages.git synced 2024-11-14 18:58:06 +01:00
void-packages/common/container/setup.sh

30 lines
581 B
Bash
Raw Normal View History

2024-03-29 08:12:19 +01:00
#!/bin/sh
: "${MIRROR:=https://repo-default.voidlinux.org/}"
suffix() {
case "${LIBC:?}" in
musl) echo "-musl" ;;
esac
}
repo() {
case "${ARCH:?}" in
aarch64*) echo "${MIRROR}/current/aarch64" ;;
*-musl) echo "${MIRROR}/current/musl" ;;
*) echo "${MIRROR}/current" ;;
esac
}
case "${TARGETPLATFORM:?}" in
linux/arm/v6) ARCH="armv6l$(suffix)" ;;
linux/arm/v7) ARCH="armv7l$(suffix)" ;;
linux/arm64) ARCH="aarch64$(suffix)" ;;
linux/amd64) ARCH="x86_64$(suffix)" ;;
linux/386) ARCH="i686$(suffix)" ;;
esac
REPO="$(repo)"
export ARCH REPO