(ctx context.Context)
| 392 | log.Panicf("%s while repo-add: %v", string(res), err) |
| 393 | } |
| 394 | |
| 395 | for _, pkg := range pkgL { |
| 396 | err = pkg.toDBPackage(ctx, true) |
| 397 | if err != nil { |
| 398 | log.Warningf("error getting db entry for %s: %v", pkg.Pkgbase, err) |
| 399 | continue |
| 400 | } |
| 401 | |
| 402 | pkgUpd := pkg.DBPackage.Update(). |
| 403 | SetStatus(dbpackage.StatusLatest). |
| 404 | ClearSkipReason(). |
| 405 | SetRepoVersion(pkg.Version). |
| 406 | SetTagRev(pkg.State.TagRev) |
| 407 | |
| 408 | if _, err := os.Stat(filepath.Join(conf.Basedir.Debug, pkg.March, |
| 409 | pkg.DBPackage.Packages[0]+"-debug-"+pkg.Version+"-"+conf.Arch+".pkg.tar.zst")); err == nil { |
| 410 | pkgUpd = pkgUpd.SetDebugSymbols(dbpackage.DebugSymbolsAvailable) |
| 411 | } else { |
| 412 | pkgUpd = pkgUpd.SetDebugSymbols(dbpackage.DebugSymbolsNotAvailable) |
| 413 | } |
| 414 | if pkg.DBPackage, err = pkgUpd.Save(ctx); err != nil { |
| 415 | log.Error(err) |
| 416 | } |
| 417 | } |
| 418 | |
| 419 | cmd = exec.CommandContext(ctx, "paccache", "-rc", filepath.Join(conf.Basedir.Repo, repo, "os", conf.Arch), "-k", "1") //nolint:gosec |
| 420 | res, err = cmd.CombinedOutput() |
| 421 | log.Debug(string(res)) |
| 422 | if err != nil { |
| 423 | log.Warningf("error running paccache: %v", err) |
| 424 | } |
| 425 | |
| 426 | err = updateLastUpdated() |
| 427 | if err != nil { |
| 428 | log.Warningf("error updating lastupdate: %v", err) |
| 429 | } |
| 430 | unlockRepo(repoLockFile) |
| 431 | b.repoWG.Done() |
| 432 | case fix := <-b.repoFix[repo]: |
| 433 | b.repoWG.Add(1) |
| 434 | repoLockFile := lockRepoShared() |
| 435 | dbFile := repoDBPath(repo) |
| 436 | |
| 437 | if len(fix.remove) > 0 { |
| 438 | args := append([]string{"-s", "-v", dbFile}, fix.remove...) |
| 439 | cmd := exec.CommandContext(ctx, "repo-remove", args...) |
| 440 | res, err := cmd.CombinedOutput() |
| 441 | log.Debug(string(res)) |
| 442 | if err != nil { |
| 443 | log.Warningf("[%s] error dropping stale db entries %v: %v", repo, fix.remove, err) |
| 444 | } |
| 445 | } |
| 446 | |
| 447 | if len(fix.readd) > 0 { |
| 448 | args := append([]string{"-s", "-v", "-p", "-n", dbFile}, fix.readd...) |
| 449 | cmd := exec.CommandContext(ctx, "repo-add", args...) |
| 450 | res, err := cmd.CombinedOutput() |
| 451 | log.Debug(string(res)) |
no test coverage detected