diff options
| author | Jeff Carr <[email protected]> | 2025-10-15 08:46:12 -0500 | 
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-15 08:46:12 -0500 | 
| commit | d4efbe0b4d3baeb908a70fe7e832fc3dd6f6d92b (patch) | |
| tree | 767740b9656594890a1602262f5043df44fd972b | |
| parent | 206beef575a90417cee5681a028bc899588eb44d (diff) | |
make fake values when there is no config filev0.22.165
| -rw-r--r-- | build.go | 6 | ||||
| -rw-r--r-- | main.go | 21 | 
2 files changed, 16 insertions, 11 deletions
@@ -111,7 +111,6 @@ func buildPackage(repo *gitpb.Repo) (bool, error) {  		for _, flag := range argv.Ldflags {  			cmd = append(cmd, "-ldflags", "-X "+flag)  		} -		cmd = append(cmd, "-o", me.pb.Package)  		err := repo.RunVerbose(cmd)  		if err != nil { @@ -120,11 +119,6 @@ func buildPackage(repo *gitpb.Repo) (bool, error) {  		log.Warn("go build worked")  	} -	if !shell.Exists(me.pb.Package) { -		log.Warn("build failed. filename does not exist", me.pb.Package) -		return false, errors.New("missing " + me.pb.Package) -	} -  	if shell.Exists("files") {  		repo.RunVerbose([]string{"rm", "-rf", "files"})  		// log.Info("running sync") @@ -44,13 +44,24 @@ func main() {  	}  	data, err := os.ReadFile("control") -	if err != nil { -		me.sh.BadExit("you don't have a 'control' file", err) +	log.Info("INITIAL PARSE:") +	if err == nil { +		debian.ParseDpkgOutputIntoPB(me.pb, string(data)) +		log.Info(string(data)) +	} else { +		// make up a new control file +		_, dirname := filepath.Split(me.repo.Namespace) +		fake := "Package: " + dirname + "\n" +		fake += "Maintainer: " + os.Getenv("GIT_AUTHOR_NAME") + "\n" +		fake += "URL: " + me.repo.URL + "\n" +		fake += "Homepage: " + me.repo.URL + "\n" // deprecate? +		fake += "Namespace: " + me.repo.Namespace + "\n" +		fake += "Build-Depends: golang\n" +		fake += "Description: built with go.wit.com/apps/go-deb\n" +		debian.ParseDpkgOutputIntoPB(me.pb, fake) +		log.Info(fake)  	} -	log.Info("INITIAL PARSE:") -	log.Info(string(data)) -	debian.ParseDpkgOutputIntoPB(me.pb, string(data))  	if argv.Arch == "" {  		me.pb.Architecture = "amd64"  	} else {  | 
