summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-03 13:47:01 -0500
committerJeff Carr <[email protected]>2025-10-03 13:47:01 -0500
commite4b679003ce0847dd65254a5e0a0b3239fd0d566 (patch)
tree6d5ce5b6db6349ad5022656732d044137a624339
parent888ef5304907d0e8a98472a31728b5398972b647 (diff)
mv and merge
-rw-r--r--debian.go90
-rw-r--r--doBuild.go (renamed from doInstall.go)0
-rw-r--r--doDebian.go78
3 files changed, 78 insertions, 90 deletions
diff --git a/debian.go b/debian.go
deleted file mode 100644
index 9a888c2..0000000
--- a/debian.go
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
-// Use of this source code is governed by the GPL 3.0
-
-package main
-
-import (
- "fmt"
- "os"
-
- "go.wit.com/lib/protobuf/gitpb"
- "go.wit.com/log"
-)
-
-func buildDeb(check *gitpb.Repo) error {
- var cmd []string
-
- outdir := getOutdir(check)
- os.MkdirAll(outdir, 0755)
-
- if me.forge.Config.IsReadOnly(check.GetGoPath()) {
- return nil
- }
-
- if !check.IsBinary() {
- return nil
- }
-
- if check.IsGoPlugin() {
- return nil
- }
-
- if argv.Release {
- cmd = []string{"go-deb", "--release", "--dir", outdir}
- } else {
- cmd = []string{"go-deb", "--dir", outdir}
- }
- if me.forge.Config.IsPrivate(check.GetGoPath()) {
- cmd = []string{"go-deb", "--dir", outdir}
- return nil
- }
-
- if argv.Verbose || argv.Force {
- // log.Info("build cmd:", cmd)
- cmd = append(cmd, "--verbose")
- }
- if argv.DryRun {
- return nil
- }
-
- if argv.Force {
- // build everything no matter what
- } else {
- if state[check] != "need to build" {
- // log.Info("skipping build for", check.GetGoPath(), state[check])
- return nil
- }
- }
-
- 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
- }
-
- log.Info("build worked", cmd, check.FullPath)
- return nil
-}
-
-func getOutdir(repo *gitpb.Repo) string {
- if me.forge.Config.IsPrivate(repo.GetGoPath()) {
- return "/home/jcarr/incoming-private"
- }
- if argv.Force {
- return "/home/jcarr/incoming"
- }
- 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"
- }
-
- return "/home/jcarr/incoming"
-}
diff --git a/doInstall.go b/doBuild.go
index 28e1189..28e1189 100644
--- a/doInstall.go
+++ b/doBuild.go
diff --git a/doDebian.go b/doDebian.go
index 8d6aa3e..acd2eae 100644
--- a/doDebian.go
+++ b/doDebian.go
@@ -71,3 +71,81 @@ func doDebian() {
exitOnErrorRealtime([]string{"do-aptly"})
}
+
+func buildDeb(check *gitpb.Repo) error {
+ var cmd []string
+
+ outdir := getOutdir(check)
+ os.MkdirAll(outdir, 0755)
+
+ if me.forge.Config.IsReadOnly(check.GetGoPath()) {
+ return nil
+ }
+
+ if !check.IsBinary() {
+ return nil
+ }
+
+ if check.IsGoPlugin() {
+ return nil
+ }
+
+ if argv.Release {
+ cmd = []string{"go-deb", "--release", "--dir", outdir}
+ } else {
+ cmd = []string{"go-deb", "--dir", outdir}
+ }
+ if me.forge.Config.IsPrivate(check.GetGoPath()) {
+ cmd = []string{"go-deb", "--dir", outdir}
+ return nil
+ }
+
+ if argv.Verbose || argv.Force {
+ // log.Info("build cmd:", cmd)
+ cmd = append(cmd, "--verbose")
+ }
+ if argv.DryRun {
+ return nil
+ }
+
+ if argv.Force {
+ // build everything no matter what
+ } else {
+ if state[check] != "need to build" {
+ // log.Info("skipping build for", check.GetGoPath(), state[check])
+ return nil
+ }
+ }
+
+ 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
+ }
+
+ log.Info("build worked", cmd, check.FullPath)
+ return nil
+}
+
+func getOutdir(repo *gitpb.Repo) string {
+ if me.forge.Config.IsPrivate(repo.GetGoPath()) {
+ return "/home/jcarr/incoming-private"
+ }
+ if argv.Force {
+ return "/home/jcarr/incoming"
+ }
+ 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"
+ }
+
+ return "/home/jcarr/incoming"
+}