From 7a342e5286d57a577942d1d795dbb664d235c1a4 Mon Sep 17 00:00:00 2001 From: Jean Francois Pambrun Date: Thu, 9 Feb 2023 09:55:31 -0500 Subject: [PATCH] Use specific arch and forgo defaults The default idea doesn't really work as it pick the first assed matching, not the best one. ppc64 and ppc32 would break the heuristic based on ordering. --- handler/strings.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/handler/strings.go b/handler/strings.go index d9e4091..a67d352 100644 --- a/handler/strings.go +++ b/handler/strings.go @@ -6,7 +6,7 @@ import ( ) var ( - archRe = regexp.MustCompile(`(arm64|arm|386|amd64|x86_64|aarch64|32|64)`) + archRe = regexp.MustCompile(`(arm64|arm|386|amd64|x86_64|aarch64|i686)`) fileExtRe = regexp.MustCompile(`(\.[a-z][a-z0-9]+)+$`) posixOSRe = regexp.MustCompile(`(darwin|linux|(net|free|open)bsd|mac|osx|windows|win)`) checksumRe = regexp.MustCompile(`(checksums|sha256sums)`) @@ -28,9 +28,9 @@ func getArch(s string) string { s = strings.ToLower(s) a := archRe.FindString(s) //arch modifications - if a == "64" || a == "x86_64" || a == "" { - a = "amd64" //default - } else if a == "32" { + if a == "x86_64" || a == "" { + a = "amd64" + } else if a == "i686" { a = "386" } else if a == "aarch64" { a = "arm64"