smarter IsReadOnly() logic

This commit is contained in:
Jeff Carr 2024-12-03 13:23:55 -06:00
parent 135f1e5f42
commit 0fa1ea471f
4 changed files with 10 additions and 18 deletions

View File

@ -107,7 +107,7 @@ func goodGodeps(repo *repolist.RepoRow) bool {
for deps.Scan() {
depRepo := deps.Next()
// log.Info("found dep", depRepo.GetGoPath())
if me.forge.IsReadOnly(depRepo.GetGoPath()) {
if me.forge.Config.IsReadOnly(depRepo.GoPath) {
// log.Info("IsReadOnly = true", depRepo.GetGoPath())
continue
} else {
@ -156,7 +156,7 @@ func fixGodeps(check *gitpb.Repo) bool {
for deps.Scan() {
depRepo := deps.Next()
// log.Info("found dep", depRepo.GetGoPath())
if me.forge.IsReadOnly(depRepo.GetGoPath()) {
if me.forge.Config.IsReadOnly(depRepo.GoPath) {
log.Info("IsReadOnly = true", depRepo.GetGoPath())
continue
} else {

View File

@ -25,7 +25,7 @@ func PrintReport(readonly string, onlydirty string, perfect string) {
continue
}
if repo.ReadOnly() {
if me.forge.Config.IsReadOnly(repo.GoPath()) {
if readonly == "true" {
log.Info(header + "readonly")
}
@ -60,28 +60,21 @@ func PrintReleaseReport(readonly string, perfect string) {
log.Info(repolist.ReleaseReportHeader())
loop := me.repos.View.ReposSortByName()
loop := me.forge.Repos.SortByGoPath()
for loop.Scan() {
repo := loop.Repo()
if repo.ReadOnly() && (readonly == "true") {
check := loop.Next()
if me.forge.IsReadOnly(check) {
continue
}
if (repo.State() == "PERFECT") && (perfect == "true") {
continue
}
if repo.Status.IsReleased() {
if check.GetCurrentBranchVersion() == check.GetTargetVersion() {
continue
}
count += 1
header := repo.StandardReleaseHeader()
log.Info(header)
check := me.forge.Repos.FindByGoPath(repo.GoPath())
if check == nil {
log.Info("boo, you didn't git clone", repo.GoPath())
log.Info("boo, you didn't git clone", check.GoPath)
continue
}
log.Info(me.forge.StandardReleaseHeader(check, repo.State()))
log.Info(me.forge.StandardReleaseHeader(check, ""))
}
log.Info(fmt.Sprintf("total repo count = %d", count))
}

View File

@ -110,7 +110,7 @@ func main() {
loop := me.repos.View.ReposSortByName()
for loop.Scan() {
repo := loop.Repo()
if me.forge.IsReadOnly(repo.GoPath()) {
if me.forge.Config.IsReadOnly(repo.GoPath()) {
repo.Status.SetReadOnly(true)
} else {
repo.Status.SetReadOnly(false)

View File

@ -91,7 +91,6 @@ func makePrepareRelease() {
repo.Status.IncrementRevisionVersion("godeps changed")
target := repo.Status.GetTargetVersion()
check.SetTargetVersion(target)
continue
}
}