diff options
Diffstat (limited to 'buildPackage.go')
| -rw-r--r-- | buildPackage.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/buildPackage.go b/buildPackage.go index 3e511d2..2fcfd32 100644 --- a/buildPackage.go +++ b/buildPackage.go @@ -91,8 +91,10 @@ func (c *controlBox) buildPackage() (bool, error) { return false, errors.New("rm files/") } } + shell.Run([]string{"sync"}) // for some reason the next check fails sometimes? if shell.Exists("files") { - log.Warn("rm failed") + // probably the 'shell' package id being stupid and not waiting for the process to actually exit + log.Warn("rm failed. files/ still exists. is golang doing these in parallel?") return false, errors.New("rm files/") } if !shell.Mkdir("files/DEBIAN") { @@ -131,9 +133,12 @@ func (c *controlBox) buildPackage() (bool, error) { } } - if !c.writeFiles() { + if !c.writeDebianControlFile() { return false, errors.New("write control file") } + if shell.Exists("postinst") { + shell.Run([]string{"cp", "postinst", "files/DEBIAN/"}) + } // experiment for the toolkit package // if the git repo has a "./build" script run it before packaging @@ -166,7 +171,7 @@ func (c *controlBox) buildPackage() (bool, error) { return true, nil } -func (c *controlBox) writeFiles() bool { +func (c *controlBox) writeDebianControlFile() bool { cf, err := os.OpenFile("files/DEBIAN/control", os.O_RDWR|os.O_CREATE, 0644) if err != nil { log.Info("open control file failed", err) |
