فهرست منبع

Merge pull request #732 from Morganamilo/fix#730

Fix provider menu showing when it shouldn't
Anna 6 سال پیش
والد
کامیت
2b8fa74c22
3فایلهای تغییر یافته به همراه10 افزوده شده و 1 حذف شده
  1. 4 0
      callbacks.go
  2. 2 0
      config.go
  3. 4 1
      depPool.go

+ 4 - 0
callbacks.go

@@ -19,6 +19,10 @@ func questionCallback(question alpm.QuestionAny) {
 		return
 	}
 
+	if hideMenus {
+		return
+	}
+
 	size := 0
 
 	qp.Providers(alpmHandle).ForEach(func(pkg alpm.Package) error {

+ 2 - 0
config.go

@@ -119,6 +119,8 @@ var alpmHandle *alpm.Handle
 // Mode is used to restrict yay to AUR or repo only modes
 var mode = ModeAny
 
+var hideMenus = false
+
 // SaveConfig writes yay config to file.
 func (config *Configuration) saveConfig() error {
 	marshalledinfo, _ := json.MarshalIndent(config, "", "\t")

+ 4 - 1
depPool.go

@@ -302,7 +302,10 @@ func (dp *depPool) resolveAURPackages(pkgs stringSet, explicit bool) error {
 		}
 
 		_, isInstalled := dp.LocalDb.PkgCache().FindSatisfier(dep) //has satisfier installed: skip
-		repoPkg, inRepos := dp.SyncDb.FindSatisfier(dep)           //has satisfier in repo: fetch it
+		hm := hideMenus
+		hideMenus = isInstalled == nil
+		repoPkg, inRepos := dp.SyncDb.FindSatisfier(dep) //has satisfier in repo: fetch it
+		hideMenus = hm
 		if isInstalled == nil && (config.ReBuild != "tree" || inRepos == nil) {
 			continue
 		}