fix: use single output format for alt list and alr list -I
All checks were successful
Pre-commit / pre-commit (pull_request) Successful in 5m25s
Update alr-git / changelog (push) Successful in 22s
Create Release / changelog (push) Successful in 2m38s

This commit is contained in:
2025-07-09 20:38:24 +03:00
parent f42be105ad
commit aa08c04e0c
9 changed files with 126 additions and 29 deletions

View File

@ -22,6 +22,7 @@ package overrides
import (
"fmt"
"regexp"
"strconv"
"strings"
"golang.org/x/exp/slices"
@ -182,3 +183,18 @@ func ReleasePlatformSpecific(release int, info *distro.OSRelease) string {
return fmt.Sprintf("%d", release)
}
func ParseReleasePlatformSpecific(s string, info *distro.OSRelease) (int, error) {
if info.ID == "altlinux" {
if strings.HasPrefix(s, "alt") {
return strconv.Atoi(s[3:])
}
}
if info.ID == "fedora" || slices.Contains(info.Like, "fedora") {
parts := strings.SplitN(s, ".", 2)
return strconv.Atoi(parts[0])
}
return strconv.Atoi(s)
}