fix check in housekeeping not checking the actual no-build list

This commit is contained in:
2025-01-26 20:14:16 +01:00
parent 2e080c8268
commit 1c90e20a10
3 changed files with 9 additions and 19 deletions

View File

@@ -50,12 +50,6 @@ func housekeeping(repo, march string, wg *sync.WaitGroup) error {
Arch: *mPackage.Arch(),
}
matchNoBuild, err := MatchGlobList(pkg.Pkgbase, conf.Blacklist.Packages)
if err != nil {
log.Errorf("[HK] %s->%s error parsing no-build glob: %v", pkg.FullRepo, mPackage.Name(), err)
continue
}
// check if package is still part of repo
dbs, err := alpmHandle.SyncDBs()
if err != nil {
@@ -69,7 +63,7 @@ func housekeeping(repo, march string, wg *sync.WaitGroup) error {
pkgResolved.DB().Name() != pkg.Repo.String() ||
pkgResolved.Architecture() != pkg.Arch ||
pkgResolved.Name() != mPackage.Name() ||
matchNoBuild {
MatchGlobList(pkg.Pkgbase, conf.Blacklist.Packages) {
switch {
case err != nil:
log.Infof("[HK] %s->%s not included in repo (resolve error: %v)", pkg.FullRepo, mPackage.Name(), err)
@@ -85,7 +79,7 @@ func housekeeping(repo, march string, wg *sync.WaitGroup) error {
case pkgResolved.Name() != mPackage.Name():
log.Infof("[HK] %s->%s not included in repo (name mismatch: repo:%s != pkg:%s)", pkg.FullRepo,
mPackage.Name(), pkgResolved.Name(), mPackage.Name())
case matchNoBuild:
case MatchGlobList(pkg.Pkgbase, conf.Blacklist.Packages):
log.Infof("[HK] %s->%s not included in repo (blacklisted pkgbase %s)", pkg.FullRepo, mPackage.Name(), pkg.Pkgbase)
}
@@ -249,7 +243,7 @@ func housekeeping(repo, march string, wg *sync.WaitGroup) error {
DBPackage: dbPkg,
}
buildManager.repoPurge[fullRepo] <- []*ProtoPackage{pkg}
case dbPkg.Status == dbpackage.StatusSkipped && dbPkg.RepoVersion == "" && dbPkg.SkipReason == "blacklisted":
case dbPkg.Status == dbpackage.StatusSkipped && dbPkg.SkipReason == "blacklisted" && !MatchGlobList(pkg.Pkgbase, conf.Blacklist.Packages):
log.Infof("[HK] requeue previously blacklisted package %s->%s", fullRepo, dbPkg.Pkgbase)
err = dbPkg.Update().SetStatus(dbpackage.StatusQueued).ClearSkipReason().ClearTagRev().Exec(context.Background())
if err != nil {