summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doBuild.debian.go55
-rw-r--r--doBuild.go12
2 files changed, 54 insertions, 13 deletions
diff --git a/doBuild.debian.go b/doBuild.debian.go
index 637d3d6..7317e27 100644
--- a/doBuild.debian.go
+++ b/doBuild.debian.go
@@ -201,6 +201,28 @@ func getBuildVersion(repo *gitpb.Repo) (int, error) {
return newi, err
}
+func getOutdir(repo *gitpb.Repo) string {
+ if me.forge.Config.IsPrivate(repo.GetNamespace()) {
+ 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-dirty-junk"
+ }
+
+ return "/home/jcarr/incoming"
+}
+
func buildDeb(repo *gitpb.Repo) error {
var cmd []string
@@ -267,24 +289,33 @@ func buildDeb(repo *gitpb.Repo) error {
return nil
}
-func getOutdir(repo *gitpb.Repo) string {
- if me.forge.Config.IsPrivate(repo.GetNamespace()) {
- return "/home/jcarr/incoming-private"
+func makeGoDebCmd(repo *gitpb.Repo, bvers string, arch string) []string {
+ var cmd []string
+
+ outdir := getOutdir(repo)
+
+ if isDebianRelease() {
+ cmd = []string{"go-deb", "--release", "--namespace", repo.Namespace, "--dir", outdir}
+ } else {
+ cmd = []string{"go-deb", "--namespace", repo.Namespace, "--dir", outdir}
}
- if argv.Force {
- return "/home/jcarr/incoming"
+
+ if me.forge.Config.IsPrivate(repo.GetNamespace()) {
+ cmd = []string{"go-deb", "--namespace", repo.Namespace, "--dir", outdir}
+ // return nil
}
- if repo.GetLastTag() != repo.GetMasterVersion() {
- return "/home/jcarr/incoming-devel"
+
+ if bvers != "" {
+ cmd = append(cmd, "--buildversion", bvers)
}
- if repo.GetCurrentBranchVersion() != repo.GetMasterVersion() {
- return "/home/jcarr/incoming-devel"
+ if arch != "" {
+ cmd = append(cmd, "--arch", arch)
}
- if repo.CheckDirty() {
- return "/home/jcarr/incoming-dirty-junk"
+ if env.True("Verbose") {
+ cmd = append(cmd, "--verbose")
}
- return "/home/jcarr/incoming"
+ return cmd
}
diff --git a/doBuild.go b/doBuild.go
index f477c0d..fa7a990 100644
--- a/doBuild.go
+++ b/doBuild.go
@@ -40,6 +40,7 @@ func doBuild() (string, error) {
if err != nil {
return "missing resources/go-deb list", err
}
+ tobuild := gitpb.NewRepos()
var simpletable [][]string
simpletable = append(simpletable, []string{"debname", "version", " age", "smartver", "curb", "curver", "newb", "arch", "FullPath"})
for i, line := range strings.Split(string(data), "\n") {
@@ -95,11 +96,20 @@ func doBuild() (string, error) {
} else {
age = cobol.Duration(t)
}
- simpletable = append(simpletable, []string{debname, p.Version, age, p.GetSmartVersion(), bcount, curver, newcount, arches, repo.FullPath})
+ tobuild.Clone(repo)
+ cmd := makeGoDebCmd(repo, newcount, "")
+ cmdstr := fmt.Sprintf("%v", cmd)
+ simpletable = append(simpletable, []string{debname, p.Version, age, p.GetSmartVersion(), bcount, curver, newcount, arches, cmdstr})
+ repo.RunVerbose(cmd)
+ // argvpb.GoodExit("built 1")
}
footer := cobol.SimpleTable(simpletable)
log.Info("simple build table footer:", footer)
+
+ argv.DryRun = true
+ // for r := range tobuild.IterAll() {
+ // }
/*
if err := doInstall(found); err != nil {
// log.Info("doInstall() failed", err)