Implement config option for provider searching

This commit is contained in:
morganamilo 2018-05-29 17:39:38 +01:00
parent 33d056e9ac
commit c464af6b9b
No known key found for this signature in database
GPG key ID: 6FE9E7996B0B082E
3 changed files with 7 additions and 6 deletions

4
cmd.go
View file

@ -296,6 +296,10 @@ func handleConfig(option, value string) bool {
config.SudoLoop = true config.SudoLoop = true
case "nosudoloop": case "nosudoloop":
config.SudoLoop = false config.SudoLoop = false
case "provides":
config.Provides = true
case "noprovides":
config.Provides = false
default: default:
return false return false
} }

View file

@ -54,6 +54,7 @@ type Configuration struct {
Devel bool `json:"devel"` Devel bool `json:"devel"`
CleanAfter bool `json:"cleanAfter"` CleanAfter bool `json:"cleanAfter"`
GitClone bool `json:"gitclone"` GitClone bool `json:"gitclone"`
Provides bool `json:"provides"`
} }
var version = "5.688" var version = "5.688"
@ -152,6 +153,7 @@ func defaultSettings(config *Configuration) {
config.AnswerEdit = "" config.AnswerEdit = ""
config.AnswerUpgrade = "" config.AnswerUpgrade = ""
config.GitClone = true config.GitClone = true
config.Provides = true
} }
// Editor returns the preferred system editor. // Editor returns the preferred system editor.

View file

@ -9,8 +9,6 @@ import (
rpc "github.com/mikkeloscar/aur" rpc "github.com/mikkeloscar/aur"
) )
const PROVIDES = true
type target struct { type target struct {
Db string Db string
Name string Name string
@ -228,10 +226,7 @@ func (dp *depPool) cacheAURPackages(_pkgs stringSet) error {
return nil return nil
} }
//TODO: config option, maybe --deepsearh but aurman uses that flag for if config.Provides {
//something else already which might be confusing
//maybe --provides
if PROVIDES {
err := dp.findProvides(pkgs) err := dp.findProvides(pkgs)
if err != nil { if err != nil {
return err return err