mirror of
https://github.com/Jguer/yay
synced 2024-08-31 21:58:39 +00:00
Do not use CmdRunner.Capture() while executing a command with sudo
Fix #1440
This commit is contained in:
parent
b9d3992f13
commit
5bef39b728
16
install.go
16
install.go
|
@ -29,33 +29,33 @@ import (
|
|||
|
||||
const gitEmptyTree = "4b825dc642cb6eb9a060e54bf8d69288fbee4904"
|
||||
|
||||
func asdeps(cmdArgs *settings.Arguments, pkgs []string) error {
|
||||
func asdeps(cmdArgs *settings.Arguments, pkgs []string) (err error) {
|
||||
if len(pkgs) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
cmdArgs = cmdArgs.CopyGlobal()
|
||||
_ = cmdArgs.AddArg("D", "asdeps")
|
||||
_ = cmdArgs.AddArg("q", "D", "asdeps")
|
||||
cmdArgs.AddTarget(pkgs...)
|
||||
_, stderr, err := config.Runtime.CmdRunner.Capture(passToPacman(cmdArgs), 0)
|
||||
err = config.Runtime.CmdRunner.Show(passToPacman(cmdArgs))
|
||||
if err != nil {
|
||||
return fmt.Errorf("%s %s", stderr, err)
|
||||
return fmt.Errorf(gotext.Get("error updating package install reason to dependency"))
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func asexp(cmdArgs *settings.Arguments, pkgs []string) error {
|
||||
func asexp(cmdArgs *settings.Arguments, pkgs []string) (err error) {
|
||||
if len(pkgs) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
cmdArgs = cmdArgs.CopyGlobal()
|
||||
_ = cmdArgs.AddArg("D", "asexplicit")
|
||||
_ = cmdArgs.AddArg("q", "D", "asexplicit")
|
||||
cmdArgs.AddTarget(pkgs...)
|
||||
_, stderr, err := config.Runtime.CmdRunner.Capture(passToPacman(cmdArgs), 0)
|
||||
err = config.Runtime.CmdRunner.Show(passToPacman(cmdArgs))
|
||||
if err != nil {
|
||||
return fmt.Errorf("%s %s", stderr, err)
|
||||
return fmt.Errorf(gotext.Get("error updating package install reason to explicit"))
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Reference in a new issue