@@ -39,7 +39,7 @@ func PlatformSearch(req *rpc.PlatformSearchRequest) (*rpc.PlatformSearchResponse
3939 res := []* cores.Platform {}
4040 if isUsb , _ := regexp .MatchString ("[0-9a-f]{4}:[0-9a-f]{4}" , req .SearchArgs ); isUsb {
4141 vid , pid := req .SearchArgs [:4 ], req .SearchArgs [5 :]
42- res = pme .FindPlatformReleaseProvidingBoardsWithVidPid (vid , pid , req . AllVersions )
42+ res = pme .FindPlatformReleaseProvidingBoardsWithVidPid (vid , pid )
4343 } else {
4444 searchArgs := utils .SearchTermsFromQueryString (req .SearchArgs )
4545 for _ , targetPackage := range pme .GetPackages () {
@@ -53,14 +53,8 @@ func PlatformSearch(req *rpc.PlatformSearchRequest) (*rpc.PlatformSearchResponse
5353 continue
5454 }
5555
56- // In case we ask for all versions we also show incompatible ones
57- var latestRelease * cores.PlatformRelease
58- if req .AllVersions {
59- latestRelease = platform .GetLatestRelease ()
60- } else {
61- latestRelease = platform .GetLatestCompatibleRelease ()
62- }
6356 // Discard platforms with no releases
57+ latestRelease := platform .GetLatestRelease ()
6458 if latestRelease == nil || latestRelease .Name == "" {
6559 continue
6660 }
@@ -94,24 +88,20 @@ func PlatformSearch(req *rpc.PlatformSearchRequest) (*rpc.PlatformSearchResponse
9488 }
9589 if installed := pme .GetInstalledPlatformRelease (platform ); installed != nil {
9690 rpcPlatformSummary .InstalledVersion = installed .Version .String ()
97- rpcPlatformSummary .Releases [installed .Version .String ()] = commands .PlatformReleaseToRPC (installed )
9891 }
9992 if latestCompatible := platform .GetLatestCompatibleRelease (); latestCompatible != nil {
10093 rpcPlatformSummary .LatestVersion = latestCompatible .Version .String ()
101- rpcPlatformSummary .Releases [latestCompatible .Version .String ()] = commands .PlatformReleaseToRPC (latestCompatible )
10294 }
103- if req .AllVersions {
104- for _ , platformRelease := range platform .GetAllReleases () {
105- rpcPlatformRelease := commands .PlatformReleaseToRPC (platformRelease )
106- rpcPlatformSummary .Releases [rpcPlatformRelease .Version ] = rpcPlatformRelease
107- }
95+ for _ , platformRelease := range platform .GetAllReleases () {
96+ rpcPlatformRelease := commands .PlatformReleaseToRPC (platformRelease )
97+ rpcPlatformSummary .Releases [rpcPlatformRelease .Version ] = rpcPlatformRelease
10898 }
10999 out = append (out , rpcPlatformSummary )
110100 }
111101
112102 // Sort result alphabetically and put deprecated platforms at the bottom
113103 sort .Slice (out , func (i , j int ) bool {
114- return strings .ToLower (out [i ].GetLatestRelease ().GetName ()) < strings .ToLower (out [j ].GetLatestRelease ().GetName ())
104+ return strings .ToLower (out [i ].GetMetadata ().GetId ()) < strings .ToLower (out [j ].GetMetadata ().GetId ())
115105 })
116106 sort .SliceStable (out , func (i , j int ) bool {
117107 return ! out [i ].GetMetadata ().Deprecated && out [j ].GetMetadata ().Deprecated
0 commit comments