Skip to content

Commit

Permalink
Merge pull request #6302 from rjbou/curl-config
Browse files Browse the repository at this point in the history
config: correctly tag curl download command when loading from global config
  • Loading branch information
kit-ty-kate authored Nov 16, 2024
2 parents e687af0 + 2c87cff commit d45aa58
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ users)
## Lint

## Repository
* Accurately tag `curl` download command when loaded from global config file [#6270 @rjbou]

## Lock

Expand Down
5 changes: 3 additions & 2 deletions src/state/opamStateConfig.ml
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,9 @@ let load_defaults ?lock_kind root_dir =
| Some conf ->
let open OpamStd.Option.Op in
OpamRepositoryConfig.update
?download_tool:(OpamFile.Config.dl_tool conf >>| function
| (CString c,None)::_ as t
?download_tool:(OpamFile.Config.dl_tool conf
>>| function
| ((CString c| CIdent c), None)::_ as t
when OpamStd.String.ends_with ~suffix:"curl" c -> lazy (t, `Curl)
| t -> lazy (t, `Default))
~validation_hook:(OpamFile.Config.validation_hook conf)
Expand Down
8 changes: 4 additions & 4 deletions tests/reftests/swhid.unix.test
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ The following actions will be performed:
- install snappy-ko 2

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[ERROR] Failed to get sources of snappy-ko.2: Download command failed
[ERROR] Failed to get sources of snappy-ko.2: curl failed

OpamSolution.Fetch_fail("https://fake.exe/url.tar.gz (Download command failed: \"curl --write-out %{http_code}\\n --retry 3 --retry-delay 2 --user-agent opam/current -L -o ${OPAMTMP}/url.tar.gz.part -- https://fake.exe/url.tar.gz\" exited with code 6)")
OpamSolution.Fetch_fail("https://fake.exe/url.tar.gz (curl failed: \"curl --write-out %{http_code}\\n --retry 3 --retry-delay 2 --user-agent opam/current -L -o ${OPAMTMP}/url.tar.gz.part -- https://fake.exe/url.tar.gz\" exited with code 6)")


<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
Expand All @@ -66,9 +66,9 @@ The following actions will be performed:

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
Processing 1/3: [snappy-swhid-dir.2: http]
[ERROR] Failed to get sources of snappy-swhid-dir.2: Download command failed
[ERROR] Failed to get sources of snappy-swhid-dir.2: curl failed

OpamSolution.Fetch_fail("https://fake.exe/url.tar.gz (Download command failed: \"curl --write-out %{http_code}\\n --retry 3 --retry-delay 2 --user-agent opam/current -L -o ${OPAMTMP}/url.tar.gz.part -- https://fake.exe/url.tar.gz\" exited with code 6)")
OpamSolution.Fetch_fail("https://fake.exe/url.tar.gz (curl failed: \"curl --write-out %{http_code}\\n --retry 3 --retry-delay 2 --user-agent opam/current -L -o ${OPAMTMP}/url.tar.gz.part -- https://fake.exe/url.tar.gz\" exited with code 6)")


<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
Expand Down

0 comments on commit d45aa58

Please sign in to comment.