diff options
| author | Jeff Carr <[email protected]> | 2025-02-14 17:11:48 -0600 | 
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-14 17:11:48 -0600 | 
| commit | 31eac3d91516b69e741a91b3349e5faa83be09bc (patch) | |
| tree | 6b5006e31d2862ea177b1a660d2134751ac125bd | |
| parent | da425cfb0f5bf4994b59baad848a35ad3598c6d4 (diff) | |
try to fix 'release' buildsv0.22.73
| -rw-r--r-- | Makefile | 9 | ||||
| -rw-r--r-- | buildPackage.go | 33 | 
2 files changed, 23 insertions, 19 deletions
@@ -3,8 +3,11 @@  VERSION = $(shell git describe --tags)  DATE = $(shell date +%Y.%m.%d) -run: build -	./go-deb --forge go.wit.com/apps/autotypist +run: install +	go-deb --release --no-gui --auto --forge go.wit.com/apps/autogenpb --dir ${HOME}/incoming +	go-deb --release --no-gui --auto --forge go.wit.com/apps/go-mod-clean --dir ${HOME}/incoming +	@#go-deb --forge go.wit.com/apps/autotypist --no-gui --auto +	ls -lth ${HOME}/incoming  vet:  	@GO111MODULE=off go vet @@ -13,7 +16,7 @@ vet:  auto-build: build  	./go-deb --auto --repo go.wit.com/apps/autotypist -build: goimports +build: goimports vet  	-rm resources/*.so  	touch resources/blank.so  	GO111MODULE="off" go build -v \ diff --git a/buildPackage.go b/buildPackage.go index 642dd29..29e98c4 100644 --- a/buildPackage.go +++ b/buildPackage.go @@ -71,18 +71,22 @@ func (c *controlBox) buildPackage() (bool, error) {  	if argv.Release {  		os.Unsetenv("GO111MODULE") -		path := c.pathL.String() + "@latest" -		cmd := []string{"go", "install", "-v", "-x", path} -		if r := shell.Run(cmd); r.Error == nil { -			log.Warn("go install worked") -		} else { -			return false, errors.New("go install") +		cmd := []string{"forge", "--verbose", "--install", argv.Forge} +		if err := shell.PathExecVerbose("", cmd); err != nil { +			badExit(err) +			return false, fmt.Errorf("go build err %v", err) +		} +		// must 'go install' then 'go build' so they are both in ~/go/src and in the repo dir +		cmd = []string{"forge", "--verbose", "--build", argv.Forge} +		if err := shell.PathExecVerbose("", cmd); err != nil { +			badExit(err) +			return false, fmt.Errorf("go build err %v", err)  		} +		log.Warn("forge build worked")  	} else {  		// set the GO111 build var to true. pass the versions to the compiler manually  		os.Setenv("GO111MODULE", "off")  		cmd := []string{"go", "build"} -  		// set standard ldflag options  		now := time.Now()  		datestamp := now.UTC().Format("2006/01/02_1504_UTC") @@ -100,12 +104,9 @@ func (c *controlBox) buildPackage() (bool, error) {  			cmd = append(cmd, "-ldflags", "-X "+flag)  		} -		r := shell.Run(cmd) -		if r.Exit != 0 { -			return false, errors.New("go build") -		} -		if r.Error != nil { -			return false, errors.New("go build") +		_, err := shell.RunVerbose(cmd) +		if err != nil { +			return false, fmt.Errorf("go build err %v", err)  		}  		log.Warn("go build worked")  	} @@ -126,7 +127,7 @@ func (c *controlBox) buildPackage() (bool, error) {  	if shell.Exists("files") {  		shell.Run([]string{"rm", "-rf", "files"}) -		log.Info("running sync") +		// log.Info("running sync")  		shell.Run([]string{"sync"})  		if shell.Exists("files") {  			log.Warn("rm failed for some reason") @@ -196,7 +197,7 @@ func (c *controlBox) buildPackage() (bool, error) {  	shell.Run([]string{"dpkg-deb", "--build", "files", fulldebname})  	if shell.Exists(fulldebname) {  	} else { -		log.Warn("build failed") +		log.Warn("build failed", fulldebname)  		return false, errors.New("dpkg-deb --build failed")  	}  	shell.Run([]string{"dpkg-deb", "-I", fulldebname}) @@ -208,7 +209,7 @@ func (c *controlBox) buildPackage() (bool, error) {  			log.Info("keeping the build files/")  		} else {  			shell.Run([]string{"rm", "-rf", "files"}) -			log.Info("running sync") +			// log.Info("running sync")  			shell.Run([]string{"sync"})  			if shell.Exists("files") {  				log.Warn("rm -rf files/ failed. Run() returned false")  | 
