From 769ab0c88b51a10124b7328b937fa35dad1c7cb4 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 15 Oct 2025 07:35:52 -0500 Subject: dump more of the old junk --- build.go | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'build.go') 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) { -- cgit v1.2.3