summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-08 06:32:36 -0500
committerJeff Carr <[email protected]>2025-10-08 06:32:36 -0500
commit6ee19a4e85ba449555f6fe0e51338e2d9882f611 (patch)
tree151a5fff2f744e9f281bd7ae5ee7c668c4dc276e
parent02527b3b11f23edb3cdafea6c0b46bc4cf3a4bed (diff)
maybe always return this way
-rw-r--r--doBuild.debian.go14
-rw-r--r--doBuild.go14
2 files changed, 14 insertions, 14 deletions
diff --git a/doBuild.debian.go b/doBuild.debian.go
index d037859..76a56f7 100644
--- a/doBuild.debian.go
+++ b/doBuild.debian.go
@@ -16,19 +16,18 @@ import (
var totalBuilt int
-func doBuildDeb() error {
+func doBuildDeb() (string, 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
+ return "Error during globbing", err
}
if len(files) > 0 {
cmd := []string{"rm"}
cmd = append(cmd, files...)
_, err := fhelp.RunRealtimeError(cmd)
- return err
+ return "rm incoming/* failed", err
}
initForge()
@@ -54,13 +53,12 @@ func doBuildDeb() error {
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 "ERROR WITH buildDeb " + s, stat.Err
}
}
if totalBuilt == 0 {
// nothing built, no need to talk to mirrors
- return nil
+ return "everything is current", nil
}
if _, err := shell.RunVerbose([]string{"ls", "-l", "/home/jcarr/incoming"}); err != nil {
@@ -70,7 +68,7 @@ func doBuildDeb() error {
if _, err := fhelp.RunRealtimeError([]string{"do-aptly"}); err != nil {
me.sh.BadExit("aptly failed", nil)
}
- return nil
+ return "all .deb built ok", nil
}
// avoids nil panics
diff --git a/doBuild.go b/doBuild.go
index 0032590..90b04c1 100644
--- a/doBuild.go
+++ b/doBuild.go
@@ -13,7 +13,7 @@ import (
"go.wit.com/log"
)
-func doBuild() error {
+func doBuild() (string, error) {
if argv.Build.Install != nil {
if err := doInstall(); err != nil {
// log.Info("doInstall() failed", err)
@@ -23,16 +23,18 @@ func doBuild() error {
}
if argv.Build.MacBuild != nil {
- log.Info("todo: add mac builds")
- return nil
+ return "todo: add mac builds", nil
}
if argv.Build.Debian != nil {
- doBuildDeb()
- me.sh.GoodExit("")
+ if err := doInstall(); err != nil {
+ // log.Info("doInstall() failed", err)
+ me.sh.BadExit("doInstall() failed", err)
+ }
+ return doBuildDeb()
}
- return nil
+ return "todo: doBuild()", nil
}
func doInstall() error {