mirror of
https://github.com/weechat/weechat.git
synced 2026-06-12 14:14:48 +02:00
Bump required (lib)curl to v7.47.0
Bump the requirement to v7.47.0 as available in Ubuntu 16.04 (7.47.0) and Debian 10 (7.64.0). It was released around 9 years ago and any remotely supported distribution has newer version. As result we can adjust the tools/check_curl_symbols.py script to omit the ~70% of the guards and simplify the code base. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
This commit is contained in:
committed by
Sébastien Helleu
parent
fec71ae30c
commit
51dfb1fb78
@@ -50,6 +50,9 @@ SRC_PATH = (
|
||||
Path(__file__).resolve().parent.parent / "src" / "core" / "core-url.c"
|
||||
)
|
||||
|
||||
# NOTE: keep version in sync with CMakeLists.txt
|
||||
CURL_MIN_VERSION_STR = "7.47.0"
|
||||
|
||||
WEECHAT_CURL_MIN_VERSION_RE = (
|
||||
r"#if LIBCURL_VERSION_NUM >= (?P<hex_min_version>0x[0-9A-F]+) "
|
||||
r"/\* (?P<str_min_version>[0-9][0-9.]+) \*/"
|
||||
@@ -145,6 +148,33 @@ def get_curl_symbols(symbols_file: TextIO) -> Dict[str, Tuple[int, int]]:
|
||||
return symbols
|
||||
|
||||
|
||||
def check_req_symbols(symbols: List[WeechatCurlSymbol]) -> int:
|
||||
"""
|
||||
Checks the symbols' min/max version, relative to minimum Curl version that
|
||||
we require.
|
||||
|
||||
:return: errors
|
||||
"""
|
||||
errors: int = 0
|
||||
req_curl = curl_version_to_int(CURL_MIN_VERSION_STR)
|
||||
for symbol in symbols:
|
||||
if symbol.min_curl and symbol.min_curl <= req_curl:
|
||||
print(
|
||||
f"{SRC_PATH}:{symbol.line_no}: min version for "
|
||||
f"symbol {symbol.name} older than minimal required "
|
||||
f"curl {req_curl}. Remove if guard."
|
||||
)
|
||||
errors += 1
|
||||
if symbol.max_curl and symbol.max_curl < req_curl:
|
||||
print(
|
||||
f"{SRC_PATH}:{symbol.line_no}: max version for "
|
||||
f"symbol {symbol.name} older than minimal required "
|
||||
f"curl {req_curl}. Remove the symbol."
|
||||
)
|
||||
errors += 1
|
||||
return errors
|
||||
|
||||
|
||||
def get_weechat_curl_symbols() -> Tuple[List[WeechatCurlSymbol], int]:
|
||||
"""
|
||||
Parse Curl symbols declared in src/core/core-url.c.
|
||||
@@ -238,6 +268,8 @@ def get_weechat_curl_symbols() -> Tuple[List[WeechatCurlSymbol], int]:
|
||||
name = f"CURLOPT_{match['name']}"
|
||||
symbols.append(WeechatCurlSymbol(name, v_min, v_max, line_no))
|
||||
continue
|
||||
|
||||
errors += check_req_symbols(symbols)
|
||||
return symbols, errors
|
||||
|
||||
|
||||
@@ -251,6 +283,7 @@ def check_symbols(
|
||||
:param weechat_curl_symbols: list of Curl symbols in WeeChat
|
||||
:param curl_symbols: list of all Curl symbols
|
||||
"""
|
||||
req_curl = curl_version_to_int(CURL_MIN_VERSION_STR)
|
||||
to_str = curl_version_to_str
|
||||
errors = 0
|
||||
for symbol in weechat_curl_symbols:
|
||||
@@ -262,7 +295,7 @@ def check_symbols(
|
||||
)
|
||||
errors += 1
|
||||
continue
|
||||
if symbol.min_curl != curl_symbol[0]:
|
||||
if curl_symbol[0] > req_curl and symbol.min_curl != curl_symbol[0]:
|
||||
print(
|
||||
f"{SRC_PATH}:{symbol.line_no}: min version for "
|
||||
f"symbol {symbol.name} differs: "
|
||||
@@ -270,7 +303,7 @@ def check_symbols(
|
||||
f"{to_str(curl_symbol[0])} in Curl"
|
||||
)
|
||||
errors += 1
|
||||
if symbol.max_curl != curl_symbol[1]:
|
||||
if curl_symbol[1] >= req_curl and symbol.max_curl != curl_symbol[1]:
|
||||
print(
|
||||
f"{SRC_PATH}:{symbol.line_no}: max version for "
|
||||
f"symbol {symbol.name} differs: "
|
||||
|
||||
Reference in New Issue
Block a user