summaryrefslogtreecommitdiff
path: root/build.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-15 07:35:52 -0500
committerJeff Carr <[email protected]>2025-10-15 07:35:52 -0500
commit769ab0c88b51a10124b7328b937fa35dad1c7cb4 (patch)
treef525e26f5505491f311053a3ace17b18670c8088 /build.go
parentc14e4ab5b155d23b0e7bb9d4ae0e18769cc3418a (diff)
dump more of the old junk
Diffstat (limited to 'build.go')
-rw-r--r--build.go22
1 files changed, 13 insertions, 9 deletions
diff --git a/build.go b/build.go
index a28e6e4..420c88e 100644
--- a/build.go
+++ b/build.go
@@ -5,6 +5,7 @@ import (
"fmt"
"os"
"path/filepath"
+ "strings"
"time"
"go.wit.com/lib/debian"
@@ -188,15 +189,6 @@ func buildPackage(repo *gitpb.Repo) (bool, error) {
}
}
- controlfile := debian.MakeControlFile(me.pb)
- controlfile += "\n"
- log.Info(controlfile)
- if err := os.WriteFile("files/DEBIAN/control", []byte(controlfile), 0644); err != nil {
- me.sh.BadExit("write err files/DEBIAN/control", err)
- }
- // if !writeDebianControlFile(repo) {
- // return false, errors.New("write control file")
- // }
if shell.Exists("postinst") {
repo.RunVerbose([]string{"cp", "postinst", "files/DEBIAN/"})
}
@@ -211,6 +203,18 @@ func buildPackage(repo *gitpb.Repo) (bool, error) {
log.Info(repo.FullPath, "NOT FOUND ./build HERE")
}
+ r := repo.Run([]string{"du", "-s"})
+ if len(r.Stdout) != 1 {
+ me.sh.BadExit("du -s files/ failed", r.Error)
+ }
+ me.pb.DebInfo.InstalledSize = strings.Fields(r.Stdout[0])[0]
+ controlfile := debian.MakeControlFile(me.pb)
+ controlfile += "\n"
+ log.Info(controlfile)
+ if err := os.WriteFile("files/DEBIAN/control", []byte(controlfile), 0644); err != nil {
+ me.sh.BadExit("write err files/DEBIAN/control", err)
+ }
+
cmd := []string{"dpkg-deb", "--root-owner-group", "--build", "files", fulldebname}
result := repo.RunVerbose(cmd)
if shell.Exists(fulldebname) {