diff options
| author | Jeff Carr <[email protected]> | 2024-11-16 04:56:58 -0600 | 
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-11-16 04:56:58 -0600 | 
| commit | d45037dee96be62126c277a8738b39a52b9ed4b9 (patch) | |
| tree | 2200082a01c481ce18d73e73074491271fbe7250 | |
| parent | 350d5e58601320d44c779412a6a3018660f28d34 (diff) | |
allow the .deb package to be a different namev0.22.11
| -rw-r--r-- | buildPackage.go | 13 | 
1 files changed, 11 insertions, 2 deletions
diff --git a/buildPackage.go b/buildPackage.go index 8d3bba2..9c9692c 100644 --- a/buildPackage.go +++ b/buildPackage.go @@ -70,7 +70,7 @@ func (c *controlBox) buildPackage() (bool, error) {  	} else {  		// set the GO111 build var to true. pass the versions to the compiler manually  		os.Setenv("GO111MODULE", "off") -		cmd := []string{"go", "build", "-v", "-x"} +		cmd := []string{"go", "build"}  		// set standard ldflag options  		now := time.Now() @@ -96,9 +96,18 @@ func (c *controlBox) buildPackage() (bool, error) {  		}  	} +	filebase := filepath.Base(c.pathL.String()) +	if fullfilename != filebase { +		// this exception is for when you want to override a package name +		// sometimes that's the best option. This way you can keep your +		// name, but the .deb package name can be different so you can +		// still apt-get it. For an example, look at the gozookeeper package +		fullfilename = filebase +	} +  	if !shell.Exists(fullfilename) {  		log.Warn("build failed. filename does not exist", fullfilename) -		return false, errors.New("missing" + fullfilename) +		return false, errors.New("missing " + fullfilename)  	}  	if shell.Exists("files") {  | 
