blasphemy: exclude directories that we know won't contain the library we're looking for, so as to speed it up

This commit is contained in:
Adrian Kuschelyagi Malacoda 2021-01-27 19:37:57 -06:00
parent 5f4d4fcaac
commit 4d7a15ed3b

View File

@ -46,6 +46,10 @@ def find_library(library):
def find_library_in_search_path(library, path): def find_library_in_search_path(library, path):
for (dirpath, dirnames, filenames) in os.walk(path): for (dirpath, dirnames, filenames) in os.walk(path):
for name in ["sbin", "bin", "share", "include", "etc", "site-packages", "src", "vendor_ruby", "kernel"]:
if name in dirnames:
dirnames.remove(name)
if library in filenames: if library in filenames:
library_path = os.path.join(dirpath, library) library_path = os.path.join(dirpath, library)
if "ELF 64-bit" in file_type(library_path): if "ELF 64-bit" in file_type(library_path):