File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -37,14 +37,16 @@ func GetPlatforms(req *rpc.PlatformListRequest) ([]*rpc.Platform, error) {
3737 for _ , platform := range targetPackage .Platforms {
3838 platformRelease := packageManager .GetInstalledPlatformRelease (platform )
3939
40+ // The All flags adds to the list of installed platforms the installable platforms (from the indexes)
4041 // If both All and UpdatableOnly are set All takes precedence
4142 if req .All {
4243 installedVersion := ""
43- if platformRelease == nil {
44+ if platformRelease == nil { // if the platform is not installed
4445 platformRelease = platform .GetLatestRelease ()
4546 } else {
4647 installedVersion = platformRelease .Version .String ()
4748 }
49+ // it could happen, especially with indexes not perfectly compliant with specs that a platform do not contain a valid release
4850 if platformRelease != nil {
4951 rpcPlatform := commands .PlatformReleaseToRPC (platformRelease )
5052 rpcPlatform .Installed = installedVersion
@@ -59,10 +61,9 @@ func GetPlatforms(req *rpc.PlatformListRequest) ([]*rpc.Platform, error) {
5961 return nil , & commands.PlatformNotFound {Platform : platform .String (), Cause : errors .New (tr ("the platform has no releases" ))}
6062 }
6163
62- if req .UpdatableOnly {
63- if latest == platformRelease {
64- continue
65- }
64+ // show only the updatable platforms
65+ if req .UpdatableOnly && latest == platformRelease {
66+ continue
6667 }
6768
6869 rpcPlatform := commands .PlatformReleaseToRPC (platformRelease )
Original file line number Diff line number Diff line change @@ -3297,7 +3297,7 @@ msgstr "testing local archive integrity: %s"
32973297msgid "text section exceeds available space in board"
32983298msgstr "text section exceeds available space in board"
32993299
3300- #: commands/core/list.go:59
3300+ #: commands/core/list.go:61
33013301msgid "the platform has no releases"
33023302msgstr "the platform has no releases"
33033303
You can’t perform that action at this time.
0 commit comments