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
18973684
Unverified
Commit
18973684
authored
Jan 19, 2023
by
MatteoPologruto
Committed by
GitHub
Jan 19, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[skip-changelog] Remove query parameter where it is not needed (#2036)
parent
271d241e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
23 deletions
+16
-23
commands/daemon/daemon.go
commands/daemon/daemon.go
+0
-2
commands/lib/download.go
commands/lib/download.go
+2
-3
commands/lib/install.go
commands/lib/install.go
+11
-14
commands/lib/upgrade.go
commands/lib/upgrade.go
+1
-1
internal/cli/lib/download.go
internal/cli/lib/download.go
+1
-1
internal/cli/lib/install.go
internal/cli/lib/install.go
+1
-1
internal/integrationtest/lib/lib_test.go
internal/integrationtest/lib/lib_test.go
+0
-1
No files found.
commands/daemon/daemon.go
View file @
18973684
...
...
@@ -343,7 +343,6 @@ func (s *ArduinoCoreServerImpl) LibraryDownload(req *rpc.LibraryDownloadRequest,
resp
,
err
:=
lib
.
LibraryDownload
(
stream
.
Context
(),
req
,
func
(
p
*
rpc
.
DownloadProgress
)
{
stream
.
Send
(
&
rpc
.
LibraryDownloadResponse
{
Progress
:
p
})
},
""
,
)
if
err
!=
nil
{
return
convertErrorToRPCStatus
(
err
)
...
...
@@ -357,7 +356,6 @@ func (s *ArduinoCoreServerImpl) LibraryInstall(req *rpc.LibraryInstallRequest, s
stream
.
Context
(),
req
,
func
(
p
*
rpc
.
DownloadProgress
)
{
stream
.
Send
(
&
rpc
.
LibraryInstallResponse
{
Progress
:
p
})
},
func
(
p
*
rpc
.
TaskProgress
)
{
stream
.
Send
(
&
rpc
.
LibraryInstallResponse
{
TaskProgress
:
p
})
},
""
,
)
if
err
!=
nil
{
return
convertErrorToRPCStatus
(
err
)
...
...
commands/lib/download.go
View file @
18973684
...
...
@@ -32,8 +32,7 @@ var tr = i18n.Tr
// LibraryDownload executes the download of the library.
// A DownloadProgressCB callback function must be passed to monitor download progress.
// queryParameter is passed for analysis purposes.
func
LibraryDownload
(
ctx
context
.
Context
,
req
*
rpc
.
LibraryDownloadRequest
,
downloadCB
rpc
.
DownloadProgressCB
,
queryParameter
string
)
(
*
rpc
.
LibraryDownloadResponse
,
error
)
{
func
LibraryDownload
(
ctx
context
.
Context
,
req
*
rpc
.
LibraryDownloadRequest
,
downloadCB
rpc
.
DownloadProgressCB
)
(
*
rpc
.
LibraryDownloadResponse
,
error
)
{
logrus
.
Info
(
"Executing `arduino-cli lib download`"
)
lm
:=
commands
.
GetLibraryManager
(
req
)
...
...
@@ -48,7 +47,7 @@ func LibraryDownload(ctx context.Context, req *rpc.LibraryDownloadRequest, downl
return
nil
,
err
}
if
err
:=
downloadLibrary
(
lm
,
lib
,
downloadCB
,
func
(
*
rpc
.
TaskProgress
)
{},
queryParameter
);
err
!=
nil
{
if
err
:=
downloadLibrary
(
lm
,
lib
,
downloadCB
,
func
(
*
rpc
.
TaskProgress
)
{},
"download"
);
err
!=
nil
{
return
nil
,
err
}
...
...
commands/lib/install.go
View file @
18973684
...
...
@@ -31,8 +31,7 @@ import (
)
// LibraryInstall resolves the library dependencies, then downloads and installs the libraries into the install location.
// queryParameter is passed for analysis purposes and forwarded to the called functions. It is set to "depends" when a dependency is installed
func
LibraryInstall
(
ctx
context
.
Context
,
req
*
rpc
.
LibraryInstallRequest
,
downloadCB
rpc
.
DownloadProgressCB
,
taskCB
rpc
.
TaskProgressCB
,
queryParameter
string
)
error
{
func
LibraryInstall
(
ctx
context
.
Context
,
req
*
rpc
.
LibraryInstallRequest
,
downloadCB
rpc
.
DownloadProgressCB
,
taskCB
rpc
.
TaskProgressCB
)
error
{
lm
:=
commands
.
GetLibraryManager
(
req
)
if
lm
==
nil
{
return
&
arduino
.
InvalidInstanceError
{}
...
...
@@ -98,21 +97,19 @@ func LibraryInstall(ctx context.Context, req *rpc.LibraryInstallRequest, downloa
for
libRelease
,
installTask
:=
range
libReleasesToInstall
{
// Checks if libRelease is the requested library and not a dependency
downloadReason
:=
"depends"
if
libRelease
.
GetName
()
==
req
.
Name
{
if
err
:=
downloadLibrary
(
lm
,
libRelease
,
downloadCB
,
taskCB
,
queryParameter
);
err
!=
nil
{
return
err
}
if
err
:=
installLibrary
(
lm
,
libRelease
,
installTask
,
taskCB
);
err
!=
nil
{
return
err
}
}
else
{
if
err
:=
downloadLibrary
(
lm
,
libRelease
,
downloadCB
,
taskCB
,
"depends"
);
err
!=
nil
{
return
err
}
if
err
:=
installLibrary
(
lm
,
libRelease
,
installTask
,
taskCB
);
err
!=
nil
{
return
err
downloadReason
=
"install"
if
installTask
.
ReplacedLib
!=
nil
{
downloadReason
=
"upgrade"
}
}
if
err
:=
downloadLibrary
(
lm
,
libRelease
,
downloadCB
,
taskCB
,
downloadReason
);
err
!=
nil
{
return
err
}
if
err
:=
installLibrary
(
lm
,
libRelease
,
installTask
,
taskCB
);
err
!=
nil
{
return
err
}
}
if
err
:=
commands
.
Init
(
&
rpc
.
InitRequest
{
Instance
:
req
.
Instance
},
nil
);
err
!=
nil
{
...
...
commands/lib/upgrade.go
View file @
18973684
...
...
@@ -73,7 +73,7 @@ func upgrade(instance *rpc.Instance, libs []*installedLib, downloadCB rpc.Downlo
NoDeps
:
false
,
NoOverwrite
:
false
,
}
err
:=
LibraryInstall
(
context
.
Background
(),
libInstallReq
,
downloadCB
,
taskCB
,
"upgrade"
)
err
:=
LibraryInstall
(
context
.
Background
(),
libInstallReq
,
downloadCB
,
taskCB
)
if
err
!=
nil
{
return
err
}
...
...
internal/cli/lib/download.go
View file @
18973684
...
...
@@ -60,7 +60,7 @@ func runDownloadCommand(cmd *cobra.Command, args []string) {
Name
:
library
.
Name
,
Version
:
library
.
Version
,
}
_
,
err
:=
lib
.
LibraryDownload
(
context
.
Background
(),
libraryDownloadRequest
,
feedback
.
ProgressBar
()
,
"download"
)
_
,
err
:=
lib
.
LibraryDownload
(
context
.
Background
(),
libraryDownloadRequest
,
feedback
.
ProgressBar
())
if
err
!=
nil
{
feedback
.
Fatal
(
tr
(
"Error downloading %[1]s: %[2]v"
,
library
,
err
),
feedback
.
ErrNetwork
)
}
...
...
internal/cli/lib/install.go
View file @
18973684
...
...
@@ -130,7 +130,7 @@ func runInstallCommand(cmd *cobra.Command, args []string) {
NoDeps
:
noDeps
,
NoOverwrite
:
noOverwrite
,
}
err
:=
lib
.
LibraryInstall
(
context
.
Background
(),
libraryInstallRequest
,
feedback
.
ProgressBar
(),
feedback
.
TaskProgress
()
,
"install"
)
err
:=
lib
.
LibraryInstall
(
context
.
Background
(),
libraryInstallRequest
,
feedback
.
ProgressBar
(),
feedback
.
TaskProgress
())
if
err
!=
nil
{
feedback
.
Fatal
(
tr
(
"Error installing %s: %v"
,
libRef
.
Name
,
err
),
feedback
.
ErrGeneric
)
}
...
...
internal/integrationtest/lib/lib_test.go
View file @
18973684
...
...
@@ -1518,5 +1518,4 @@ func TestLibQueryParameters(t *testing.T) {
require
.
NoError
(
t
,
err
)
require
.
Contains
(
t
,
string
(
stdout
),
"Starting download
\x1b
[36murl
\x1b
[0m=
\"
https://downloads.arduino.cc/libraries/github.com/arduino-libraries/WiFi101-0.16.1.zip?query=download
\"\n
"
)
}
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