diff options
| author | Jeff Carr <[email protected]> | 2025-10-03 15:04:11 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-03 15:04:11 -0500 |
| commit | deed575dd7f1ef60477065f6e543a57faa08aa4d (patch) | |
| tree | 62ce201144c3be3b214d4e45898e1c1a6a35ff8a /doDebian.go | |
| parent | f19039b4ae20fbf01248da9fbdf97ef93c7080d0 (diff) | |
working through logic to improve the codev0.1.2
Diffstat (limited to 'doDebian.go')
| -rw-r--r-- | doDebian.go | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/doDebian.go b/doDebian.go index 333b99f..0a2617a 100644 --- a/doDebian.go +++ b/doDebian.go @@ -4,7 +4,6 @@ package main import ( - "fmt" "os" "path/filepath" @@ -28,6 +27,7 @@ func doDebian() { } initForge() + doInstallScan() found := gitpb.NewRepos() for check := range me.forge.Repos.IterAll() { @@ -46,31 +46,31 @@ func doDebian() { } me.forge.PrintForgedTable(found) - if argv.DryRun { - doInstallScan() - okExit("") - } - - me.forge.ConfigRill(16, 16) - stats := me.forge.RunOnRepos(found, doInstallRepo) - for s, stat := range stats { - if stat.Err == nil { - continue + if !argv.DryRun { + me.forge.ConfigRill(16, 16) + stats := me.forge.RunOnRepos(found, doInstallRepo) + for s, stat := range stats { + if stat.Err == nil { + continue + } + dur := stat.End.Sub(stat.Start) + log.Info("CRAP. INSTALL FAILED", shell.FormatDuration(dur), s, stat.Err) + badExit(stat.Err) } - dur := stat.End.Sub(stat.Start) - log.Info("CRAP. INSTALL FAILED", shell.FormatDuration(dur), s, stat.Err) - badExit(stat.Err) } me.forge.ConfigRill(16, 16) log.Info("STARTING .deb BUILDS repo len =", found.Len()) - stats = me.forge.RunOnRepos(found, buildDeb) + stats := me.forge.RunOnRepos(found, buildDeb) for s, stat := range stats { - log.Info(s, stat.Err) if stat.Err != nil { + log.Info("ERROR WITH buildDeb", s, stat.Err) badExit(stat.Err) } } + if argv.DryRun { + return + } exitOnErrorRealtime([]string{"do-aptly"}) } @@ -91,9 +91,6 @@ func buildDeb(check *gitpb.Repo) error { return nil } - // computes the state hash todo: move this logic into the protobuf - doInstallScan() - if argv.Force { // build everything no matter what } else { @@ -115,7 +112,6 @@ func buildDeb(check *gitpb.Repo) error { var err error if _, err = check.RunVerboseOnError(cmd); err != nil { log.Info(check.FullPath, cmd) - failed[check] = fmt.Sprint("godeb failed", cmd, "with", err) return err } |
