summaryrefslogtreecommitdiff
path: root/buildPackage.go
diff options
context:
space:
mode:
Diffstat (limited to 'buildPackage.go')
-rw-r--r--buildPackage.go27
1 files changed, 14 insertions, 13 deletions
diff --git a/buildPackage.go b/buildPackage.go
index b7c1b27..498662e 100644
--- a/buildPackage.go
+++ b/buildPackage.go
@@ -62,7 +62,7 @@ func (c *controlBox) buildPackage() (bool, error) {
os.Unsetenv("GO111MODULE")
path := c.pathL.String() + "@latest"
cmd := []string{"go", "install", "-v", "-x", path}
- if r := Run(cmd); r.Error == nil {
+ if r := shell.Run(cmd); r.Error == nil {
log.Warn("go install worked")
} else {
return false, errors.New("go install")
@@ -84,7 +84,7 @@ func (c *controlBox) buildPackage() (bool, error) {
cmd = append(cmd, "-ldflags", "-X "+flag)
}
- if r := Run(cmd); r.Error == nil {
+ if r := shell.Run(cmd); r.Error == nil {
log.Warn("go build worked")
} else {
return false, errors.New("go build")
@@ -118,11 +118,11 @@ func (c *controlBox) buildPackage() (bool, error) {
log.Warn("mkdir failed")
return false, errors.New("mkdir files/usr/bin")
}
- if r := Run([]string{"cp", fullfilename, "files/usr/bin"}); r.Error != nil {
+ if r := shell.Run([]string{"cp", fullfilename, "files/usr/bin"}); r.Error != nil {
log.Warn("cp failed")
return false, r.Error
}
- if r := Run([]string{"strip", "files/usr/bin/" + filename}); r.Error != nil {
+ if r := shell.Run([]string{"strip", "files/usr/bin/" + filename}); r.Error != nil {
log.Warn("strip failed")
return false, r.Error
}
@@ -142,7 +142,7 @@ func (c *controlBox) buildPackage() (bool, error) {
if !shell.Mkdir(path) {
return false, errors.New("no files/usr/lib")
}
- if r := Run([]string{"cp", readme, path}); r.Error != nil {
+ if r := shell.Run([]string{"cp", readme, path}); r.Error != nil {
return false, r.Error
}
}
@@ -151,7 +151,7 @@ func (c *controlBox) buildPackage() (bool, error) {
return false, errors.New("write control file")
}
if shell.Exists("postinst") {
- Run([]string{"cp", "postinst", "files/DEBIAN/"})
+ shell.Run([]string{"cp", "postinst", "files/DEBIAN/"})
}
if c.status == nil {
@@ -167,26 +167,26 @@ func (c *controlBox) buildPackage() (bool, error) {
} else {
os.Setenv("GO111MODULE", "off")
}
- Run([]string{"./build"})
+ shell.Run([]string{"./build"})
}
- Run([]string{"dpkg-deb", "--build", "files", fulldebname})
+ shell.Run([]string{"dpkg-deb", "--build", "files", fulldebname})
if shell.Exists(fulldebname) {
} else {
log.Warn("build failed")
return false, errors.New("dpkg-deb --build failed")
}
- Run([]string{"dpkg-deb", "-I", fulldebname})
- Run([]string{"dpkg-deb", "-c", fulldebname})
+ shell.Run([]string{"dpkg-deb", "-I", fulldebname})
+ shell.Run([]string{"dpkg-deb", "-c", fulldebname})
// cleanup files
if shell.Exists("files") {
if argv.KeepFiles {
log.Info("keeping the build files/")
} else {
- Run([]string{"rm", "-rf", "files"})
+ shell.Run([]string{"rm", "-rf", "files"})
log.Info("running sync")
- Run([]string{"sync"})
+ shell.Run([]string{"sync"})
if shell.Exists("files") {
log.Warn("rm -rf files/ failed. Run() returned false")
return false, errors.New("rm files/")
@@ -256,7 +256,8 @@ func (c *controlBox) computeControlValues() bool {
// stamp := time.Now().UTC().Format("2006/01/02 15:04:05 UTC")
func (c *controlBox) getDateStamp(tag string) string {
- _, out := c.status.RunCmd([]string{"git", "log", "-1", "--format=%at", tag})
+ r := c.status.Run([]string{"git", "log", "-1", "--format=%at", tag})
+ out := strings.Join(r.Stdout, "\n")
out = strings.TrimSpace(out)
// Convert the string to an integer