1
0

feat!: introduce new distribution structure

BREAKING CHANGE: distro definition in the configuration files has switched

from

  [[supported_kernels]]
  distro_type = "Ubuntu"
  distro_release = "16.04"
  ...

to

  [[supported_kernels]]
  distro = { id = "Ubuntu", release = "16.04" }
  ...
This commit is contained in:
2023-05-18 16:07:24 +00:00
parent 8d2d56bea3
commit bcf8de336f
24 changed files with 219 additions and 219 deletions

18
log.go
View File

@ -114,7 +114,7 @@ func (cmd *LogDumpCmd) Run(g *Globals) (err error) {
fmt.Println("Name:", l.Name)
fmt.Println()
fmt.Println("Distro:", l.DistroType.String(), l.DistroRelease)
fmt.Println("Distro:", l.Distro.ID.String(), l.Distro.Release)
fmt.Println("Kernel:", l.KernelRelease)
fmt.Println()
@ -208,8 +208,8 @@ func (cmd *LogMarkdownCmd) Run(g *Globals) (err error) {
}
func logLogEntry(l logEntry) {
distroInfo := fmt.Sprintf("%s-%s {%s}", l.DistroType,
l.DistroRelease, l.KernelRelease)
distroInfo := fmt.Sprintf("%s-%s {%s}", l.Distro.ID,
l.Distro.Release, l.KernelRelease)
artifactInfo := fmt.Sprintf("{[%s] %s}", l.Type, l.Name)
@ -263,17 +263,17 @@ func getStats(db *sql.DB, path, tag string) (
distros = make(map[string]map[string]map[string]runstat)
for _, l := range les {
_, ok := distros[l.DistroType.String()]
_, ok := distros[l.Distro.ID.String()]
if !ok {
distros[l.DistroType.String()] = make(map[string]map[string]runstat)
distros[l.Distro.ID.String()] = make(map[string]map[string]runstat)
}
_, ok = distros[l.DistroType.String()][l.DistroRelease]
_, ok = distros[l.Distro.ID.String()][l.Distro.Release]
if !ok {
distros[l.DistroType.String()][l.DistroRelease] = make(map[string]runstat)
distros[l.Distro.ID.String()][l.Distro.Release] = make(map[string]runstat)
}
rs := distros[l.DistroType.String()][l.DistroRelease][l.KernelRelease]
rs := distros[l.Distro.ID.String()][l.Distro.Release][l.KernelRelease]
rs.All++
if l.Build.Ok {
@ -292,7 +292,7 @@ func getStats(db *sql.DB, path, tag string) (
rs.Timeout++
}
distros[l.DistroType.String()][l.DistroRelease][l.KernelRelease] = rs
distros[l.Distro.ID.String()][l.Distro.Release][l.KernelRelease] = rs
}
return