From 1983e8c3d8df85470f1f077d2622b0e77d49d34e Mon Sep 17 00:00:00 2001 From: egecetin Date: Sun, 29 Dec 2024 15:11:02 +0300 Subject: [PATCH] fix shared object naming --- scripts/dump_syms.py | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/scripts/dump_syms.py b/scripts/dump_syms.py index 668bd54d..e7abde49 100755 --- a/scripts/dump_syms.py +++ b/scripts/dump_syms.py @@ -2,27 +2,10 @@ import errno import os -import re import sys from optparse import OptionParser -def generateVersions(string): - pattern = r"(\d+)\.(\d+)\.(\d+)$" - match = re.search(pattern, string) - - if match: - number1, number2, number3 = match.groups() - base_string = string[: match.start()] - return [ - f"{base_string}{number1}", - f"{base_string}{number1}.{number2}", - f"{base_string}{number1}.{number2}.{number3}", - ] - else: - return [string] - - if __name__ == "__main__": # Parse inputs parser = OptionParser() @@ -51,10 +34,6 @@ def generateVersions(string): and not os.path.islink(os.path.join(binaryDir, filePath)) ] - extendedBinaryPaths = [] - for binaryPath in binaryPaths: - extendedBinaryPaths.extend(generateVersions(binaryPath)) - for binaryPath in binaryPaths: # Prepare command to dump symbols outFilePath = outputDir + os.path.basename(binaryPath) + ".sym" @@ -66,14 +45,12 @@ def generateVersions(string): symFile = open(outFilePath, "r") firstLine = symFile.readline().split(" ") - symbolsDir = ( - outputDir + "/" + os.path.basename(binaryPath) + "/" + firstLine[-2] + "/" - ) + symbolsDir = outputDir + "/" + firstLine[-1].strip() + "/" + firstLine[-2] + "/" try: os.makedirs(symbolsDir) except OSError as exception: if exception.errno != errno.EEXIST: raise - os.rename(outFilePath, symbolsDir + os.path.basename(binaryPath) + ".sym") + os.rename(outFilePath, symbolsDir + firstLine[-1].strip() + ".sym") os.system(f"strip {binaryPath}")