summaryrefslogtreecommitdiff
path: root/doDebian.go
diff options
context:
space:
mode:
Diffstat (limited to 'doDebian.go')
-rw-r--r--doDebian.go86
1 files changed, 14 insertions, 72 deletions
diff --git a/doDebian.go b/doDebian.go
index af7e253..840528d 100644
--- a/doDebian.go
+++ b/doDebian.go
@@ -4,10 +4,8 @@
package main
import (
- "fmt"
"os"
"path/filepath"
- "strings"
"go.wit.com/lib/gui/shell"
"go.wit.com/lib/protobuf/gitpb"
@@ -45,7 +43,7 @@ func doDebian() error {
found.Append(check)
}
- printRepos(found)
+ printPackagingTable(found)
// func (f *Forge) isInstalled(repo *gitpb.Repo) string {
// return "X"
@@ -76,70 +74,6 @@ func doDebian() error {
return nil
}
-func getStatusEnd(repo *gitpb.Repo) string {
- var end string
-
- manufactured := repo.GetCurrentVersion()
- ver := trimNonNumericFromStart(manufactured)
- name := me.forge.Config.DebName(repo.GetGoPath())
- var realver string
- if installedPackage := me.machine.FindInstalledByName(name); installedPackage != nil {
- realver = installedPackage.Version
- }
- if actualp := me.machine.FindByVersion(name, ver); actualp != nil {
- // end += " (version match) " + actualp.Version + " " + ver + " "
- // repo.State = "on mirrors"
- } else {
- if realver != "" {
- end += fmt.Sprintf(" (version miss) %s vs %s ", realver, ver)
- }
- // end += "" + ver + " "
- }
-
- debname := name + "_" + ver + "_amd64.deb"
- // debnames[repo] = debname
- outdir := getOutdir(repo)
- _, err := os.Stat(filepath.Join(outdir, debname))
- if err == nil {
- // log.Info("exists", filepath.Join(outdir, debname))
- repo.State = "in incoming"
- } else {
- // log.Info(debname, "does not exist")
- }
- if strings.HasPrefix(repo.GetState(), "unknown bran") {
- end += " (will build) "
- }
-
- if repo.State == "" {
- end += " (will build) "
- }
-
- if repo.State == "need to build" {
- end += " (will build) "
- }
-
- if name == "" {
- // err := fmt.Sprintf("name is blank error %+v", repo)
- log.Warn("name is blank error", repo.GetGoPath())
- }
- return end
-}
-
-func shouldBuild(repo *gitpb.Repo) bool {
- if argv.Force {
- return true
- }
-
- if repo.State == "need to build" {
- return true
- }
- if isPackageOnMirrors(repo) {
- return false
- }
-
- return false
-}
-
// avoids nil panics
func isDebianRelease() bool {
if argv.Build == nil {
@@ -151,6 +85,13 @@ func isDebianRelease() bool {
return argv.Build.Debian.Release
}
+func shouldBuild(check *gitpb.Repo) bool {
+ if isPackageOnMirrors(check) {
+ return false
+ }
+ return true
+}
+
func buildDeb(check *gitpb.Repo) error {
var cmd []string
@@ -167,14 +108,15 @@ func buildDeb(check *gitpb.Repo) error {
return nil
}
- if !shouldBuild(check) {
- return nil
- }
-
if argv.Verbose || argv.Force {
// log.Info("build cmd:", cmd)
cmd = append(cmd, "--verbose")
}
+
+ if !shouldBuild(check) {
+ return nil
+ }
+
if argv.DryRun {
log.Info("RUN:", check.FullPath, cmd)
return nil
@@ -243,7 +185,7 @@ func doOnlyDebianPackages() error {
found.Append(check)
}
- printRepos(found)
+ printPackagingTable(found)
me.forge.ConfigRill(16, 16)
log.Info("STARTING .deb BUILDS repo len =", found.Len())