From: Tim-Philipp Müller Date: Sun, 9 Apr 2017 23:35:18 +0000 (+0100) Subject: Prefer MESONINTROSPECT env var to find mesonintrospect if set X-Git-Tag: 1.19.3~481^2~372 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=af5ee95a5b4a98458a1b3a460947102875769a1c;p=platform%2Fupstream%2Fgstreamer.git Prefer MESONINTROSPECT env var to find mesonintrospect if set This is new in meson 0.40. Makes sure we find and use the mesonintrospect from the same location as our meson, and not some other meson version that just happens to be in the path. We might be using meson directly from a checkout, for example. https://bugzilla.gnome.org/show_bug.cgi?id=781110 --- diff --git a/common.py b/common.py index 8c8b55d..d795bf3 100644 --- a/common.py +++ b/common.py @@ -60,5 +60,18 @@ def get_meson(): mesonintrospect = os.path.join(ROOTDIR, 'meson', 'mesonintrospect.py') return meson, mesonconf, mesonintrospect - return accept_command(["meson.py", "meson"]), accept_command(["mesonconf.py", "mesonconf"]), \ - accept_command(["mesonintrospect.py", "mesonintrospect"]) + mesonintrospect = os.environ.get('MESONINTROSPECT', None) + if mesonintrospect and os.path.exists(mesonintrospect): + mesondir = os.path.dirname(mesonintrospect) + if mesonintrospect.endswith('.py'): + meson = os.path.join(mesondir, 'meson.py') + mesonconf = os.path.join(mesondir, 'mesonconf.py') + else: + meson = os.path.join(mesondir, 'meson') + mesonconf = os.path.join(mesondir, 'mesonconf') + else: + meson = accept_command(["meson.py", "meson"]) + mesonconf = accept_command(["mesonconf.py", "mesonconf"]) + mesonintrospect = accept_command(["mesonintrospect.py", "mesonintrospect"]) + + return meson, mesonconf, mesonintrospect