Skip to content

Commit

Permalink
Merge pull request #96 from infosiftr/rpm-host-arch
Browse files Browse the repository at this point in the history
Add RPM support to `bashbrew-host-arch.sh` (via querying RPM's own architecture)
  • Loading branch information
yosifkit authored May 29, 2024
2 parents 12c7580 + 6c47dbb commit 10343d3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/bashbrew-host-arch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ if command -v apk > /dev/null && tryArch="$(apk --print-arch)"; then
arch="$tryArch"
elif command -v dpkg > /dev/null && tryArch="$(dpkg --print-architecture)"; then
arch="${tryArch##*-}"
elif command -v rpm > /dev/null && tryArch="$(rpm --query --queryformat='%{ARCH}' rpm)"; then
arch="$tryArch"
elif command -v uname > /dev/null && tryArch="$(uname -m)"; then
echo >&2 "warning: neither of 'dpkg' or 'apk' found, falling back to 'uname'"
arch="$tryArch"
Expand All @@ -28,7 +30,8 @@ case "$arch" in
amd64 | x86_64) found 'amd64' ;;
arm64 | aarch64) found 'arm64v8' ;;
armel) found 'arm32v5' ;;
armv7) found 'arm32v7' ;;
armv6*) found 'arm32v6' ;;
armv7*) found 'arm32v7' ;;
i[3456]86 | x86) found 'i386' ;;
mips64el) found 'mips64le' ;; # TODO "uname -m" is just "mips64" (which is also "apk --print-arch" on big-endian MIPS) so we ought to disambiguate that somehow
ppc64el | ppc64le) found 'ppc64le' ;;
Expand Down

0 comments on commit 10343d3

Please sign in to comment.