diff options
| author | Jeff Carr <[email protected]> | 2025-10-13 06:36:34 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-13 06:36:34 -0500 |
| commit | 5ace0a45477ef0e3d06a94cfbbee7e623a7d56c7 (patch) | |
| tree | f8ef4bfa7404115c4e86170a96cf62eaaefdb747 | |
| parent | e10076440f7824cef366369bcd3088adfe2090fc (diff) | |
try to only test install what is needed
| -rw-r--r-- | doBuild.debian.go | 35 | ||||
| -rw-r--r-- | doBuild.go | 18 | ||||
| -rw-r--r-- | doPublish.go | 2 |
3 files changed, 32 insertions, 23 deletions
diff --git a/doBuild.debian.go b/doBuild.debian.go index bf785ae..a1ec302 100644 --- a/doBuild.debian.go +++ b/doBuild.debian.go @@ -15,19 +15,8 @@ import ( "go.wit.com/log" ) -var totalBuilt int - -func doBuildDeb() (string, error) { - log.Info("STARTING DEBIAN PACKAGE BUILD") - // clean out old deb files - globPattern := filepath.Join(me.homedir, "incoming", "*.deb") - files, err := filepath.Glob(globPattern) - if len(files) > 0 { - log.Info(files, err) - log.Info("You have files in ~/incoming/") - return "incoming/ not empty", errors.New("already have incoming files") - } - +// find packages that need to be built +func findBuildDeb() *gitpb.Repos { initForge() found := gitpb.NewRepos() @@ -61,11 +50,27 @@ func doBuildDeb() (string, error) { } found.ActualSort() - footer := printPackagingTable(found) + return found +} + +var totalBuilt int + +func doBuildDeb(all *gitpb.Repos) (string, error) { + log.Info("STARTING DEBIAN PACKAGE BUILD") + // clean out old deb files + globPattern := filepath.Join(me.homedir, "incoming", "*.deb") + files, err := filepath.Glob(globPattern) + if len(files) > 0 { + log.Info(files, err) + log.Info("You have files in ~/incoming/") + return "incoming/ not empty", errors.New("already have incoming files") + } + + footer := printPackagingTable(all) log.Info("This is what will and will not be built:", footer) me.forge.ConfigRill(16, 16) - stats := me.forge.RunOnRepos(found, buildDeb) + stats := me.forge.RunOnRepos(all, buildDeb) for s, stat := range stats { if stat.Err != nil { return "ERROR WITH buildDeb " + s, stat.Err @@ -14,8 +14,10 @@ import ( ) func doBuild() (string, error) { + initForge() + if argv.Build.Install != nil { - if err := doInstall(); err != nil { + if err := doInstall(me.forge.Repos); err != nil { // log.Info("doInstall() failed", err) me.sh.BadExit("doInstall() failed", err) } @@ -27,22 +29,24 @@ func doBuild() (string, error) { } if argv.Build.Debian != nil { - if err := doInstall(); err != nil { + // figure out what to build + found := findBuildDeb() + + if err := doInstall(found); err != nil { // log.Info("doInstall() failed", err) me.sh.BadExit("doInstall() failed", err) } - return doBuildDeb() + return doBuildDeb(found) } return "todo: doBuild()", nil } -func doInstall() error { - initForge() - doInstallScan() +func doInstall(all *gitpb.Repos) error { + // doInstallScan() found := gitpb.NewRepos() - for check := range me.forge.Repos.IterAll() { + for check := range all.IterAll() { if me.forge.Config.IsReadOnly(check.Namespace) { continue } diff --git a/doPublish.go b/doPublish.go index c3ac3f9..08fcec3 100644 --- a/doPublish.go +++ b/doPublish.go @@ -48,7 +48,7 @@ func doPublish() error { time.Sleep(time.Second) me.forge.Repos.Load() - if err := doInstall(); err != nil { + if err := doInstall(me.forge.Repos); err != nil { log.Info("doInstall() failed", err) me.sh.BadExit("merge failed", nil) } |
