summaryrefslogtreecommitdiff
path: root/buildDeb.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-01-20 01:40:14 -0600
committerJeff Carr <[email protected]>2025-01-20 01:40:14 -0600
commitfb372aad6f0cca032c1ed7577cd7747b4daca7fb (patch)
tree32dd9c7e763a1b3241518db4f80bb29479e41a69 /buildDeb.go
parent96f2795bf3a96bdc9929ea1015590bb4695c4de0 (diff)
code rearangev0.0.18v0.0.17
Diffstat (limited to 'buildDeb.go')
-rw-r--r--buildDeb.go79
1 files changed, 0 insertions, 79 deletions
diff --git a/buildDeb.go b/buildDeb.go
deleted file mode 100644
index 2761eb7..0000000
--- a/buildDeb.go
+++ /dev/null
@@ -1,79 +0,0 @@
-package main
-
-import (
- "fmt"
- "os"
- "path/filepath"
-
- "go.wit.com/lib/protobuf/gitpb"
- "go.wit.com/log"
-)
-
-func buildDeb() {
- if argv.DryRun {
- return
- }
- log.DaemonMode(true)
- defer log.DaemonMode(false)
-
- all := me.forge.Repos.SortByFullPath()
- for all.Scan() {
- var cmd []string
- check := all.Next()
-
- if state[check] != "need to build" {
- // log.Info("skipping build for", check.GetGoPath(), state[check])
- continue
- }
-
- outdir := getOutdir(check)
- os.MkdirAll(outdir, 0755)
-
- _, err := os.Stat(filepath.Join(outdir, debnames[check]))
- if err == nil {
- if debnames[check] == "" {
- log.Info("something went wrong. .deb blank", check.GetGoPath())
- }
- // already built
- continue
- }
-
- if argv.Release {
- cmd = []string{"go-deb", "--release", "--auto", "--forge", check.GetGoPath(), "--dir", outdir}
- } else {
- cmd = []string{"go-deb", "--auto", "--no-gui", "--forge", check.GetGoPath(), "--dir", outdir}
- }
- if me.forge.Config.IsPrivate(check.GetGoPath()) {
- cmd = []string{"go-deb", "--auto", "--forge", check.GetGoPath(), "--dir", outdir}
- }
- log.Info("build cmd:", cmd)
- if r := check.RunRealtime(cmd); r.Error != nil {
- log.Info("go-deb failed error:", r.Error, check.GetGoPath())
- failed[check] = fmt.Sprint("godeb failed", cmd, "with", r.Exit, r.Error)
- } else if r.Exit != 0 {
- log.Info("go-deb failed exit =", r.Exit, check.GetGoPath())
- failed[check] = fmt.Sprint("godeb failed", cmd, "with", r.Exit, r.Error)
- } else {
- log.Info("build worked")
- }
- }
-}
-
-func getOutdir(repo *gitpb.Repo) string {
- if repo.GetLastTag() != repo.GetMasterVersion() {
- return "/home/jcarr/incoming-devel"
- }
-
- if repo.GetCurrentBranchVersion() != repo.GetMasterVersion() {
- return "/home/jcarr/incoming-devel"
- }
-
- if repo.CheckDirty() {
- return "/home/jcarr/incoming-devel"
- }
-
- if me.forge.Config.IsPrivate(repo.GetGoPath()) {
- return "/home/jcarr/incoming-private"
- }
- return "/home/jcarr/incoming"
-}