This commit is contained in:
Jeff Carr 2024-12-17 13:11:14 -06:00
parent 36073faed5
commit a0b4dfa26e
1 changed files with 49 additions and 2 deletions

View File

@ -32,7 +32,8 @@ import (
func doCobol() { func doCobol() {
log.DaemonMode(true) log.DaemonMode(true)
log.Info(standardStart5("gopath", "cur name", "master", "user", "repo type")) // log.Info(standardStart5("gopath", "cur name", "master", "user", "repo type"))
log.Info(standardStart7("gopath", "cur name", "target", "master", "devel", "user", "repo type"))
all := me.found.SortByFullPath() all := me.found.SortByFullPath()
for all.Scan() { for all.Scan() {
repo := all.Next() repo := all.Next()
@ -70,6 +71,49 @@ func standardStart5(arg1, arg2, arg3, arg4, arg5 string) string {
return fmt.Sprintf(s, arg1, arg2, arg3, arg4, arg5) return fmt.Sprintf(s, arg1, arg2, arg3, arg4, arg5)
} }
func standardStart7(arg1, arg2, arg3, arg4, arg5, arg6, arg7 string) string {
len1 := 40
len2 := 12
len3 := 16
len4 := 16
len5 := 16
len6 := 16
len7 := 8
var s string
if len(arg1) > len1 {
arg1 = arg1[:len1]
}
s = "%-" + fmt.Sprintf("%d", len1) + "s "
if len(arg2) > len2 {
arg2 = arg2[:len2]
}
s += "%-" + fmt.Sprintf("%d", len2) + "s "
if len(arg3) > len3 {
arg3 = arg3[:len3]
}
s += "%-" + fmt.Sprintf("%d", len3) + "s "
if len(arg4) > len4 {
arg4 = arg4[:len4]
}
s += "%-" + fmt.Sprintf("%d", len4) + "s "
if len(arg5) > len5 {
arg5 = arg5[:len5]
}
s += "%-" + fmt.Sprintf("%d", len5) + "s "
if len(arg6) > len6 {
arg6 = arg6[:len6]
}
s += "%-" + fmt.Sprintf("%d", len6) + "s "
if len(arg7) > len7 {
arg7 = arg7[:len7]
}
s += "%-" + fmt.Sprintf("%d", len7) + "s"
return fmt.Sprintf(s, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
}
func verifyPrint(repo *gitpb.Repo) { func verifyPrint(repo *gitpb.Repo) {
var end string var end string
if repo.CheckDirty() { if repo.CheckDirty() {
@ -87,11 +131,13 @@ func verifyPrint(repo *gitpb.Repo) {
} }
var mhort string = s["mver"] var mhort string = s["mver"]
var dhort string = s["dver"]
var uhort string = s["uver"] var uhort string = s["uver"]
var thort string = s["tver"]
var cname string = s["cname"] var cname string = s["cname"]
// start := fmt.Sprintf("%-40s %-12s %-12s %-12s %-8s", s["gopath"], cname, mhort, uhort, s["rtype"]) // start := fmt.Sprintf("%-40s %-12s %-12s %-12s %-8s", s["gopath"], cname, mhort, uhort, s["rtype"])
start := standardStart5(s["gopath"], cname, mhort, uhort, s["rtype"]) start := standardStart7(s["gopath"], cname, thort, mhort, dhort, uhort, s["rtype"])
if me.forge.Config.IsReadOnly(repo.GetGoPath()) { if me.forge.Config.IsReadOnly(repo.GetGoPath()) {
end += "(readonly) " end += "(readonly) "
@ -137,6 +183,7 @@ func verify(repo *gitpb.Repo, s map[string]string) bool {
log.Info("verify() no user branch name", repo.GetGoPath(), repo.GetUserBranchName()) log.Info("verify() no user branch name", repo.GetGoPath(), repo.GetUserBranchName())
} }
s["cver"] = repo.GetCurrentBranchVersion() s["cver"] = repo.GetCurrentBranchVersion()
s["tver"] = repo.GetTargetVersion()
s["url"] = repo.URL s["url"] = repo.URL
return true return true