소스 검색

fix(query): match empty pacman -Si with AUR info (#2459)

Jo 10 달 전
부모
커밋
5149e3714d
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      query.go

+ 5 - 1
query.go

@@ -45,6 +45,10 @@ func syncInfo(ctx context.Context, run *runtime.Runtime,
 	pkgS = query.RemoveInvalidTargets(run.Logger, pkgS, run.Cfg.Mode)
 	aurS, repoS := packageSlices(pkgS, run.Cfg, dbExecutor)
 
+	if len(repoS) == 0 && len(aurS) == 0 {
+		aurS = dbExecutor.InstalledRemotePackageNames()
+	}
+
 	if len(aurS) != 0 {
 		noDB := make([]string, 0, len(aurS))
 
@@ -64,7 +68,7 @@ func syncInfo(ctx context.Context, run *runtime.Runtime,
 		}
 	}
 
-	if len(repoS) != 0 {
+	if len(repoS) != 0 || (len(aurS) == 0 && len(repoS) == 0) {
 		arguments := cmdArgs.Copy()
 		arguments.ClearTargets()
 		arguments.AddTarget(repoS...)