From 3961caa1792c68dc215a9b8c51965e6fd0518f2f Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 7 Nov 2024 07:03:13 -0600 Subject: attempt to make a fake control file --- readControlFile.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'readControlFile.go') diff --git a/readControlFile.go b/readControlFile.go index 9def952..b307849 100644 --- a/readControlFile.go +++ b/readControlFile.go @@ -2,7 +2,6 @@ package main import ( "bufio" - "errors" "os" "strings" @@ -11,16 +10,22 @@ import ( // readGitConfig reads and parses the control file func (c *controlBox) readControlFile() error { + pairs := make(map[string]string) + var key string + file, err := os.Open("control") if err != nil { 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() - pairs := make(map[string]string) - var key string - scanner := bufio.NewScanner(file) for scanner.Scan() { line := scanner.Text() -- cgit v1.2.3