summaryrefslogtreecommitdiff
path: root/readControlFile.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-11 18:39:59 -0500
committerJeff Carr <[email protected]>2025-09-11 18:39:59 -0500
commitcc75c2dd6cfbaa301e2b1890256ddb367b0bf151 (patch)
treec76d7811ef11d137d2db101c0c02974005839977 /readControlFile.go
parent95d1f6fc7c6af1565749979d1ac7a85fbb311de6 (diff)
fixes for packages without control filesv0.22.131
Diffstat (limited to 'readControlFile.go')
-rw-r--r--readControlFile.go17
1 files changed, 16 insertions, 1 deletions
diff --git a/readControlFile.go b/readControlFile.go
index b53a79d..6518ca1 100644
--- a/readControlFile.go
+++ b/readControlFile.go
@@ -3,6 +3,7 @@ package main
import (
"bufio"
"os"
+ "path/filepath"
"strings"
"unicode"
@@ -34,7 +35,6 @@ func readControlFile(repo *gitpb.Repo) error {
log.Warn("readControlFile() could not find the file")
// return errors.New("'control': file not found")
// if this happens, make up a fake control file
- pairs["Maintainer"] = "go-deb build"
pairs["Architecture"] = "amd64" // TODO: figure this out
pairs["Recommends"] = ""
pairs["Source"] = "notsure"
@@ -43,6 +43,21 @@ func readControlFile(repo *gitpb.Repo) error {
} else {
pairs["Description"] = me.repo.GetGoPath()
}
+ if repo.Control == nil {
+ repo.Control = make(map[string]string)
+ }
+ for key, value := range pairs {
+ repo.Control[key] = value
+ }
+ if os.Getenv("GIT_AUTHOR_NAME") != "" {
+ author := log.Sprintf("%s <%s>", os.Getenv("GIT_AUTHOR_NAME"), os.Getenv("GIT_AUTHOR_EMAIL"))
+ repo.Control["Packager"] = author
+ }
+ _, fname := filepath.Split(repo.GetFullPath())
+ repo.Control["Package"] = fname
+ repo.Control["Version"] = trimNonNumericPrefix(repo.GetCurrentVersion())
+ repo.Control["URL"] = repo.URL
+ return nil
}
defer file.Close()