Fix issue with getting newest package version + upgrade to go 1.23 RC2
This commit is contained in:
parent
ee57200fb4
commit
b766d5ef80
2
go.mod
2
go.mod
@ -1,6 +1,6 @@
|
||||
module brunel
|
||||
|
||||
go 1.22.5
|
||||
go 1.23
|
||||
|
||||
require (
|
||||
github.com/alphadose/haxmap v1.4.0
|
||||
|
@ -246,20 +246,21 @@ func processPackageResult(packages *haxmap.Map[string, domain.SourcePackage], re
|
||||
})
|
||||
return true
|
||||
}
|
||||
|
||||
pk.Version = getHighestVer(pk.Version, newPkg.Version)
|
||||
pkg, ok := pk.Packages.Get(newKey)
|
||||
if !ok {
|
||||
pk.Packages.Set(newKey, newPkg)
|
||||
return true
|
||||
}
|
||||
mVer, _ := version.Parse(pkg.Version)
|
||||
extVer, _ := version.Parse(strings.Split(newPkg.Version, "+b")[0])
|
||||
cmpVal := version.Compare(extVer, mVer)
|
||||
if cmpVal >= 0 {
|
||||
pk.Version = getHighestVer(pkg.Version, newPkg.Version)
|
||||
pk.Packages.Set(newKey, newPkg)
|
||||
packages.Set(newPkg.Source, pk)
|
||||
return true
|
||||
} else {
|
||||
mVer, _ := version.Parse(pkg.Version)
|
||||
extVer, _ := version.Parse(strings.Split(newPkg.Version, "+b")[0])
|
||||
cmpVal := version.Compare(extVer, mVer)
|
||||
if cmpVal >= 0 {
|
||||
pk.Packages.Set(newKey, newPkg)
|
||||
}
|
||||
}
|
||||
|
||||
packages.Set(newPkg.Source, pk)
|
||||
return true
|
||||
})
|
||||
}
|
||||
@ -285,9 +286,9 @@ func ProcessStalePackages(internalPackages *haxmap.Map[string, domain.SourcePack
|
||||
if ver != matchedPackage.Version {
|
||||
matchedPackage.NewVersion = ver
|
||||
matchedPackage.Status = domain.Stale
|
||||
internalPackages.Set(newPackage, matchedPackage)
|
||||
}
|
||||
|
||||
internalPackages.Set(newPackage, matchedPackage)
|
||||
return true
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user