From 888a289a1b0df7fc044a732ff490975b93ce2e75 Mon Sep 17 00:00:00 2001 From: J Guerreiro Date: Fri, 29 Mar 2019 22:09:27 +0000 Subject: [PATCH] Revert "Add SudoBin" --- cmd.go | 2 -- config.go | 6 ------ doc/yay.8 | 13 ------------- exec.go | 4 ++-- parser.go | 8 -------- 5 files changed, 2 insertions(+), 31 deletions(-) diff --git a/cmd.go b/cmd.go index 39c460f0..7b88a2dd 100644 --- a/cmd.go +++ b/cmd.go @@ -105,8 +105,6 @@ Permanent configuration options: --combinedupgrade Refresh then perform the repo and AUR upgrade together --nocombinedupgrade Perform the repo upgrade and AUR upgrade separately - --sudo sudo command to use - --sudoflags Pass arguments to sudo --sudoloop Loop sudo calls in the background to avoid timeout --nosudoloop Do not loop sudo calls in the background diff --git a/config.go b/config.go index 448b7968..b978b396 100644 --- a/config.go +++ b/config.go @@ -58,8 +58,6 @@ type Configuration struct { SortBy string `json:"sortby"` GitFlags string `json:"gitflags"` RemoveMake string `json:"removemake"` - SudoBin string `json:"sudobin"` - SudoFlags string `json:"sudoflags"` RequestSplitN int `json:"requestsplitn"` SearchMode int `json:"-"` SortMode int `json:"sortmode"` @@ -163,8 +161,6 @@ func defaultSettings() *Configuration { TarBin: "bsdtar", GitBin: "git", GpgBin: "gpg", - SudoBin: "sudo", - SudoFlags: "", TimeUpdate: false, RequestSplitN: 150, ReDownload: "no", @@ -207,8 +203,6 @@ func (config *Configuration) expandEnv() { config.TarBin = os.ExpandEnv(config.TarBin) config.GitBin = os.ExpandEnv(config.GitBin) config.GpgBin = os.ExpandEnv(config.GpgBin) - config.SudoBin = os.ExpandEnv(config.SudoBin) - config.SudoFlags = os.ExpandEnv(config.SudoFlags) config.ReDownload = os.ExpandEnv(config.ReDownload) config.ReBuild = os.ExpandEnv(config.ReBuild) config.AnswerClean = os.ExpandEnv(config.AnswerClean) diff --git a/doc/yay.8 b/doc/yay.8 index 8ddd2070..4fc6e435 100644 --- a/doc/yay.8 +++ b/doc/yay.8 @@ -482,19 +482,6 @@ gpg is called by Yay. Arguments are split on whitespace before being passed to gpg. Multiple arguments may be passed by supplying a space separated list that is quoted by the shell. -.TP -.B \-\-sudo -The command to use for \fBsudo\fR calls. This can be a command in -\fBPATH\fR or an absolute path to the file. -The sudoloop is not guarantee to work with a custom \fBsudo\fR command. - -.TP -.B \-\-sudoflags -Passes arguments to sudo. These flags get passed to every instance where -sudo is called by Yay. Arguments are split on whitespace before being -passed to sudo. Multiple arguments may be passed by supplying a space -separated list that is quoted by the shell. - .TP .B \-\-sudoloop Loop sudo calls in the background to prevent sudo from timing out during long diff --git a/exec.go b/exec.go index 0c72c402..3b643aac 100644 --- a/exec.go +++ b/exec.go @@ -45,7 +45,7 @@ func sudoLoop() { func updateSudo() { for { - err := show(exec.Command(config.SudoBin, "-v")) + err := show(exec.Command("sudo", "-v")) if err != nil { fmt.Fprintln(os.Stderr, err) } else { @@ -77,7 +77,7 @@ func passToPacman(args *arguments) *exec.Cmd { argArr := make([]string, 0) if args.needRoot() { - argArr = append(argArr, config.SudoBin, config.SudoFlags) + argArr = append(argArr, "sudo") } argArr = append(argArr, config.PacmanBin) diff --git a/parser.go b/parser.go index 0f761702..5c31177c 100644 --- a/parser.go +++ b/parser.go @@ -460,8 +460,6 @@ func isArg(arg string) bool { case "tar": case "git": case "gpg": - case "sudo": - case "sudoflags": case "requestsplitn": case "sudoloop": case "nosudoloop": @@ -591,10 +589,6 @@ func handleConfig(option, value string) bool { config.GitBin = value case "gpg": config.GpgBin = value - case "sudo": - config.SudoBin = value - case "sudoflags": - config.SudoFlags = value case "requestsplitn": n, err := strconv.Atoi(value) if err == nil && n > 0 { @@ -728,8 +722,6 @@ func hasParam(arg string) bool { case "tar": case "git": case "gpg": - case "sudo": - case "sudoflags": case "requestsplitn": case "answerclean": case "answerdiff":