Simplify cURL etag feature detection following discussion in #5873

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER 2025-02-01 19:36:25 +01:00
parent 68b03e114c
commit 37718c65e9
No known key found for this signature in database
GPG key ID: 00135ACBD90B28DD

View file

@ -507,17 +507,12 @@ gravity_DownloadBlocklists() {
echo -e " ${INFO} Libz compression not available\n"
fi
# Check if etag is supported by the locally available version of curl by
# comparing the version string being >= 7.68.0 (released Jan 2020)
# https://github.com/curl/curl/pull/4543 followed by
# Check if etag is supported by the locally available version of curl
# (available as of curl 7.68.0, released Jan 2020)
# https://github.com/curl/curl/pull/4543 +
# https://github.com/curl/curl/pull/4678
if echo "${curlVersion}" | grep -q "curl 7\.[6-9][8-9]"; then
if curl --help all | grep -q "etag-save"; then
etag_support=true
else
# Check if the version is >= 8
if echo "${curlVersion}" | grep -q "curl 8"; then
etag_support=true
fi
fi
# Loop through $sources and download each one