Update perlang-install to detect tls1.2 for curl 7.73+ #185
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As can be seen in the
perlang-install
sceencast at https://perlang.org/download/, certain versions of cURL fails in terms of the TLS 1.2 detection. This is the error we emit in these cases:The root cause for this is that the
curl --help
syntax has changed in recent versions (and ideally, parsing thecurl --help
output isn't a particularly great way anyway, but there's probably not much we can do about that). This commit, originally done by @apnorton in rust-lang/rustup#2604 (thanks!) fixes the issue. Given thatperlang-install
is essentially a fork ofrustup-init.sh
, the patch applied cleanly after merely editing the file name.(After importing the commit, I did change the author of the commit to myself, since it would be a bit misleading to just copy commits from another author in another repo into this repo without their consent; it just looked weird that way.)
Original commit message
(from rust-lang/rustup@01fd3a1)
This fixes rust-lang/rustup#2603. In curl 7.73.0, the help format was
changed so as to only show a summary when calling
curl --help
, whilethe old menu can be accessed as
curl --help all
. This change updatesthe
check_help_for
function to detect if the command being checkedcontains the curl 7.73.0+ language indicating the use of
--help all
.If this language is present,
check_help_for
will insert theall
category after the
--help
flag, allowing the query to work. If thelanguage is not present, then it will insert an empty string following
the
--help
flag, maintaining the same behavior with pre-7.73 versionsof curl.