From 62681b2aeb6cb482fadf13dbcc7840b182454cd8 Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Fri, 23 Aug 2024 01:41:14 +0200 Subject: [PATCH] Using a helper function to see if the algorithm works. --- src/loaih/build.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/loaih/build.py b/src/loaih/build.py index 1276404..9e18b7c 100644 --- a/src/loaih/build.py +++ b/src/loaih/build.py @@ -683,3 +683,13 @@ class Build(): if not self.debug: # Cleaning up build directory shutil.rmtree(self.builddir) + + +def libfinderhelper(libraryname): + """Uses system tools to identify the missing package.""" + + libsearch = subprocess.run(shlex.split( + f"sudo apt-file find -lx {libraryname}$" + ), check=True, capture_output=True) + candidate = [ x for x in libsearch.stdout.decode('utf-8').split('\n') if 'lib' in x ][0] + return candidate