This commit is contained in:
ferreo 2024-07-29 23:59:30 +01:00
parent 9ac297d0c8
commit 654fcbcd67
2 changed files with 5 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package buildqueue
import ( import (
"brunel/domain" "brunel/domain"
"strings"
"errors" "errors"
@ -11,6 +12,9 @@ import (
var queue = haxmap.New[string, domain.BuildQueueItem]() var queue = haxmap.New[string, domain.BuildQueueItem]()
func Add(buildItem domain.BuildQueueItem) error { func Add(buildItem domain.BuildQueueItem) error {
if strings.Contains(buildItem.BuildVersion, "+b") {
buildItem.BuildVersion = strings.Split(buildItem.BuildVersion, "+b")[0]
}
if _, ok := queue.Get(buildItem.Source.Name); ok { if _, ok := queue.Get(buildItem.Source.Name); ok {
return errors.New("package already in queue") return errors.New("package already in queue")
} }

View File

@ -239,6 +239,7 @@ func ProcessMissingPackages(internalPackages *fastmap.Fastmap[string, domain.Sou
newStatus := domain.Missing newStatus := domain.Missing
src.Packages.Iter(func(k string, v domain.PackageInfo) bool { src.Packages.Iter(func(k string, v domain.PackageInfo) bool {
v.Status = newStatus v.Status = newStatus
v.Version = strings.Split(v.Version, "+b")[0]
src.Packages.Set(k, v) src.Packages.Set(k, v)
return true return true
}) })