diff options
| author | Jeff Carr <[email protected]> | 2025-10-15 05:34:36 -0500 | 
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-15 05:34:36 -0500 | 
| commit | f7f02647de5f52c23202e5c2c67954bfa5af1007 (patch) | |
| tree | 478a4ff5a9fc09336ebf34067fea499abf802ea1 | |
| parent | 87cb75966a79788f7c6192c0397b92c09114b104 (diff) | |
add Recommends
| -rw-r--r-- | argv.go | 25 | ||||
| -rw-r--r-- | build.go | 9 | ||||
| -rw-r--r-- | control | 5 | ||||
| -rw-r--r-- | main.go | 21 | ||||
| -rw-r--r-- | structs.go | 6 | 
5 files changed, 44 insertions, 22 deletions
@@ -13,17 +13,18 @@ import (  */  type args struct { -	Show      *EmptyCmd `arg:"subcommand:show"          help:"show what would be done"` -	Gui       *EmptyCmd `arg:"subcommand:gui"           help:"open the gui"` -	Dump      *EmptyCmd `arg:"subcommand:dump"          help:"dump out the future control file"` -	Ldflags   []string  `arg:"--ldflags"                help:"flags to pass to go build"` -	OutDir    string    `arg:"--dir"                    help:"write .deb file into this directory"` -	Namespace string    `arg:"--namespace"              help:"the namespace of the repo"` -	Arch      string    `arg:"--arch"                   help:"what arch"` -	KeepFiles bool      `arg:"--keep-files"             help:"keep the build files/"` -	Release   bool      `arg:"--release"                help:"build version from the @latest git tag"` -	Force     bool      `arg:"--force" default:"false"  help:"force overwrite an existing .deb file"` -	Verbose   bool      `arg:"--verbose"                help:"show more things"` +	Show         *EmptyCmd `arg:"subcommand:show"          help:"show what would be done"` +	Gui          *EmptyCmd `arg:"subcommand:gui"           help:"open the gui"` +	Dump         *EmptyCmd `arg:"subcommand:dump"          help:"dump out the future control file"` +	Ldflags      []string  `arg:"--ldflags"                help:"flags to pass to go build"` +	OutDir       string    `arg:"--dir"                    help:"write .deb file into this directory"` +	Namespace    string    `arg:"--namespace"              help:"the namespace of the repo"` +	Arch         string    `arg:"--arch"                   help:"what arch"` +	BuildVersion string    `arg:"--buildversion"           help:"what arch"` +	KeepFiles    bool      `arg:"--keep-files"             help:"keep the build files/"` +	Release      bool      `arg:"--release"                help:"build version from the @latest git tag"` +	Force        bool      `arg:"--force" default:"false"  help:"force overwrite an existing .deb file"` +	Verbose      bool      `arg:"--verbose"                help:"show more things"`  }  func (args) Examples() string { @@ -61,7 +62,7 @@ func (args) Buildtime() (string, string) {  func (a args) DoAutoComplete(pb *prep.Auto) {  	if pb.Cmd == "" { -		pb.Autocomplete3([]string{"dump", "gui", "show", "--version", "--keep-files"}) +		pb.Autocomplete3([]string{"dump", "gui", "show", "--version", "--keep-files", "--buildversion"})  	} else {  		pb.SubCommand(pb.Goargs...)  	} @@ -31,9 +31,12 @@ func buildPackage(repo *gitpb.Repo) (bool, error) {  	if arch == "" {  		arch = argv.Arch  	} -	const layout = "200601021504" -	now := time.Now().UTC() -	version := repo.Control["Version"] + "-" + now.Format(layout) +	// const layout = "200601021504" +	// now := time.Now().UTC() +	version := repo.Control["Version"] +	if argv.BuildVersion != "" { +		version += argv.BuildVersion +	}  	repo.Control["Version"] = version  	log.Info("version is:", version)  	// debver := version + "-" + now.Format(layout) @@ -1,10 +1,11 @@ -Source: go-deb  Build-Depends: golang  Package: go-deb  Maintainer: Jeff Carr <[email protected]> -Packager: Jeff Carr <[email protected]>  Depends: go-gui-toolkits  Namespace: go.wit.com/apps/go-deb  Recommends:  Description: create .deb packages for anything   A person can dream anyway. Examples in the sources. + Hopefully this conforms to the debian versioning scheme. + Submit patches using 'forge'. + go install go.wit.com/apps/forge@latest @@ -6,8 +6,10 @@ import (  	"path/filepath"  	"time" +	"go.wit.com/lib/debian"  	"go.wit.com/lib/gui/prep"  	"go.wit.com/lib/protobuf/gitpb" +	"go.wit.com/lib/protobuf/zoopb"  	"go.wit.com/log"  ) @@ -27,7 +29,7 @@ func main() {  	wd, err := os.Getwd()  	if err != nil { -		badExit(err) +		me.sh.BadExit("your current directory does not exist err=", err)  	}  	if argv.Arch == "" { @@ -37,9 +39,24 @@ func main() {  	me.repo, err = gitpb.NewRepo(wd)  	if err != nil { -		badExit(err) +		me.sh.BadExit("is this really a .git directory? err=", err)  	} +	data, err := os.ReadFile("control") +	if err != nil { +		me.sh.BadExit("you don't have a 'control' file", err) +	} + +	log.Info("INITIAL PARSE:") +	log.Info(string(data)) +	dpkgPB := new(zoopb.Package) +	debian.ParseDpkgOutputIntoPB(dpkgPB, string(data)) +	log.Info("INITIAL PARSE RESULT:") +	controlfile := debian.MakeControlFile(dpkgPB) +	log.Info(controlfile) +	log.Info("INITIAL PARSE END") +	me.sh.GoodExit("rewriting this app") +  	// build()  	if argv.Show != nil {  		log.Info("todo: show", me.repo.Namespace) @@ -44,9 +44,9 @@ type controlBox struct {  	Description  *gadgets.OneLiner  	// repostatus things -	pathL     *gadgets.OneLiner -	lastTag   *gadgets.OneLiner -	dirtyL    *gadgets.OneLiner +	pathL   *gadgets.OneLiner +	lastTag *gadgets.OneLiner +	// dirtyL    *gadgets.OneLiner  	currentL  *gadgets.OneLiner  	buildDate *gadgets.OneLiner  	tagDate   *gadgets.BasicEntry  | 
