diff options
| author | Jeff Carr <[email protected]> | 2024-12-14 14:09:15 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-12-14 14:09:15 -0600 |
| commit | be3841578cb466f02bbc4ea1e13e024b5a77e85d (patch) | |
| tree | 9fa2e4f2e7ac9d2cb37e955ba4717605d73a2fad | |
| parent | 268e05f1082c081f6afbc42c5f8df83aec7c6848 (diff) | |
list patches and get a patch set worksv0.22.21v0.22.20v0.22.19v0.22.18v0.22.17v0.22.16v0.22.15v0.22.14
| -rw-r--r-- | Makefile | 3 | ||||
| -rw-r--r-- | argv.go | 1 | ||||
| -rw-r--r-- | main.go | 5 | ||||
| -rw-r--r-- | send.go | 31 |
4 files changed, 40 insertions, 0 deletions
@@ -63,3 +63,6 @@ patches: install patches-localhost: install forge --do-patches --url "http://localhost:2233/" + +patches-list: install + forge --list-patches --url "http://localhost:2233/" @@ -23,6 +23,7 @@ type args struct { DoInstall bool `arg:"--do-install" help:"try to install every binary package"` DoRedoGoMod bool `arg:"--do-RedoGoMod" help:"remake all the go.sum and go.mod files"` DoPatchSet bool `arg:"--do-patches" help:"make patch set"` + ListPatchSet bool `arg:"--list-patches" help:"make patch set"` DoGui bool `arg:"--do-gui" help:"test the gui"` DryRun bool `arg:"--dry-run" help:"show what would be run"` Fix bool `arg:"--fix" help:"fix config, save config & exit"` @@ -81,6 +81,11 @@ func main() { okExit("patches") } + if argv.ListPatchSet { + listPatches() + okExit("patches") + } + // do the gui at the very end if argv.DoGui { doGui() @@ -32,6 +32,37 @@ func sendPatches(pset *forgepb.Patchs) error { return nil } +func listPatches() error { + var url string + url = me.urlbase + "/patchsetlist" + body, err := httpPost(url, nil) + if err != nil { + log.Info("httpPost() failed:", err) + return err + } + + var last string + test := strings.TrimSpace(string(body)) + for _, line := range strings.Split(test, "\n") { + log.Info("patchset:", line) + last = strings.TrimSpace(line) + } + getPatch(last) + return nil +} + +func getPatch(pbfile string) error { + url := me.urlbase + "/patchsetget?filename=" + pbfile + log.Info("getPatch() url", url) + body, err := httpPost(url, nil) + if err != nil { + log.Info("httpPost() failed:", err) + return err + } + log.Info("getPatch() len(body)", len(body)) + return nil +} + func sendDevelDiff() { pset, err := me.forge.MakeDevelPatchSet() if err != nil { |
