@@ -130,6 +130,7 @@ func (t *Tools) DownloadPackageIndex(index_file, signature_file string) error {
130
130
// It will extract it in a folder in .arduino-create, and it will update the
131
131
// Installed map.
132
132
//
133
+ // pack contains the packager of the tool
133
134
// name contains the name of the tool.
134
135
// version contains the version of the tool.
135
136
// behaviour contains the strategy to use when there is already a tool installed
@@ -140,7 +141,7 @@ func (t *Tools) DownloadPackageIndex(index_file, signature_file string) error {
140
141
// If version is not "latest" and behaviour is "replace", it will download the
141
142
// version again. If instead behaviour is "keep" it will not download the version
142
143
// if it already exists.
143
- func (t * Tools ) Download (name , version , behaviour string ) error {
144
+ func (t * Tools ) Download (pack , name , version , behaviour string ) error {
144
145
145
146
index_file := path .Join (t .Directory , "package_index.json" )
146
147
signature_file := path .Join (t .Directory , "package_index.json.sig" )
@@ -169,10 +170,10 @@ func (t *Tools) Download(name, version, behaviour string) error {
169
170
t .Logger .Println (string (body ))
170
171
171
172
// Find the tool by name
172
- correctTool , correctSystem := findTool (name , version , data )
173
+ correctTool , correctSystem := findTool (pack , name , version , data )
173
174
174
175
if correctTool .Name == "" || correctSystem .URL == "" {
175
- t .Logger .Println ("We couldn't find a tool with the name " + name + " and version " + version )
176
+ t .Logger .Println ("We couldn't find a tool with the name " + name + " and version " + version + " packaged by " + pack )
176
177
return nil
177
178
}
178
179
@@ -255,11 +256,14 @@ func (t *Tools) Download(name, version, behaviour string) error {
255
256
return t .writeMap ()
256
257
}
257
258
258
- func findTool (name , version string , data index ) (tool , system ) {
259
+ func findTool (pack , name , version string , data index ) (tool , system ) {
259
260
var correctTool tool
260
261
correctTool .Version = "0.0"
261
262
262
263
for _ , p := range data .Packages {
264
+ if p .Name != pack {
265
+ continue
266
+ }
263
267
for _ , t := range p .Tools {
264
268
if version != "latest" {
265
269
if t .Name == name && t .Version == version {
0 commit comments