mirror of
https://github.com/Jguer/yay
synced 2024-09-14 13:51:12 +00:00
Add --mflags option to pass args to makepkg
This commit is contained in:
parent
c89941bf83
commit
cee0d74643
15
cmd.go
15
cmd.go
|
@ -288,14 +288,14 @@ func updateSudo() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func handleCmd() (err error) {
|
func handleCmd() (err error) {
|
||||||
for option := range cmdArgs.options {
|
for option, value := range cmdArgs.options {
|
||||||
if handleConfig(option) {
|
if handleConfig(option, value) {
|
||||||
cmdArgs.delArg(option)
|
cmdArgs.delArg(option)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for option := range cmdArgs.globals {
|
for option, value := range cmdArgs.globals {
|
||||||
if handleConfig(option) {
|
if handleConfig(option, value) {
|
||||||
cmdArgs.delArg(option)
|
cmdArgs.delArg(option)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -346,7 +346,7 @@ func handleCmd() (err error) {
|
||||||
//my current plan is to have yay specific operations in its own operator
|
//my current plan is to have yay specific operations in its own operator
|
||||||
//e.g. yay -Y --gendb
|
//e.g. yay -Y --gendb
|
||||||
//e.g yay -Yg
|
//e.g yay -Yg
|
||||||
func handleConfig(option string) bool {
|
func handleConfig(option, value string) bool {
|
||||||
switch option {
|
switch option {
|
||||||
case "save":
|
case "save":
|
||||||
shouldSaveConfig = true
|
shouldSaveConfig = true
|
||||||
|
@ -374,6 +374,8 @@ func handleConfig(option string) bool {
|
||||||
config.ReDownload = "all"
|
config.ReDownload = "all"
|
||||||
case "noredownload":
|
case "noredownload":
|
||||||
config.ReDownload = "no"
|
config.ReDownload = "no"
|
||||||
|
case "mflags":
|
||||||
|
config.MFlags = value
|
||||||
default:
|
default:
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -727,6 +729,9 @@ func passToMakepkg(dir string, args ...string) (err error) {
|
||||||
args = append(args)
|
args = append(args)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mflags := strings.Fields(config.MFlags)
|
||||||
|
args = append(args, mflags...)
|
||||||
|
|
||||||
cmd := exec.Command(config.MakepkgBin, args...)
|
cmd := exec.Command(config.MakepkgBin, args...)
|
||||||
cmd.Stdin, cmd.Stdout, cmd.Stderr = os.Stdin, os.Stdout, os.Stderr
|
cmd.Stdin, cmd.Stdout, cmd.Stderr = os.Stdin, os.Stdout, os.Stderr
|
||||||
cmd.Dir = dir
|
cmd.Dir = dir
|
||||||
|
|
|
@ -33,6 +33,7 @@ type Configuration struct {
|
||||||
TarBin string `json:"tarbin"`
|
TarBin string `json:"tarbin"`
|
||||||
ReDownload string `json:"redownload"`
|
ReDownload string `json:"redownload"`
|
||||||
GitBin string `json:"gitbin"`
|
GitBin string `json:"gitbin"`
|
||||||
|
MFlags string `json:"mflags"`
|
||||||
RequestSplitN int `json:"requestsplitn"`
|
RequestSplitN int `json:"requestsplitn"`
|
||||||
SearchMode int `json:"-"`
|
SearchMode int `json:"-"`
|
||||||
SortMode int `json:"sortmode"`
|
SortMode int `json:"sortmode"`
|
||||||
|
@ -124,6 +125,7 @@ func defaultSettings(config *Configuration) {
|
||||||
config.NoConfirm = false
|
config.NoConfirm = false
|
||||||
config.PacmanBin = "pacman"
|
config.PacmanBin = "pacman"
|
||||||
config.PacmanConf = "/etc/pacman.conf"
|
config.PacmanConf = "/etc/pacman.conf"
|
||||||
|
config.MFlags = ""
|
||||||
config.SortMode = BottomUp
|
config.SortMode = BottomUp
|
||||||
config.SudoLoop = false
|
config.SudoLoop = false
|
||||||
config.TarBin = "bsdtar"
|
config.TarBin = "bsdtar"
|
||||||
|
|
Loading…
Reference in a new issue