switched status page to a dark theme, added archweb links

This commit is contained in:
2021-11-21 15:24:27 +01:00
parent 7347c7705b
commit 8c1e8c1835
4 changed files with 53 additions and 54 deletions

View File

@@ -16,6 +16,7 @@ import (
"os"
"os/exec"
"path/filepath"
"regexp"
"strconv"
"strings"
"sync"
@@ -30,6 +31,12 @@ const (
lastUpdate = "lastupdate"
)
var (
reMarch = regexp.MustCompile(`(-march=)(.+?) `)
rePkgRel = regexp.MustCompile(`(?m)^pkgrel\s*=\s*(.+)$`)
rePkgFile = regexp.MustCompile(`^(.+)(?:-.+){2}-(?:x86_64|any)\.pkg\.tar\.zst(?:\.sig)*$`)
)
type BuildPackage struct {
Pkgbase string
Pkgbuild string
@@ -135,25 +142,6 @@ func containsSubStr(str string, subList []string) bool {
return false
}
func statusId2string(s dbpackage.Status) (string, string) {
switch s {
case dbpackage.StatusSkipped:
return "SKIPPED", "table-" + conf.Status.Class.Skipped
case dbpackage.StatusQueued:
return "QUEUED", "table-" + conf.Status.Class.Queued
case dbpackage.StatusLatest:
return "LATEST", "table-" + conf.Status.Class.Latest
case dbpackage.StatusFailed:
return "FAILED", "table-" + conf.Status.Class.Failed
case dbpackage.StatusSigning:
return "SIGNING", "table-" + conf.Status.Class.Signing
case dbpackage.StatusBuilding:
return "BUILDING", "table-" + conf.Status.Class.Building
default:
return "UNKNOWN", "table-" + conf.Status.Class.Unknown
}
}
func (p *BuildPackage) repoVersion() (string, error) {
err := p.findPkgFiles()
if err != nil {
@@ -578,7 +566,7 @@ func housekeeping(repo string, wg *sync.WaitGroup) error {
buildManager.alpmMutex.Unlock()
if err != nil || pkgResolved.DB().Name() != pkg.DbPackage.Repository.String() {
// package not found on mirror/db -> not part of any repo anymore
log.Infof("[HK/%s/%s] not part of repo", pkg.FullRepo, pkg.Pkgbase)
log.Infof("[HK/%s/%s] not included in repo", pkg.FullRepo, pkg.Pkgbase)
buildManager.repoPurge[pkg.FullRepo] <- pkg
err = db.DbPackage.DeleteOne(pkg.DbPackage).Exec(context.Background())
if err != nil {