[jhbuild/feature/regex-based-include-searching] use glob to handle absolue path



commit 3a4fe972630632aa2566b87a537eab820ed99cd5
Author: Sebastian Geiger <sbastig gmx net>
Date:   Sat May 15 17:57:49 2021 +0200

    use glob to handle absolue path

 jhbuild/utils/systeminstall.py | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/jhbuild/utils/systeminstall.py b/jhbuild/utils/systeminstall.py
index 292a7a48..76fd5e82 100644
--- a/jhbuild/utils/systeminstall.py
+++ b/jhbuild/utils/systeminstall.py
@@ -19,6 +19,7 @@
 
 from __future__ import print_function
 
+import glob
 import os
 import sys 
 import logging
@@ -136,7 +137,7 @@ def systemdependencies_met(module_name, sysdeps, config):
         except (EnvironmentError, subprocess.CalledProcessError):
             multiarch = None
         # search /usr/include and its multiarch subdir (if any) by default
-        paths = [ os.path.join(os.sep, 'usr', 'include'), os.path.join(os.sep, 'usr', 'lib')]
+        paths = [ os.path.join(os.sep, 'usr', 'include')]
         if multiarch:
             paths += [ os.path.join(paths[0], multiarch) ]
         paths += extract_path_from_cflags(os.environ.get('CPPFLAGS', ''))
@@ -197,11 +198,13 @@ def systemdependencies_met(module_name, sysdeps, config):
             if c_include_search_paths is None:
                 c_include_search_paths = get_c_include_search_paths(config)
 
+            if os.path.isabs(value):
+                matches = glob.glob(value)
+                if matches:
+                    return True
+
             for path in c_include_search_paths:
-                if not os.path.isabs(value):
-                    filename_glob = os.path.normpath(os.path.join(path, value))
-                else:
-                    filename_glob = value
+                filename_glob = os.path.normpath(os.path.join(path, value))
 
                 # value is a regex, do a tree walk and see if we can find a matching include
                 for root, dirs, files in os.walk(path):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]