func main() { log.Printf("Loading local and remote indexes.\n") c, _ := repo.LoadConfig("/home/tag/tmp/repo") i, e := c.LoadIndex("unstable") if e != nil { panic(e) } log.Printf("%d binary package names found and loaded\n", len(*i)) repRepo := reprepro.NewRepo("/home/tag/tmp/repo") needsBuild, err := repRepo.BuildNeeding("unstable", "any") if err != nil { panic(err) } log.Printf("Computing build candidates\n") for _, status := range repo.ComputeBuildStatus(*repRepo, *i, needsBuild) { log.Printf("%s - %s (%s)\n", status.Package.Location, status.Buildable, status.Why) } }
func GetBuildNeeding(repoRoot, suite, arch string) []repo.BuildStatus { repreproRepo := reprepro.NewRepo(repoRoot) config, err := repo.LoadConfig(repreproRepo.Basedir) i, err := config.LoadIndex(suite) if err != nil { return []repo.BuildStatus{} } needsBuild, err := repreproRepo.BuildNeeding(suite, arch) if err != nil { return []repo.BuildStatus{} } return repo.ComputeBuildStatus(*repreproRepo, *i, needsBuild) }