summaryrefslogtreecommitdiff
path: root/doDebian.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-07 10:39:25 -0500
committerJeff Carr <[email protected]>2025-10-07 10:39:25 -0500
commit379e4b04802d852fea8e3daf03cb85d15a1bb0db (patch)
treea04e1c28eec22e9ab64cb4bf9147bbb9413eacf0 /doDebian.go
parentb843bce3c30d8139f29e3ca4b4e998bc0bd4053d (diff)
code rearrange
Diffstat (limited to 'doDebian.go')
-rw-r--r--doDebian.go78
1 files changed, 8 insertions, 70 deletions
diff --git a/doDebian.go b/doDebian.go
index 37c0315..8e036f6 100644
--- a/doDebian.go
+++ b/doDebian.go
@@ -12,8 +12,7 @@ import (
"go.wit.com/log"
)
-func doDebian() error {
- initForge()
+func doBuildDeb() error {
// clean out old deb files
globPattern := filepath.Join(me.homedir, "incoming", "*.deb")
files, err := filepath.Glob(globPattern)
@@ -28,7 +27,7 @@ func doDebian() error {
return err
}
- // doInstallScan()
+ initForge()
found := gitpb.NewRepos()
for check := range me.forge.Repos.IterAll() {
@@ -45,32 +44,15 @@ func doDebian() error {
printPackagingTable(found)
- // func (f *Forge) isInstalled(repo *gitpb.Repo) string {
- // return "X"
- // }
-
- 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)
+ me.forge.ConfigRill(16, 16)
+ log.Info("STARTING .deb BUILDS repo len =", found.Len())
+ stats := me.forge.RunOnRepos(found, buildDeb)
+ for s, stat := range stats {
+ if stat.Err != nil {
+ log.Info("ERROR WITH buildDeb", s, stat.Err)
return stat.Err
}
}
-
- if err := doOnlyDebianPackages(); err != nil {
- return err
- }
-
- if !argv.DryRun {
- _, err = shell.RunRealtimeError([]string{"do-aptly"})
- return err
- }
-
return nil
}
@@ -151,47 +133,3 @@ func getOutdir(repo *gitpb.Repo) string {
return "/home/jcarr/incoming"
}
-
-func doOnlyDebianPackages() error {
- // clean out old deb files
- globPattern := filepath.Join(me.homedir, "incoming", "*.deb")
- files, err := filepath.Glob(globPattern)
- if err != nil {
- log.Info("Error during globbing:", err)
- return err
- }
- if len(files) > 0 {
- cmd := []string{"rm"}
- cmd = append(cmd, files...)
- _, err := shell.RunRealtimeError(cmd)
- return err
- }
-
- initForge()
-
- found := gitpb.NewRepos()
- for check := range me.forge.Repos.IterAll() {
- if me.forge.Config.IsReadOnly(check.GetNamespace()) {
- continue
- }
-
- if !check.IsBinary() {
- continue
- }
-
- found.Append(check)
- }
-
- printPackagingTable(found)
-
- me.forge.ConfigRill(16, 16)
- log.Info("STARTING .deb BUILDS repo len =", found.Len())
- stats := me.forge.RunOnRepos(found, buildDeb)
- for s, stat := range stats {
- if stat.Err != nil {
- log.Info("ERROR WITH buildDeb", s, stat.Err)
- return stat.Err
- }
- }
- return nil
-}