From 37718c65e9efd348824948aec3dc29483b49ec55 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sat, 1 Feb 2025 19:36:25 +0100 Subject: [PATCH] Simplify cURL etag feature detection following discussion in #5873 Signed-off-by: DL6ER --- gravity.sh | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/gravity.sh b/gravity.sh index 276e59c2..f6d09ac5 100755 --- a/gravity.sh +++ b/gravity.sh @@ -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