mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-04-06 18:36:50 +00:00
fix(classify): add package-specific overrides for sass, ffmpeg, go arm
- sass: bare arm → armv7 (Dart Sass targets ARMv7, not v6) - ffmpeg: Windows .gz → ext exe (gzipped bare executables) - go: keep bare arm as-is from Go dist API (matches production) Reduces comparecache diffs from 6 packages to 3 (iterm2 channel edge cases, postgres legacy ext, terraform alpha detection — all understood).
This commit is contained in:
@@ -22,6 +22,7 @@ import (
|
||||
"github.com/webinstall/webi-installers/internal/rawcache"
|
||||
"github.com/webinstall/webi-installers/internal/releases/bun"
|
||||
"github.com/webinstall/webi-installers/internal/releases/chromedist"
|
||||
"github.com/webinstall/webi-installers/internal/releases/ffmpeg"
|
||||
"github.com/webinstall/webi-installers/internal/releases/fish"
|
||||
"github.com/webinstall/webi-installers/internal/releases/gitea"
|
||||
"github.com/webinstall/webi-installers/internal/releases/flutterdist"
|
||||
@@ -37,6 +38,7 @@ import (
|
||||
"github.com/webinstall/webi-installers/internal/releases/ollama"
|
||||
"github.com/webinstall/webi-installers/internal/releases/pwsh"
|
||||
"github.com/webinstall/webi-installers/internal/releases/postgres"
|
||||
"github.com/webinstall/webi-installers/internal/releases/sass"
|
||||
"github.com/webinstall/webi-installers/internal/releases/watchexec"
|
||||
"github.com/webinstall/webi-installers/internal/releases/xcaddy"
|
||||
"github.com/webinstall/webi-installers/internal/releases/zigdist"
|
||||
@@ -149,6 +151,8 @@ func TagVariants(pkg string, assets []storage.Asset) {
|
||||
switch pkg {
|
||||
case "bun":
|
||||
bun.TagVariants(assets)
|
||||
case "ffmpeg":
|
||||
ffmpeg.TagVariants(assets)
|
||||
case "fish":
|
||||
fish.TagVariants(assets)
|
||||
case "git":
|
||||
@@ -163,6 +167,8 @@ func TagVariants(pkg string, assets []storage.Asset) {
|
||||
ollama.TagVariants(assets)
|
||||
case "pwsh":
|
||||
pwsh.TagVariants(assets)
|
||||
case "sass":
|
||||
sass.TagVariants(assets)
|
||||
case "xcaddy":
|
||||
xcaddy.TagVariants(assets)
|
||||
}
|
||||
@@ -877,7 +883,9 @@ func normalizeGoArch(goarch string) string {
|
||||
case "386":
|
||||
return "x86"
|
||||
case "arm":
|
||||
return "armv6"
|
||||
// Go API uses bare "arm" — keep as-is to match production.
|
||||
// The resolver handles arm compatibility (armv7→armv6 fallback).
|
||||
return "arm"
|
||||
case "ppc64le":
|
||||
return "ppc64le"
|
||||
case "ppc64":
|
||||
|
||||
29
internal/releases/ffmpeg/variants.go
Normal file
29
internal/releases/ffmpeg/variants.go
Normal file
@@ -0,0 +1,29 @@
|
||||
// Package ffmpeg provides variant tagging for ffmpeg-static releases.
|
||||
//
|
||||
// ffmpeg-static publishes bare executables for Windows. The .gz files
|
||||
// are gzip-compressed bare executables (not archives). Production
|
||||
// classifies these as ext "exe".
|
||||
package ffmpeg
|
||||
|
||||
import (
|
||||
"github.com/webinstall/webi-installers/internal/storage"
|
||||
)
|
||||
|
||||
// TagVariants fixes Windows asset extensions for ffmpeg.
|
||||
//
|
||||
// Windows .gz files contain a gzipped bare executable, not a tar archive.
|
||||
// Production treats these as ext "exe". Bare Windows files (no extension)
|
||||
// are also executables.
|
||||
func TagVariants(assets []storage.Asset) {
|
||||
for i := range assets {
|
||||
if assets[i].OS != "windows" {
|
||||
continue
|
||||
}
|
||||
switch assets[i].Format {
|
||||
case ".gz":
|
||||
assets[i].Format = ".exe"
|
||||
case "":
|
||||
assets[i].Format = ".exe"
|
||||
}
|
||||
}
|
||||
}
|
||||
19
internal/releases/sass/variants.go
Normal file
19
internal/releases/sass/variants.go
Normal file
@@ -0,0 +1,19 @@
|
||||
// Package sass provides variant tagging for Dart Sass releases.
|
||||
//
|
||||
// Dart Sass uses bare "arm" in filenames to mean ARMv7 (the Dart VM's
|
||||
// minimum ARM target). The generic classifier maps bare "arm" to armv6,
|
||||
// so we correct it here.
|
||||
package sass
|
||||
|
||||
import (
|
||||
"github.com/webinstall/webi-installers/internal/storage"
|
||||
)
|
||||
|
||||
// TagVariants remaps bare arm → armv7 for Dart Sass assets.
|
||||
func TagVariants(assets []storage.Asset) {
|
||||
for i := range assets {
|
||||
if assets[i].Arch == "armv6" {
|
||||
assets[i].Arch = "armv7"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user