Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-cli
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Operations
Operations
Metrics
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-cli
Commits
372b881f
Unverified
Commit
372b881f
authored
Aug 25, 2021
by
Silvano Cerza
Committed by
GitHub
Aug 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix core list command not returning latest available version (#1409)
parent
01c07b61
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
10 deletions
+40
-10
commands/core/list.go
commands/core/list.go
+8
-1
i18n/data/en.po
i18n/data/en.po
+6
-2
i18n/rice-box.go
i18n/rice-box.go
+7
-7
test/test_core.py
test/test_core.py
+19
-0
No files found.
commands/core/list.go
View file @
372b881f
...
...
@@ -16,6 +16,7 @@
package
core
import
(
"fmt"
"sort"
"strings"
...
...
@@ -58,14 +59,20 @@ func GetPlatforms(req *rpc.PlatformListRequest) ([]*rpc.Platform, error) {
}
if
platformRelease
!=
nil
{
latest
:=
platform
.
GetLatestRelease
()
if
latest
==
nil
{
return
nil
,
fmt
.
Errorf
(
tr
(
"can't find latest release of core %s"
,
platform
))
}
if
req
.
UpdatableOnly
{
if
latest
:=
platform
.
GetLatestRelease
();
latest
==
nil
||
latest
==
platformRelease
{
if
latest
==
platformRelease
{
continue
}
}
rpcPlatform
:=
commands
.
PlatformReleaseToRPC
(
platformRelease
)
rpcPlatform
.
Installed
=
platformRelease
.
Version
.
String
()
rpcPlatform
.
Latest
=
latest
.
Version
.
String
()
res
=
append
(
res
,
rpcPlatform
)
}
}
...
...
i18n/data/en.po
View file @
372b881f
...
...
@@ -2129,6 +2129,10 @@ msgstr "can't find dependencies for platform %[1]s: %[2]w"
msgid "can't find latest release of %s"
msgstr "can't find latest release of %s"
#: commands/core/list.go:64
msgid "can't find latest release of core %s"
msgstr "can't find latest release of core %s"
#: arduino/sketch/sketch.go:101
msgid "can't find main Sketch file in %s"
msgstr "can't find main Sketch file in %s"
...
...
@@ -2630,7 +2634,7 @@ msgstr "invalid hash '%[1]s': %[2]s"
#: commands/compile/compile.go:93
#: commands/core/download.go:36
#: commands/core/install.go:35
#: commands/core/list.go:3
8
#: commands/core/list.go:3
9
#: commands/core/search.go:40
#: commands/core/uninstall.go:33
#: commands/core/upgrade.go:40
...
...
@@ -3306,7 +3310,7 @@ msgstr "unable to create a folder to save the sketch files"
msgid "unable to create the folder containing the item"
msgstr "unable to create the folder containing the item"
#: commands/core/list.go:3
3
#: commands/core/list.go:3
4
msgid "unable to find an instance with ID: %d"
msgstr "unable to find an instance with ID: %d"
...
...
i18n/rice-box.go
View file @
372b881f
This source diff could not be displayed because it is too large. You can
view the blob
instead.
test/test_core.py
View file @
372b881f
...
...
@@ -23,6 +23,7 @@ import tempfile
import
hashlib
from
git
import
Repo
from
pathlib
import
Path
import
semver
def
test_core_search
(
run_command
,
httpserver
):
...
...
@@ -753,3 +754,21 @@ def test_core_with_missing_custom_board_options_is_loaded(run_command, data_dir)
+
"skipping loading of boards arduino-beta-dev:platform_with_missing_custom_board_options:nessuno: "
+
"malformed custom board options"
)
in
res
.
stderr
def
test_core_list_outdated_core
(
run_command
):
assert
run_command
(
"update"
)
# Install an old core version
assert
run_command
(
"core install arduino:samd@1.8.6"
)
res
=
run_command
(
"core list --format json"
)
data
=
json
.
loads
(
res
.
stdout
)
assert
len
(
data
)
==
1
samd_core
=
data
[
0
]
assert
samd_core
[
"installed"
]
==
"1.8.6"
installed_version
=
semver
.
parse_version_info
(
samd_core
[
"installed"
])
latest_version
=
semver
.
parse_version_info
(
samd_core
[
"latest"
])
# Installed version must be older than latest
assert
installed_version
.
compare
(
latest_version
)
==
-
1
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment