@@ -130,6 +130,7 @@ func (t *Tools) DownloadPackageIndex(index_file, signature_file string) error {
130130// It will extract it in a folder in .arduino-create, and it will update the
131131// Installed map.
132132//
133+ // pack contains the packager of the tool
133134// name contains the name of the tool.
134135// version contains the version of the tool.
135136// 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 {
140141// If version is not "latest" and behaviour is "replace", it will download the
141142// version again. If instead behaviour is "keep" it will not download the version
142143// 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 {
144145
145146 index_file := path .Join (t .Directory , "package_index.json" )
146147 signature_file := path .Join (t .Directory , "package_index.json.sig" )
@@ -169,10 +170,10 @@ func (t *Tools) Download(name, version, behaviour string) error {
169170 t .Logger .Println (string (body ))
170171
171172 // Find the tool by name
172- correctTool , correctSystem := findTool (name , version , data )
173+ correctTool , correctSystem := findTool (pack , name , version , data )
173174
174175 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 )
176177 return nil
177178 }
178179
@@ -255,11 +256,14 @@ func (t *Tools) Download(name, version, behaviour string) error {
255256 return t .writeMap ()
256257}
257258
258- func findTool (name , version string , data index ) (tool , system ) {
259+ func findTool (pack , name , version string , data index ) (tool , system ) {
259260 var correctTool tool
260261 correctTool .Version = "0.0"
261262
262263 for _ , p := range data .Packages {
264+ if p .Name != pack {
265+ continue
266+ }
263267 for _ , t := range p .Tools {
264268 if version != "latest" {
265269 if t .Name == name && t .Version == version {
0 commit comments