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
c9d47b49
Commit
c9d47b49
authored
Oct 31, 2018
by
Cristian Maglie
Committed by
Cristian Maglie
Oct 31, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed wrong tool selection if many packagers provides it
Fix #73
parent
22e49adc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
arduino/cores/packagemanager/package_manager.go
arduino/cores/packagemanager/package_manager.go
+5
-3
No files found.
arduino/cores/packagemanager/package_manager.go
View file @
c9d47b49
...
@@ -355,8 +355,9 @@ func (pm *PackageManager) GetAllInstalledToolsReleases() []*cores.ToolRelease {
...
@@ -355,8 +355,9 @@ func (pm *PackageManager) GetAllInstalledToolsReleases() []*cores.ToolRelease {
}
}
func
(
pm
*
PackageManager
)
FindToolsRequiredForBoard
(
board
*
cores
.
Board
)
([]
*
cores
.
ToolRelease
,
error
)
{
func
(
pm
*
PackageManager
)
FindToolsRequiredForBoard
(
board
*
cores
.
Board
)
([]
*
cores
.
ToolRelease
,
error
)
{
// core := board.Properties["build.core"]
pm
.
Log
.
Infof
(
"Searching tools required for board %s"
,
board
)
// core := board.Properties["build.core"]
platform
:=
board
.
PlatformRelease
platform
:=
board
.
PlatformRelease
// maps "PACKAGER:TOOL" => ToolRelease
// maps "PACKAGER:TOOL" => ToolRelease
...
@@ -368,18 +369,19 @@ func (pm *PackageManager) FindToolsRequiredForBoard(board *cores.Board) ([]*core
...
@@ -368,18 +369,19 @@ func (pm *PackageManager) FindToolsRequiredForBoard(board *cores.Board) ([]*core
for
_
,
tool
:=
range
targetPackage
.
Tools
{
for
_
,
tool
:=
range
targetPackage
.
Tools
{
rel
:=
tool
.
GetLatestInstalled
()
rel
:=
tool
.
GetLatestInstalled
()
if
rel
!=
nil
{
if
rel
!=
nil
{
foundTools
[
rel
.
Tool
.
String
()
]
=
rel
foundTools
[
rel
.
Tool
.
Name
]
=
rel
}
}
}
}
}
}
// replace the default tools above with the specific required by the current platform
// replace the default tools above with the specific required by the current platform
for
_
,
toolDep
:=
range
platform
.
Dependencies
{
for
_
,
toolDep
:=
range
platform
.
Dependencies
{
pm
.
Log
.
WithField
(
"tool"
,
toolDep
)
.
Infof
(
"Required tool"
)
tool
:=
pm
.
FindToolDependency
(
toolDep
)
tool
:=
pm
.
FindToolDependency
(
toolDep
)
if
tool
==
nil
{
if
tool
==
nil
{
return
nil
,
fmt
.
Errorf
(
"tool release not found: %s"
,
toolDep
)
return
nil
,
fmt
.
Errorf
(
"tool release not found: %s"
,
toolDep
)
}
}
foundTools
[
tool
.
Tool
.
String
()
]
=
tool
foundTools
[
tool
.
Tool
.
Name
]
=
tool
}
}
requiredTools
:=
[]
*
cores
.
ToolRelease
{}
requiredTools
:=
[]
*
cores
.
ToolRelease
{}
...
...
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