diff --git a/master_changes.md b/master_changes.md index 2cd003086c9..935996f6c44 100644 --- a/master_changes.md +++ b/master_changes.md @@ -61,6 +61,7 @@ users) ## Lint ## Repository + * Accurately tag `curl` download command when loaded from global config file [#6270 @rjbou] ## Lock diff --git a/src/state/opamStateConfig.ml b/src/state/opamStateConfig.ml index 5519c0315c0..5b612481ce8 100644 --- a/src/state/opamStateConfig.ml +++ b/src/state/opamStateConfig.ml @@ -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) diff --git a/tests/reftests/swhid.unix.test b/tests/reftests/swhid.unix.test index c13ca90908b..737711c3e98 100644 --- a/tests/reftests/swhid.unix.test +++ b/tests/reftests/swhid.unix.test @@ -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 <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> @@ -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 <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>