attempt to make a fake control file

This commit is contained in:
Jeff Carr 2024-11-07 07:03:13 -06:00
parent 62feeab08e
commit 3961caa179
5 changed files with 43 additions and 14 deletions

View File

@ -1,5 +1,7 @@
.PHONY: debian .PHONY: debian
VERSION = $(shell git describe --tags)
run: build run: build
./go-deb --repo go.wit.com/apps/autotypist ./go-deb --repo go.wit.com/apps/autotypist
@ -12,12 +14,15 @@ no-gui: build
build: build:
-rm resources/*.so -rm resources/*.so
touch resources/blank.so
# embed the andlabs plugin # embed the andlabs plugin
-cp -a ~/go/src/go.wit.com/toolkits/andlabs.so resources/ -cp -a ~/go/src/go.wit.com/toolkits/andlabs.so resources/
GO111MODULE="off" go build -v GO111MODULE="off" go build -v \
-ldflags "-X main.VERSION=${VERSION} -X gui.GUIVERSION=${VERSION}"
install: install:
GO111MODULE="off" go install -v GO111MODULE="off" go install -v \
-ldflags "-X main.VERSION=${VERSION} -X gui.GUIVERSION=${VERSION}"
goimports: goimports:
goimports -w *.go goimports -w *.go
@ -51,17 +56,25 @@ build-test-keep-files: build
./go-deb --no-gui --keep-files --repo go.wit.com/apps/go-deb ./go-deb --no-gui --keep-files --repo go.wit.com/apps/go-deb
build-all: build-all:
go-deb --no-gui --repo go.wit.com/apps/go-deb
go-deb --no-gui --repo go.wit.com/apps/go-clone
go-deb --no-gui --repo go.wit.com/apps/autotypist
go-deb --no-gui --repo go.wit.com/apps/virtigoctl
go-deb --no-gui --repo go.wit.com/apps/virtigo
go-deb --no-gui --repo go.wit.com/apps/autotypist go-deb --no-gui --repo go.wit.com/apps/autotypist
go-deb --no-gui --repo go.wit.com/apps/control-panel-digitalocean
go-deb --no-gui --repo go.wit.com/apps/control-panel-vpn
go-deb --no-gui --repo go.wit.com/apps/go-gui-toolkits
go-deb --no-gui --repo go.wit.com/apps/guireleaser go-deb --no-gui --repo go.wit.com/apps/guireleaser
go-deb --no-gui --repo go.wit.com/apps/gowebd
go-deb --no-gui --repo go.wit.com/apps/networkQuality
go-deb --no-gui --repo go.wit.com/apps/helloworld
go-deb --no-gui --repo go.wit.com/apps/basicwindow
go-deb --no-gui --repo go.wit.com/apps/gadgetwindow
go-deb --no-gui --repo go.wit.com/apps/powerpaneld
go-deb --no-gui --repo go.wit.com/lib/daemons/virtigod
go-deb --no-gui --repo go.wit.com/apps/control-panel-cloudflare go-deb --no-gui --repo go.wit.com/apps/control-panel-cloudflare
go-deb --no-gui --repo go.wit.com/apps/control-panel-dns go-deb --no-gui --repo go.wit.com/apps/control-panel-dns
go-deb --no-gui --repo go.wit.com/apps/go-deb go-deb --no-gui --repo go.wit.com/apps/control-panel-droplet
go-deb --no-gui --repo go.wit.com/apps/go.wit.com go-deb --no-gui --repo go.wit.com/apps/control-panel-vpn
go-deb --no-gui --repo go.wit.com/apps/helloworld # go-deb --no-gui --repo golang.org/x/tools/cmd/goimports
go-deb --no-gui --repo golang.org/x/tools/cmd/goimports
build-releases: build-releases:
-go-deb --release --no-gui --repo go.wit.com/apps/autotypist -go-deb --release --no-gui --repo go.wit.com/apps/autotypist

View File

@ -32,3 +32,7 @@ func init() {
log.Info("cmd line --debugger == false") log.Info("cmd line --debugger == false")
} }
} }
func (args) Version() string {
return "go-clone " + VERSION
}

View File

@ -98,6 +98,8 @@ func (c *controlBox) buildPackage() (bool, error) {
if shell.Exists("files") { if shell.Exists("files") {
shell.Run([]string{"rm", "-rf", "files"}) shell.Run([]string{"rm", "-rf", "files"})
log.Info("running sync")
shell.Run([]string{"sync"})
if shell.Exists("files") { if shell.Exists("files") {
log.Warn("rm failed for some reason") log.Warn("rm failed for some reason")
return false, errors.New("rm files/") return false, errors.New("rm files/")
@ -183,6 +185,8 @@ func (c *controlBox) buildPackage() (bool, error) {
log.Info("keeping the build files/") log.Info("keeping the build files/")
} else { } else {
shell.Run([]string{"rm", "-rf", "files"}) shell.Run([]string{"rm", "-rf", "files"})
log.Info("running sync")
shell.Run([]string{"sync"})
if shell.Exists("files") { if shell.Exists("files") {
log.Warn("rm -rf files/ failed. Run() returned false") log.Warn("rm -rf files/ failed. Run() returned false")
return false, errors.New("rm files/") return false, errors.New("rm files/")

View File

@ -12,6 +12,9 @@ import (
"go.wit.com/log" "go.wit.com/log"
) )
// sent from -ldflags
var VERSION string
// This is the beginning of the binary tree of GUI widgets // This is the beginning of the binary tree of GUI widgets
var myGui *gui.Node var myGui *gui.Node

View File

@ -2,7 +2,6 @@ package main
import ( import (
"bufio" "bufio"
"errors"
"os" "os"
"strings" "strings"
@ -11,16 +10,22 @@ import (
// readGitConfig reads and parses the control file // readGitConfig reads and parses the control file
func (c *controlBox) readControlFile() error { func (c *controlBox) readControlFile() error {
pairs := make(map[string]string)
var key string
file, err := os.Open("control") file, err := os.Open("control")
if err != nil { if err != nil {
log.Warn("readControlFile() could not find the file") log.Warn("readControlFile() could not find the file")
return errors.New("'control': file not found") // return errors.New("'control': file not found")
// if this happens, make up a fake control file
pairs["Maintainer"] = "go-deb build"
pairs["Architecture"] = "x86"
pairs["Recommends"] = ""
pairs["Source"] = "notsure"
pairs["Description"] = "put something here"
} }
defer file.Close() defer file.Close()
pairs := make(map[string]string)
var key string
scanner := bufio.NewScanner(file) scanner := bufio.NewScanner(file)
for scanner.Scan() { for scanner.Scan() {
line := scanner.Text() line := scanner.Text()