aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mesonlib.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-05-29 20:29:28 +0530
committerJussi Pakkanen <jpakkane@gmail.com>2018-03-19 23:45:43 +0200
commitd012b5b997e917a971bca1236a065453493c780d (patch)
treeb7e0737ea9d22d2a6b0b3a0a29bdc7c78d824ea5 /mesonbuild/mesonlib.py
parente984e1072b28abfa4ac278992a8ef6d138c15608 (diff)
downloadmeson-d012b5b997e917a971bca1236a065453493c780d.zip
meson-d012b5b997e917a971bca1236a065453493c780d.tar.gz
meson-d012b5b997e917a971bca1236a065453493c780d.tar.bz2
Create a helper for checking if a string has a path component
This is used in a number of places, and in some places it is incomplete. Use a helper to ensure it's used properly.
Diffstat (limited to 'mesonbuild/mesonlib.py')
-rw-r--r--mesonbuild/mesonlib.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py
index 4e72600..247b4f9 100644
--- a/mesonbuild/mesonlib.py
+++ b/mesonbuild/mesonlib.py
@@ -519,6 +519,12 @@ def get_library_dirs():
unixdirs += glob('/lib/' + plat + '*')
return unixdirs
+def has_path_sep(name, sep='/\\'):
+ 'Checks if any of the specified @sep path separators are in @name'
+ for each in sep:
+ if each in name:
+ return True
+ return False
def do_replacement(regex, line, confdata):
missing_variables = set()