5 Commits

2 changed files with 17 additions and 4 deletions

13
main.go
View File

@@ -218,6 +218,7 @@ func (b *BuildManager) repoWorker(repo string) {
for { for {
select { select {
case pkgL := <-b.repoAdd[repo]: case pkgL := <-b.repoAdd[repo]:
b.repoWG.Add(1)
toAdd := make([]string, 0) toAdd := make([]string, 0)
for _, pkg := range pkgL { for _, pkg := range pkgL {
toAdd = append(toAdd, pkg.PkgFiles...) toAdd = append(toAdd, pkg.PkgFiles...)
@@ -263,6 +264,7 @@ func (b *BuildManager) repoWorker(repo string) {
if err != nil { if err != nil {
log.Warningf("Error updating lastupdate: %v", err) log.Warningf("Error updating lastupdate: %v", err)
} }
b.repoWG.Done()
case pkgL := <-b.repoPurge[repo]: case pkgL := <-b.repoPurge[repo]:
for _, pkg := range pkgL { for _, pkg := range pkgL {
if _, err := os.Stat(filepath.Join(conf.Basedir.Repo, pkg.FullRepo, "os", conf.Arch, pkg.FullRepo) + ".db.tar.xz"); err != nil { if _, err := os.Stat(filepath.Join(conf.Basedir.Repo, pkg.FullRepo, "os", conf.Arch, pkg.FullRepo) + ".db.tar.xz"); err != nil {
@@ -279,7 +281,13 @@ func (b *BuildManager) repoWorker(repo string) {
var realPkgs []string var realPkgs []string
for _, filePath := range pkg.PkgFiles { for _, filePath := range pkg.PkgFiles {
realPkgs = append(realPkgs, Package(filePath).Name()) if _, err := os.Stat(filePath); err == nil {
realPkgs = append(realPkgs, Package(filePath).Name())
}
}
if len(realPkgs) == 0 {
continue
} }
b.repoWG.Add(1) b.repoWG.Add(1)
@@ -293,7 +301,7 @@ func (b *BuildManager) repoWorker(repo string) {
} }
if pkg.DbPackage != nil { if pkg.DbPackage != nil {
_ = pkg.DbPackage.Update().ClearRepoVersion().Exec(context.Background()) _ = pkg.DbPackage.Update().ClearRepoVersion().ClearHash().Exec(context.Background())
} }
for _, file := range pkg.PkgFiles { for _, file := range pkg.PkgFiles {
@@ -413,7 +421,6 @@ func (b *BuildManager) syncWorker(ctx context.Context) error {
} }
if !eligible { if !eligible {
log.Debugf("skipped package %s (%v)", pkg.Pkgbase, err) log.Debugf("skipped package %s (%v)", pkg.Pkgbase, err)
b.repoPurge[pkg.FullRepo] <- []*ProtoPackage{pkg}
continue continue
} }

View File

@@ -588,6 +588,12 @@ func housekeeping(repo string, march string, wg *sync.WaitGroup) error {
} }
buildManager.repoPurge[fullRepo] <- []*ProtoPackage{pkg} buildManager.repoPurge[fullRepo] <- []*ProtoPackage{pkg}
} }
} else if dbPkg.Status == dbpackage.StatusLatest && dbPkg.RepoVersion == "" {
log.Infof("[HK] reseting missing package %s with no repo version", dbPkg.Pkgbase)
err = dbPkg.Update().SetStatus(dbpackage.StatusQueued).ClearHash().ClearRepoVersion().Exec(context.Background())
if err != nil {
return err
}
} }
} }
@@ -727,7 +733,7 @@ func setupMakepkg(march string) error {
} }
makepkgStr = strings.ReplaceAll(makepkgStr, " color ", " !color ") makepkgStr = strings.ReplaceAll(makepkgStr, " color ", " !color ")
// Add align-functions=32, see https://github.com/InBetweenNames/gentooLTO/issues/164 for more // Add align-functions=32, see https://github.com/InBetweenNames/gentooLTO/issues/164 for more
makepkgStr = strings.ReplaceAll(makepkgStr, "-O2", "-O3 -falign-functions=32 -mpclmul -fdevirtualize-at-ltrans -fgcse-sm -fgcse-las -flive-range-shrinkage -fira-loop-pressure -fsched-pressure -fmodulo-sched -fmodulo-sched-allow-regmoves -freschedule-modulo-scheduled-loops -fdelete-dead-exceptions -fgraphite -fgraphite-identity -fsplit-stack -fipa-pta -fisolate-erroneous-paths-attribute -fira-region=mixed -fsimd-cost-model=dynamic -frename-registers -fweb -ftree-vectorize -flto-partition=one -ffinite-loops") makepkgStr = strings.ReplaceAll(makepkgStr, "-O2", "-O3 -falign-functions=32 -mpclmul -fdevirtualize-at-ltrans")
makepkgStr = strings.ReplaceAll(makepkgStr, "#MAKEFLAGS=\"-j2\"", "MAKEFLAGS=\"-j"+strconv.Itoa(conf.Build.Makej)+"\"") makepkgStr = strings.ReplaceAll(makepkgStr, "#MAKEFLAGS=\"-j2\"", "MAKEFLAGS=\"-j"+strconv.Itoa(conf.Build.Makej)+"\"")
makepkgStr = reMarch.ReplaceAllString(makepkgStr, "${1}"+march) makepkgStr = reMarch.ReplaceAllString(makepkgStr, "${1}"+march)
makepkgStr = strings.ReplaceAll(makepkgStr, "#PACKAGER=\"John Doe <john@doe.com>\"", "PACKAGER=\"ALHP "+march+" <alhp@harting.dev>\"") makepkgStr = strings.ReplaceAll(makepkgStr, "#PACKAGER=\"John Doe <john@doe.com>\"", "PACKAGER=\"ALHP "+march+" <alhp@harting.dev>\"")