forked from rosa/hakurei
Compare commits
2 Commits
50649fdbf4
...
7011f8a580
| Author | SHA1 | Date | |
|---|---|---|---|
|
7011f8a580
|
|||
|
dac33d7720
|
@@ -1,6 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"slices"
|
"slices"
|
||||||
"strings"
|
"strings"
|
||||||
"unique"
|
"unique"
|
||||||
@@ -26,6 +27,7 @@ type packageIndex struct {
|
|||||||
|
|
||||||
// metadata holds [rosa.Metadata] extended with additional information.
|
// metadata holds [rosa.Metadata] extended with additional information.
|
||||||
type metadata struct {
|
type metadata struct {
|
||||||
|
p rosa.PArtifact
|
||||||
*rosa.Metadata
|
*rosa.Metadata
|
||||||
|
|
||||||
// Populated via [rosa.Toolchain.Version], [rosa.Unversioned] is equivalent
|
// Populated via [rosa.Toolchain.Version], [rosa.Unversioned] is equivalent
|
||||||
@@ -50,9 +52,17 @@ func (index *packageIndex) populate(cache *pkg.Cache, report *rosa.Report) (err
|
|||||||
index.names = make(map[string]*metadata)
|
index.names = make(map[string]*metadata)
|
||||||
for p := range rosa.PresetUnexportedStart {
|
for p := range rosa.PresetUnexportedStart {
|
||||||
m := metadata{
|
m := metadata{
|
||||||
|
p: p,
|
||||||
|
|
||||||
Metadata: rosa.GetMetadata(p),
|
Metadata: rosa.GetMetadata(p),
|
||||||
Version: rosa.Std.Version(p),
|
Version: rosa.Std.Version(p),
|
||||||
}
|
}
|
||||||
|
if m.Version == "" {
|
||||||
|
return errors.New("invalid version from " + m.Name)
|
||||||
|
}
|
||||||
|
if m.Version == rosa.Unversioned {
|
||||||
|
m.Version = ""
|
||||||
|
}
|
||||||
|
|
||||||
if cache != nil && report != nil {
|
if cache != nil && report != nil {
|
||||||
m.ident = cache.Ident(rosa.Std.Load(p))
|
m.ident = cache.Ident(rosa.Std.Load(p))
|
||||||
|
|||||||
Reference in New Issue
Block a user