diff options
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | control.write.go | 36 |
2 files changed, 35 insertions, 3 deletions
@@ -63,7 +63,7 @@ build-test-failure: build ./go-deb --release --repo go.wit.com/apps/junk build-test-keep-files: build - ./go-deb --keep-files --repo go.wit.com/apps/go-deb + ./go-deb --keep-files build-release: go-deb --release --repo go.wit.com/apps/go-deb diff --git a/control.write.go b/control.write.go index 3c0ef7c..52c74d6 100644 --- a/control.write.go +++ b/control.write.go @@ -12,6 +12,34 @@ import ( "go.wit.com/log" ) +/* +The default order to write the fields in the control file: + +root@mirrors:/home/mirrors/debian/pool/main/m/moon-buggy# dpkg -I moon-buggy_1.0.51-15_arm64.deb + new Debian package, version 2.0. + size 196540 bytes: control archive=6240 bytes. + 202 bytes, 12 lines * config #!/bin/sh + 601 bytes, 14 lines control + 1020 bytes, 15 lines md5sums + 1757 bytes, 59 lines * postinst #!/bin/sh + 551 bytes, 22 lines * postrm #!/bin/sh + 11703 bytes, 104 lines templates + Package: moon-buggy + Version: 1:1.0.51-15 + Architecture: arm64 + Maintainer: Christian T. Steigies <[email protected]> + Installed-Size: 329 + Depends: debconf (>= 0.5) | debconf-2.0, libc6 (>= 2.34), libncurses6 (>= 6), libtinfo6 (>= 6) + Conflicts: moon-buggy-pause, suidmanager (<< 0.50) + Section: games + Priority: optional + Homepage: http://seehuhn.de/pages/moon-buggy + Description: Drive a car across the moon + Moon-buggy is a simple character graphics game, where you drive some + kind of car across the moon's surface. Unfortunately there are + dangerous craters there. Fortunately your car can jump over them! +*/ + func writeDebianControlFile(repo *gitpb.Repo) bool { filename := "files/DEBIAN/control" cf, err := os.OpenFile(filename, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0644) @@ -28,13 +56,13 @@ func writeDebianControlFile(repo *gitpb.Repo) bool { } fmt.Fprintln(cf, "Architecture:", repo.Control["Architecture"]) // c.Architecture.String()) + writeControlVar(cf, repo, "Maintainer") writeControlVar(cf, repo, "Depends") writeControlVar(cf, repo, "Build-Depends") - writeControlVar(cf, repo, "Maintainer") + writeControlVar(cf, repo, "Conflicts") writeControlVar(cf, repo, "Packager") writeControlVar(cf, repo, "GoPath") writeControlVar(cf, repo, "URL") - writeControlVar(cf, repo, "Conflicts") stamp := time.Now().UTC().Format("2006/01/02 15:04:05 UTC") // update to now now despite what the GUI is showing @@ -54,6 +82,10 @@ func writeControlVar(f *os.File, repo *gitpb.Repo, varname string) { if val == "" { return } + // fix this when this code is rewritten to use the .proto + if varname == "URL" { + varname = "Homepage" + } fmt.Fprintln(f, varname+":", val) } |
