diff options
author | Fernando Fernandez Mancera <ffmancera@riseup.net> | 2023-05-15 15:19:19 +0200 |
---|---|---|
committer | Fernando Fernandez Mancera <ffmancera@riseup.net> | 2023-05-15 15:19:19 +0200 |
commit | f45625a89764cabd99b512b11b884821501aae89 (patch) | |
tree | a8d2468c542040f174cf3016841b6cd8bf790da5 | |
parent | a235bb3c6f03e93b92dda231f32a5fbc178d8328 (diff) | |
parent | bc0818fe1339bfd25b1b30cd7e86772cc8bee9c5 (diff) | |
download | NetworkManager-f45625a89764cabd99b512b11b884821501aae89.tar.gz |
merge: branch 'ff/bond_port_version_symbol'
-rw-r--r-- | src/libnm-client-impl/libnm.ver | 6 | ||||
-rwxr-xr-x | src/libnm-client-impl/tests/test-gir.py | 22 |
2 files changed, 13 insertions, 15 deletions
diff --git a/src/libnm-client-impl/libnm.ver b/src/libnm-client-impl/libnm.ver index f473da2041..67a564fb2e 100644 --- a/src/libnm-client-impl/libnm.ver +++ b/src/libnm-client-impl/libnm.ver @@ -1879,6 +1879,11 @@ global: nm_vpn_plugin_info_supports_multiple; } libnm_1_40_0; +libnm_1_40_20_bondp { +global: + nm_setting_bond_port_get_prio; +} libnm_1_40_0; + libnm_1_42_0 { global: nm_client_get_version_info; @@ -1928,7 +1933,6 @@ global: libnm_1_44_0 { global: - nm_setting_bond_port_get_prio; nm_setting_gsm_get_initial_eps_apn; nm_setting_gsm_get_initial_eps_config; nm_setting_ip6_config_get_dhcp_pd_hint; diff --git a/src/libnm-client-impl/tests/test-gir.py b/src/libnm-client-impl/tests/test-gir.py index d91849b8fe..9b42431c1e 100755 --- a/src/libnm-client-impl/tests/test-gir.py +++ b/src/libnm-client-impl/tests/test-gir.py @@ -7,6 +7,7 @@ from __future__ import print_function import xml.etree.ElementTree as ET import argparse +import re import sys C_NS = "http://www.gtk.org/introspection/c/1.0" @@ -60,17 +61,6 @@ def str_removesuffix(string, suffix): return string -# Older Python doesn't have str.removeprefix() -def str_removeprefix(string, prefix): - try: - return string.removeprefix(prefix) - except AttributeError: - if string.startswith(prefix): - return string[len(prefix) :] - else: - return string - - def syms_from_ver(verfile): c_syms = {} for line in open(verfile).readlines(): @@ -78,8 +68,10 @@ def syms_from_ver(verfile): if line.endswith("{"): line = str_removesuffix(line, " {") - line = str_removeprefix(line, "libnm_") - (major, minor, micro) = line.split("_") + m = re.search(r"^libnm_([0-9]+)_([0-9]+)_([0-9]+)$", line) + if not m: + continue + (major, minor, micro) = m.groups() if int(major) > 1 or int(minor) > 0: if int(micro) > 0: # Snap to next major version. Perhaps not @@ -97,8 +89,10 @@ def syms_from_ver(verfile): ): c_syms[str_removesuffix(line, ";")] = version - # This one is... messy. + # These are exceptions and we cannot know the version for the symbol so we + # hardcode it. c_syms["nm_ethtool_optname_is_feature"] = "1.20" + c_syms["nm_setting_bond_port_get_prio"] = "1.44" return c_syms |