Make the name-clash detection more readable

No functional changes.

Signed-off-by: Bence Szépkúti <[email protected]>
This commit is contained in:
Bence Szépkúti
2025-12-18 20:20:25 +01:00
parent feed0606f0
commit 9f715c0e78
+11 -4
View File
@@ -251,10 +251,17 @@ class AbiChecker:
self.log.debug(build_output.decode("utf-8"))
for root, _dirs, files in os.walk(build_dir):
for file in fnmatch.filter(files, "*.so"):
new_path = os.path.join(root, file)
path = version.modules.setdefault(os.path.splitext(file)[0], new_path)
if path != new_path and not filecmp.cmp(path, new_path, False):
raise Exception(f"The following libraries differ, but have the same soname:\n{path}\n{new_path}")
basename = os.path.splitext(file)[0]
path = os.path.join(root, file)
if basename in version.modules:
if not filecmp.cmp(version.modules[basename], path):
raise Exception(
"The following libraries differ, but have the same name:\n"
f"{version.modules[basename]}\n"
f"{path}"
)
else:
version.modules[basename] = path
@staticmethod
def _pretty_revision(version):