Skip to content

Commit 6b1e9d5

Browse files
Sergio Durigan Juniorpolkorny
andcommitted
Fix curl version comparison
Thanks to @polkorny for identifying a bug in our curl version comparison algorithm! Previously, we'd have problems when curl bumps to version 9.0+ because our logic would wrongly try to match the minor version to "-ge 16", which wouldn't work until curl 9.16 is released. Fix by making stricter comparisons against major and minor curl versions. Signed-off-by: Sergio Durigan Junior <[email protected]> Reported-by: Matheus Polkorny <[email protected]> Co-Authored-by: Matheus Polkorny <[email protected]>
1 parent 9da9020 commit 6b1e9d5

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

wcurl

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,21 +208,26 @@ exec_curl()
208208
curl_version_major=$(echo "$curl_version" | cut -f1 -d.)
209209
curl_version_minor=$(echo "$curl_version" | cut -f2 -d.)
210210

211+
# CURL_NO_CLOBBER="--no-clobber"
212+
# CURL_PARALLEL="--parallel --parallel-max-host 5"
213+
211214
CURL_NO_CLOBBER=""
212215
CURL_PARALLEL=""
213-
# --no-clobber is only supported since 7.83.0.
214-
# --parallel is only supported since 7.66.0.
215-
# --parallel-max-host is only supported since 8.16.0.
216+
216217
if [ "${curl_version_major}" -ge 8 ]; then
217218
CURL_NO_CLOBBER="--no-clobber"
218-
CURL_PARALLEL="--parallel"
219-
if [ "${curl_version_minor}" -ge 16 ]; then
220-
CURL_PARALLEL="--parallel --parallel-max-host 5"
219+
CURL_PARALLEL="--parallel --parallel-max-host 5"
220+
221+
# --parallel-max-host is only supported since 8.16.0.
222+
if [ "${curl_version_major}" -eq 8 ] && [ "${curl_version_minor}" -lt 16 ]; then
223+
CURL_PARALLEL="--parallel"
221224
fi
222225
elif [ "${curl_version_major}" -eq 7 ]; then
226+
# --no-clobber is only supported since 7.83.0.
223227
if [ "${curl_version_minor}" -ge 83 ]; then
224228
CURL_NO_CLOBBER="--no-clobber"
225229
fi
230+
# --parallel is only supported since 7.66.0.
226231
if [ "${curl_version_minor}" -ge 66 ]; then
227232
CURL_PARALLEL="--parallel"
228233
fi

0 commit comments

Comments
 (0)