From 7f901fc9d583be81d7bafd7ce36bb740aeb0f304 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 11 Mar 2026 17:59:57 -0600 Subject: [PATCH] =?UTF-8?q?fix(classify):=20fix=20amd64=5FvN=20regression?= =?UTF-8?q?=20=E2=80=94=20exclude=20dash=20form=20to=20avoid=20version=20n?= =?UTF-8?q?umber=20matches?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit amd64[_-]?v2 matched syncthing filenames like 'amd64-v2.0.5' where '-v2' is the start of the release version, not an arch micro-level. Changed to amd64_?v2 (underscore optional, dash excluded) which correctly matches: - amd64v2 (no separator, original form) - amd64_v2 (underscore, pathman form) But NOT amd64-v2.0.5 (dash + version number, syncthing). --- internal/classify/classify.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/internal/classify/classify.go b/internal/classify/classify.go index 8458155..db7f323 100644 --- a/internal/classify/classify.go +++ b/internal/classify/classify.go @@ -106,9 +106,11 @@ var archPatterns = []struct { // Universal/fat binaries before specific arches. {buildmeta.ArchUniversal2, regexp.MustCompile(`(?i)` + b + `(?:universal2?|fat)` + bEnd)}, // amd64 micro-levels before baseline — "amd64v3" must not fall through to amd64. - {buildmeta.ArchAMD64v4, regexp.MustCompile(`(?i)(?:x86[_-]64[_-]v4|amd64[_-]?v4|v4-amd64)`)}, - {buildmeta.ArchAMD64v3, regexp.MustCompile(`(?i)(?:x86[_-]64[_-]v3|amd64[_-]?v3|v3-amd64)`)}, - {buildmeta.ArchAMD64v2, regexp.MustCompile(`(?i)(?:x86[_-]64[_-]v2|amd64[_-]?v2|v2-amd64)`)}, + // amd64_?vN: underscore optional but no dash — dash is ambiguous with version numbers + // (e.g. syncthing "amd64-v2.0.5" where v2 is the release version, not an arch level). + {buildmeta.ArchAMD64v4, regexp.MustCompile(`(?i)(?:x86[_-]64[_-]v4|amd64_?v4|v4-amd64)`)}, + {buildmeta.ArchAMD64v3, regexp.MustCompile(`(?i)(?:x86[_-]64[_-]v3|amd64_?v3|v3-amd64)`)}, + {buildmeta.ArchAMD64v2, regexp.MustCompile(`(?i)(?:x86[_-]64[_-]v2|amd64_?v2|v2-amd64)`)}, // amd64 baseline before x86 — "x86_64" must not match as x86. {buildmeta.ArchAMD64, regexp.MustCompile(`(?i)(?:x86[_-]64|amd64|x64|64-?bit)`)}, // arm64 before armv7/armv6 — "aarch64" must not match as arm.