Add upgrademenu to match {clean,diff,edit}menu

This commit is contained in:
morganamilo 2018-06-11 19:48:20 +01:00
parent d0bc1d70d9
commit 42f0508625
No known key found for this signature in database
GPG key ID: 6FE9E7996B0B082E
4 changed files with 15 additions and 1 deletions

4
cmd.go
View file

@ -323,6 +323,10 @@ func handleConfig(option, value string) bool {
config.PGPFetch = true
case "nopgpfetch":
config.PGPFetch = false
case "upgrademenu":
config.UpgradeMenu = true
case "noupgrademenu":
config.UpgradeMenu = false
case "cleanmenu":
config.CleanMenu = true
case "nocleanmenu":

View file

@ -66,6 +66,7 @@ type Configuration struct {
Provides bool `json:"provides"`
PGPFetch bool `json:"pgpfetch"`
ShowDiffs bool `json:"showdifs"`
UpgradeMenu bool `json:"upgrademenu"`
CleanMenu bool `json:"cleanmenu"`
DiffMenu bool `json:"diffmenu"`
EditMenu bool `json:"editmenu"`
@ -173,6 +174,7 @@ func defaultSettings(config *Configuration) {
config.AnswerUpgrade = ""
config.GitClone = true
config.Provides = true
config.UpgradeMenu = true
config.CleanMenu = true
config.DiffMenu = true
config.EditMenu = false

View file

@ -104,7 +104,7 @@ func install(parser *arguments) error {
if err != nil {
return err
}
if len(dp.Aur) == 0 {
parser.op = "S"
parser.delArg("y", "refresh")

View file

@ -343,6 +343,14 @@ func upgradePkgs(aurUp, repoUp upSlice) (stringSet, stringSet, error) {
return ignore, aurNames, nil
}
if !config.UpgradeMenu {
for _, pkg := range aurUp {
aurNames.set(pkg.Name)
}
return ignore, aurNames, nil
}
sort.Sort(repoUp)
sort.Sort(aurUp)
allUp := append(repoUp, aurUp...)