From 4af671afac8d5c29ed609248181ddcaa6a27260a Mon Sep 17 00:00:00 2001 From: morganamilo Date: Wed, 18 Jul 2018 00:53:53 +0100 Subject: [PATCH] Add --[no]makepkgconf --- cmd.go | 4 ++++ config.go | 2 ++ exec.go | 4 ++++ parser.go | 2 ++ 4 files changed, 12 insertions(+) diff --git a/cmd.go b/cmd.go index 929b333a..bc06a886 100644 --- a/cmd.go +++ b/cmd.go @@ -273,6 +273,10 @@ func handleConfig(option, value string) bool { config.EditorFlags = value case "makepkg": config.MakepkgBin = value + case "makepkgconf": + config.MakepkgConf = value + case "nomakepkgconf": + config.MakepkgConf = "" case "pacman": config.PacmanBin = value case "tar": diff --git a/config.go b/config.go index daff6461..ac950069 100644 --- a/config.go +++ b/config.go @@ -39,6 +39,7 @@ type Configuration struct { Editor string `json:"editor"` EditorFlags string `json:"editorflags"` MakepkgBin string `json:"makepkgbin"` + MakepkgConf string `json:"makepkgconf"` PacmanBin string `json:"pacmanbin"` PacmanConf string `json:"pacmanconf"` TarBin string `json:"tarbin"` @@ -152,6 +153,7 @@ func defaultSettings(config *Configuration) { config.EditorFlags = "" config.Devel = false config.MakepkgBin = "makepkg" + config.MakepkgConf = "" config.NoConfirm = false config.PacmanBin = "pacman" config.PGPFetch = true diff --git a/exec.go b/exec.go index b7249ccf..b70a72f6 100644 --- a/exec.go +++ b/exec.go @@ -82,6 +82,10 @@ func passToMakepkg(dir string, args ...string) *exec.Cmd { mflags := strings.Fields(config.MFlags) args = append(args, mflags...) + if config.MakepkgConf != "" { + args = append(args, "--config", config.MakepkgConf) + } + cmd := exec.Command(config.MakepkgBin, args...) cmd.Dir = dir return cmd diff --git a/parser.go b/parser.go index d4f444b0..c11d8cbd 100644 --- a/parser.go +++ b/parser.go @@ -461,6 +461,8 @@ func hasParam(arg string) bool { return true case "makepkg": return true + case "makepkgconf": + return true case "pacman": return true case "tar":