From d012b5b997e917a971bca1236a065453493c780d Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Mon, 29 May 2017 20:29:28 +0530 Subject: 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. --- mesonbuild/mesonlib.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mesonbuild/mesonlib.py') 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() -- cgit v1.1