diff options
| -rw-r--r-- | Makefile | 12 | ||||
| -rw-r--r-- | argv.go | 9 | ||||
| -rw-r--r-- | doRepos.go | 24 | ||||
| -rw-r--r-- | handleRepos.go | 2 |
4 files changed, 36 insertions, 11 deletions
@@ -4,8 +4,8 @@ VERSION = $(shell git describe --tags) # BUILDTIME = $(shell date +%Y.%m.%d_%H%M) BUILDTIME = $(shell date +%s) -all: build - ./forged repos +all: install + forged repos build: goimports GO111MODULE=off go build \ @@ -36,13 +36,13 @@ start: stop: -systemctl stop forged.service -run: build stop - ./forged --daemon +run: install stop + forged --daemon # setcap 'cap_net_bind_service=+ep' forged # allow the binary to open ports below 1024 # -run-clean: build +run-clean: install -rm /var/lib/forged/all-patches.pb - ./forged --daemon + forged --daemon # setcap 'cap_net_bind_service=+ep' forged # allow the binary to open ports below 1024 prod: build @@ -39,10 +39,11 @@ type PatchCmd struct { } type ReposCmd struct { - List *EmptyCmd `arg:"subcommand:list" help:"list the repos"` - Pull *EmptyCmd `arg:"subcommand:pull" help:"'git pull' on the repos"` - Scan *EmptyCmd `arg:"subcommand:scan" help:"scan the forged repo dir"` - Fix *EmptyCmd `arg:"subcommand:fix" help:"try to fix the repo PB"` + List *EmptyCmd `arg:"subcommand:list" help:"list the repos"` + Pull *EmptyCmd `arg:"subcommand:pull" help:"'git pull' on the repos"` + Scan *EmptyCmd `arg:"subcommand:scan" help:"scan the forged repo dir"` + Fix *EmptyCmd `arg:"subcommand:fix" help:"try to fix the repo PB"` + Devel *EmptyCmd `arg:"subcommand:devel" help:"list repos with devel branches"` // Reload *EmptyCmd `arg:"subcommand:reload" help:"do Reload() on each git repo"` // Clean *EmptyCmd `arg:"subcommand:clean" help:"clean the repos"` // Merge *EmptyCmd `arg:"subcommand:merge" help:"merge in new patchsets"` @@ -19,6 +19,17 @@ func doRepos() error { // return doReposList() return nil } + if argv.Repos.Devel != nil { + found := gitpb.NewRepos() + for repo := range me.forge.Repos.IterAll() { + if repo.Tags.Devel == nil { + continue + } + found.Append(repo) + } + me.forge.PrintForgedTable(found) + return nil + } if argv.Repos.Scan != nil { log.Infof("start repos scan repos.Len()=%d %s\n", me.forge.Repos.Len(), me.forge.Config.ReposDir) @@ -47,6 +58,19 @@ func doRepos() error { } continue } + if repo.Tags.Devel == nil { + if repo.GetDevelBranchName() == "" { + repo.SetDevelBranchName("devel") + } + if found := repo.GetRemoteTag(repo.GetDevelBranchName()); found != nil { + log.Info("found devel tag ", repo.FullPath, found) + repo.Tags.Devel = proto.Clone(found).(*gitpb.GitTag) + config.SetChanged("repos", true) + } else { + // log.Info("not found devel tag (Reload() ?)", repo.FullPath) + } + continue + } } me.forge.SaveRepos() /* diff --git a/handleRepos.go b/handleRepos.go index 34cb2b5..20cf66c 100644 --- a/handleRepos.go +++ b/handleRepos.go @@ -64,7 +64,7 @@ func addRequest(pb *gitpb.Repos, reqPB *httppb.HttpRequest) *gitpb.Repos { func checkRequest(pb *gitpb.Repos, reqPB *httppb.HttpRequest) *gitpb.Repos { checkPB := gitpb.NewRepos() for repo := range pb.IterAll() { - found := me.forge.Repos.FindByNamespace(repo.Namespace) + found := me.forge.PrepareCheckRepo(repo.Namespace) if found == nil { // don't know about this continue |
