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 (
"brunel/domain"
"strings"
"errors"
@ -11,6 +12,9 @@ import (
var queue = haxmap.New[string, domain.BuildQueueItem]()
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 {
return errors.New("package already in queue")
}

View File

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