From 658888773072c7cf7f728447b0f4e1ef04bcc758 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Thu, 1 Dec 2022 16:22:29 +0100 Subject: [PATCH 1/5] Updated go-paths-helper to v1.8.0 --- .licenses/go/github.com/arduino/go-paths-helper.dep.yml | 2 +- arduino/discovery/discovery_client/go.mod | 2 +- arduino/discovery/discovery_client/go.sum | 4 ++-- client_example/go.sum | 2 +- docsgen/go.mod | 2 +- docsgen/go.sum | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.licenses/go/github.com/arduino/go-paths-helper.dep.yml b/.licenses/go/github.com/arduino/go-paths-helper.dep.yml index a85b5285431..53141215dab 100644 --- a/.licenses/go/github.com/arduino/go-paths-helper.dep.yml +++ b/.licenses/go/github.com/arduino/go-paths-helper.dep.yml @@ -1,6 +1,6 @@ --- name: github.com/arduino/go-paths-helper -version: v1.7.0 +version: v1.8.0 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/go-paths-helper diff --git a/arduino/discovery/discovery_client/go.mod b/arduino/discovery/discovery_client/go.mod index 6d1c6b6a9f4..6652c9852b6 100644 --- a/arduino/discovery/discovery_client/go.mod +++ b/arduino/discovery/discovery_client/go.mod @@ -11,7 +11,7 @@ require ( ) require ( - github.com/arduino/go-paths-helper v1.7.0 // indirect + github.com/arduino/go-paths-helper v1.8.0 // indirect github.com/arduino/go-properties-orderedmap v1.7.1 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/konsorten/go-windows-terminal-sequences v1.0.1 // indirect diff --git a/arduino/discovery/discovery_client/go.sum b/arduino/discovery/discovery_client/go.sum index 6ad8d7bdc4d..316c421e9fd 100644 --- a/arduino/discovery/discovery_client/go.sum +++ b/arduino/discovery/discovery_client/go.sum @@ -44,8 +44,8 @@ github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYU github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/arduino/go-paths-helper v1.0.1/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck= github.com/arduino/go-paths-helper v1.2.0/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck= -github.com/arduino/go-paths-helper v1.7.0 h1:S9l5BP2aogz1CgyqqnncXt0PLpK4yvwOW/wu/LaR3tc= -github.com/arduino/go-paths-helper v1.7.0/go.mod h1:V82BWgAAp4IbmlybxQdk9Bpkz8M4Qyx+RAFKaG9NuvU= +github.com/arduino/go-paths-helper v1.8.0 h1:BfA1bq1XktnlqwfUDCoKbUqB3YFPe6X7szPSZj6Rdpk= +github.com/arduino/go-paths-helper v1.8.0/go.mod h1:V82BWgAAp4IbmlybxQdk9Bpkz8M4Qyx+RAFKaG9NuvU= github.com/arduino/go-properties-orderedmap v1.7.1 h1:HQ9Pn/mk3+XyfrE39EEvaZwJkrvgiVSY5Oq3JSEfOR4= github.com/arduino/go-properties-orderedmap v1.7.1/go.mod h1:DKjD2VXY/NZmlingh4lSFMEYCVubfeArCsGPGDwb2yk= github.com/arduino/go-timeutils v0.0.0-20171220113728-d1dd9e313b1b/go.mod h1:uwGy5PpN4lqW97FiLnbcx+xx8jly5YuPMJWfVwwjJiQ= diff --git a/client_example/go.sum b/client_example/go.sum index cd793e04060..a8ad790d6cb 100644 --- a/client_example/go.sum +++ b/client_example/go.sum @@ -44,7 +44,7 @@ github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYU github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/arduino/go-paths-helper v1.0.1/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck= github.com/arduino/go-paths-helper v1.2.0/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck= -github.com/arduino/go-paths-helper v1.7.0/go.mod h1:V82BWgAAp4IbmlybxQdk9Bpkz8M4Qyx+RAFKaG9NuvU= +github.com/arduino/go-paths-helper v1.8.0/go.mod h1:V82BWgAAp4IbmlybxQdk9Bpkz8M4Qyx+RAFKaG9NuvU= github.com/arduino/go-properties-orderedmap v1.7.1/go.mod h1:DKjD2VXY/NZmlingh4lSFMEYCVubfeArCsGPGDwb2yk= github.com/arduino/go-timeutils v0.0.0-20171220113728-d1dd9e313b1b/go.mod h1:uwGy5PpN4lqW97FiLnbcx+xx8jly5YuPMJWfVwwjJiQ= github.com/arduino/go-win32-utils v0.0.0-20180330194947-ed041402e83b/go.mod h1:iIPnclBMYm1g32Q5kXoqng4jLhMStReIP7ZxaoUC2y8= diff --git a/docsgen/go.mod b/docsgen/go.mod index 4c91e2749f7..8a0f379a82c 100644 --- a/docsgen/go.mod +++ b/docsgen/go.mod @@ -11,7 +11,7 @@ require ( ) require ( - github.com/arduino/go-paths-helper v1.7.0 // indirect + github.com/arduino/go-paths-helper v1.8.0 // indirect github.com/arduino/go-properties-orderedmap v1.7.1 // indirect github.com/arduino/go-timeutils v0.0.0-20171220113728-d1dd9e313b1b // indirect github.com/arduino/go-win32-utils v0.0.0-20180330194947-ed041402e83b // indirect diff --git a/docsgen/go.sum b/docsgen/go.sum index 42a082e6c5f..c49f0d7c8a4 100644 --- a/docsgen/go.sum +++ b/docsgen/go.sum @@ -46,8 +46,8 @@ github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYU github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/arduino/go-paths-helper v1.0.1/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck= github.com/arduino/go-paths-helper v1.2.0/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck= -github.com/arduino/go-paths-helper v1.7.0 h1:S9l5BP2aogz1CgyqqnncXt0PLpK4yvwOW/wu/LaR3tc= -github.com/arduino/go-paths-helper v1.7.0/go.mod h1:V82BWgAAp4IbmlybxQdk9Bpkz8M4Qyx+RAFKaG9NuvU= +github.com/arduino/go-paths-helper v1.8.0 h1:BfA1bq1XktnlqwfUDCoKbUqB3YFPe6X7szPSZj6Rdpk= +github.com/arduino/go-paths-helper v1.8.0/go.mod h1:V82BWgAAp4IbmlybxQdk9Bpkz8M4Qyx+RAFKaG9NuvU= github.com/arduino/go-properties-orderedmap v1.7.1 h1:HQ9Pn/mk3+XyfrE39EEvaZwJkrvgiVSY5Oq3JSEfOR4= github.com/arduino/go-properties-orderedmap v1.7.1/go.mod h1:DKjD2VXY/NZmlingh4lSFMEYCVubfeArCsGPGDwb2yk= github.com/arduino/go-timeutils v0.0.0-20171220113728-d1dd9e313b1b h1:9hDi4F2st6dbLC3y4i02zFT5quS4X6iioWifGlVwfy4= diff --git a/go.mod b/go.mod index b4532e290c8..801c4c2498a 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ go 1.17 replace github.com/mailru/easyjson => github.com/cmaglie/easyjson v0.8.1 require ( - github.com/arduino/go-paths-helper v1.7.0 + github.com/arduino/go-paths-helper v1.8.0 github.com/arduino/go-properties-orderedmap v1.7.1 github.com/arduino/go-timeutils v0.0.0-20171220113728-d1dd9e313b1b github.com/arduino/go-win32-utils v0.0.0-20180330194947-ed041402e83b diff --git a/go.sum b/go.sum index 572bdc4dc65..ffc54d2c315 100644 --- a/go.sum +++ b/go.sum @@ -46,8 +46,8 @@ github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYU github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/arduino/go-paths-helper v1.0.1/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck= github.com/arduino/go-paths-helper v1.2.0/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck= -github.com/arduino/go-paths-helper v1.7.0 h1:S9l5BP2aogz1CgyqqnncXt0PLpK4yvwOW/wu/LaR3tc= -github.com/arduino/go-paths-helper v1.7.0/go.mod h1:V82BWgAAp4IbmlybxQdk9Bpkz8M4Qyx+RAFKaG9NuvU= +github.com/arduino/go-paths-helper v1.8.0 h1:BfA1bq1XktnlqwfUDCoKbUqB3YFPe6X7szPSZj6Rdpk= +github.com/arduino/go-paths-helper v1.8.0/go.mod h1:V82BWgAAp4IbmlybxQdk9Bpkz8M4Qyx+RAFKaG9NuvU= github.com/arduino/go-properties-orderedmap v1.7.1 h1:HQ9Pn/mk3+XyfrE39EEvaZwJkrvgiVSY5Oq3JSEfOR4= github.com/arduino/go-properties-orderedmap v1.7.1/go.mod h1:DKjD2VXY/NZmlingh4lSFMEYCVubfeArCsGPGDwb2yk= github.com/arduino/go-timeutils v0.0.0-20171220113728-d1dd9e313b1b h1:9hDi4F2st6dbLC3y4i02zFT5quS4X6iioWifGlVwfy4= From a30e1aa3dbc86a6e04e1ea768f82eaf278c811a7 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Tue, 6 Dec 2022 10:41:18 +0100 Subject: [PATCH 2/5] Pass of go-fmt --- commands/upload/upload.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/commands/upload/upload.go b/commands/upload/upload.go index 95631369991..b026e45ff2d 100644 --- a/commands/upload/upload.go +++ b/commands/upload/upload.go @@ -629,11 +629,13 @@ func detectSketchNameFromBuildPath(buildPath *paths.Path) (string, error) { // specified protocol properties. // // For example passing the below properties and "upload" as action and "serial" as protocol: +// // upload.speed=256 // upload.serial.speed=57600 // upload.network.speed=19200 // // will return: +// // upload.speed=57600 // upload.serial.speed=57600 // upload.network.speed=19200 From 6d8b529db73837a157377d7a08d1c818d0bcc9a1 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Thu, 1 Dec 2022 19:27:29 +0100 Subject: [PATCH 3/5] Removed unused functions --- cli/output/rpc_progress.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/cli/output/rpc_progress.go b/cli/output/rpc_progress.go index f2e478d67fc..880ab26fa56 100644 --- a/cli/output/rpc_progress.go +++ b/cli/output/rpc_progress.go @@ -93,11 +93,6 @@ func NewDownloadProgressBarCB() func(*rpc.DownloadProgress) { } } -// NewNullDownloadProgressCB returns a progress bar callback that outputs nothing. -func NewNullDownloadProgressCB() func(*rpc.DownloadProgress) { - return func(*rpc.DownloadProgress) {} -} - // NewTaskProgressCB returns a commands.TaskProgressCB progress listener // that outputs to terminal func NewTaskProgressCB() func(curr *rpc.TaskProgress) { @@ -121,8 +116,3 @@ func NewTaskProgressCB() func(curr *rpc.TaskProgress) { } } } - -// NewNullTaskProgressCB returns a progress bar callback that outputs nothing. -func NewNullTaskProgressCB() func(curr *rpc.TaskProgress) { - return func(curr *rpc.TaskProgress) {} -} From 46e5aa12df56f28187f514b87e7d2efa5c675c83 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Fri, 2 Dec 2022 13:19:29 +0100 Subject: [PATCH 4/5] Removed dep golang.org/x/crypto/ssh/terminal in favor of golang.org/x/term --- .../golang.org/x/crypto/ssh/terminal.dep.yml | 63 ------------------- cli/arguments/user_fields.go | 4 +- go.mod | 2 +- 3 files changed, 3 insertions(+), 66 deletions(-) delete mode 100644 .licenses/go/golang.org/x/crypto/ssh/terminal.dep.yml diff --git a/.licenses/go/golang.org/x/crypto/ssh/terminal.dep.yml b/.licenses/go/golang.org/x/crypto/ssh/terminal.dep.yml deleted file mode 100644 index 43a34ca6961..00000000000 --- a/.licenses/go/golang.org/x/crypto/ssh/terminal.dep.yml +++ /dev/null @@ -1,63 +0,0 @@ ---- -name: golang.org/x/crypto/ssh/terminal -version: v0.0.0-20210921155107-089bfa567519 -type: go -summary: Package terminal provides support functions for dealing with terminals, as - commonly found on UNIX systems. -homepage: https://pkg.go.dev/golang.org/x/crypto/ssh/terminal -license: bsd-3-clause -licenses: -- sources: crypto@v0.0.0-20210921155107-089bfa567519/LICENSE - text: | - Copyright (c) 2009 The Go Authors. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: crypto@v0.0.0-20210921155107-089bfa567519/PATENTS - text: | - Additional IP Rights Grant (Patents) - - "This implementation" means the copyrightable works distributed by - Google as part of the Go project. - - Google hereby grants to You a perpetual, worldwide, non-exclusive, - no-charge, royalty-free, irrevocable (except as stated in this section) - patent license to make, have made, use, offer to sell, sell, import, - transfer and otherwise run, modify and propagate the contents of this - implementation of Go, where such license applies only to those patent - claims, both currently owned or controlled by Google and acquired in - the future, licensable by Google that are necessarily infringed by this - implementation of Go. This grant does not include claims that would be - infringed only as a consequence of further modification of this - implementation. If you or your agent or exclusive licensee institute or - order or agree to the institution of patent litigation against any - entity (including a cross-claim or counterclaim in a lawsuit) alleging - that this implementation of Go or any code incorporated within this - implementation of Go constitutes direct or contributory patent - infringement, or inducement of patent infringement, then any patent - rights granted to you under this License for this implementation of Go - shall terminate as of the date such litigation is filed. -notices: [] diff --git a/cli/arguments/user_fields.go b/cli/arguments/user_fields.go index 480ab38b599..edef603e809 100644 --- a/cli/arguments/user_fields.go +++ b/cli/arguments/user_fields.go @@ -22,7 +22,7 @@ import ( "github.com/arduino/arduino-cli/cli/feedback" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" - "golang.org/x/crypto/ssh/terminal" + "golang.org/x/term" ) // AskForUserFields prompts the user to input the provided user fields. @@ -36,7 +36,7 @@ func AskForUserFields(userFields []*rpc.UserField) map[string]string { var value []byte var err error if f.Secret { - value, err = terminal.ReadPassword(int(os.Stdin.Fd())) + value, err = term.ReadPassword(int(os.Stdin.Fd())) } else { value, err = reader.ReadBytes('\n') } diff --git a/go.mod b/go.mod index 801c4c2498a..b0047c9301e 100644 --- a/go.mod +++ b/go.mod @@ -51,6 +51,7 @@ require ( require ( github.com/rogpeppe/go-internal v1.3.0 go.bug.st/testifyjson v1.1.1 + golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 gopkg.in/yaml.v3 v3.0.1 ) @@ -87,7 +88,6 @@ require ( github.com/xanzy/ssh-agent v0.2.1 // indirect golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect - golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect gopkg.in/ini.v1 v1.62.0 // indirect gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect From a60cbee34da30ec1c0a76c3d344c4960a87fb9b1 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Tue, 6 Dec 2022 12:37:07 +0100 Subject: [PATCH 5/5] Fixed wrong error message --- arduino/errors.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arduino/errors.go b/arduino/errors.go index 823c2ed99bf..1fbb18841cd 100644 --- a/arduino/errors.go +++ b/arduino/errors.go @@ -235,7 +235,7 @@ func (e *InvalidProfileError) ToRPCStatus() *status.Status { type MissingPortAddressError struct{} func (e *MissingPortAddressError) Error() string { - return tr("Missing port protocol") + return tr("Missing port address") } // ToRPCStatus converts the error into a *status.Status