From 5f5fcf3645e66492a0901b97cf5f31523a039da1 Mon Sep 17 00:00:00 2001 From: Dave Rolsky Date: Sun, 27 Oct 2024 14:52:16 -0500 Subject: [PATCH] Fix filename generation for many platforms in bootstrap scripts --- bootstrap/bootstrap-ubi.ps1 | 2 +- bootstrap/bootstrap-ubi.sh | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/bootstrap/bootstrap-ubi.ps1 b/bootstrap/bootstrap-ubi.ps1 index 2141bc3..cbf2587 100644 --- a/bootstrap/bootstrap-ubi.ps1 +++ b/bootstrap/bootstrap-ubi.ps1 @@ -1,4 +1,4 @@ -$Filename = "ubi-Windows-x86_64.zip" +$Filename = "ubi-Windows-msvc-x86_64.zip" $URL = "https://github.com/houseabsolute/ubi/releases/latest/download/$($Filename)" diff --git a/bootstrap/bootstrap-ubi.sh b/bootstrap/bootstrap-ubi.sh index a83fa8a..8d2ea7a 100755 --- a/bootstrap/bootstrap-ubi.sh +++ b/bootstrap/bootstrap-ubi.sh @@ -30,7 +30,7 @@ if [ -z "$FILENAME" ]; then OS="Linux" ;; Darwin) - OS="Darwin" + OS="macOS" ;; FreeBSD) OS="FreeBSD" @@ -40,6 +40,7 @@ if [ -z "$FILENAME" ]; then ;; MINGW*) OS="Windows" + LIBC="-msvc" EXT="zip" ;; *) @@ -54,7 +55,7 @@ if [ -z "$FILENAME" ]; then ARCH=$(uname -m) case "$ARCH" in i386 | i486 | i586 | i686) - CPU="i786" + CPU="i686" if [ "$OS" = "Linux" ]; then LIBC="-musl" fi @@ -68,11 +69,11 @@ if [ -z "$FILENAME" ]; then arm | armv5* | armv6* | armv7*) CPU="arm" if [ "$OS" = "Linux" ]; then - LIBC="-musl" + LIBC="-musleabi" fi ;; aarch64 | arm64) - CPU="aarch64" + CPU="arm64" if [ "$OS" = "Linux" ]; then LIBC="-musl" fi @@ -103,6 +104,9 @@ if [ -z "$FILENAME" ]; then ;; powerpc64le | ppc64le) CPU="powerpc64le" + if [ "$OS" = "Linux" ]; then + LIBC="-gnu" + fi ;; riscv64 | rv64gc) CPU="riscv64gc" @@ -122,7 +126,7 @@ if [ -z "$FILENAME" ]; then ;; esac - FILENAME="ubi-$OS-$CPU$LIBC.$EXT" + FILENAME="ubi-$OS$LIBC-$CPU.$EXT" fi if [ -z "$TAG" ]; then