From 1ed3317a8b875cfb042860c52a2feafd8d0b0dbd Mon Sep 17 00:00:00 2001 From: Jouni Kosonen Date: Sat, 22 Oct 2016 14:00:46 +0300 Subject: Only default to dpkg-architecture output in Debian derivatives --- mesonbuild/mesonlib.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'mesonbuild/mesonlib.py') diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py index abb5641..d47a4ee 100644 --- a/mesonbuild/mesonlib.py +++ b/mesonbuild/mesonlib.py @@ -165,15 +165,17 @@ def version_compare(vstr1, vstr2): return cmpop(varr1, varr2) def default_libdir(): - try: - pc = subprocess.Popen(['dpkg-architecture', '-qDEB_HOST_MULTIARCH'], - stdout=subprocess.PIPE, stderr=subprocess.DEVNULL) - (stdo, _) = pc.communicate() - if pc.returncode == 0: - archpath = stdo.decode().strip() - return 'lib/' + archpath - except Exception: - pass + if is_debianlike(): + try: + pc = subprocess.Popen(['dpkg-architecture', '-qDEB_HOST_MULTIARCH'], + stdout=subprocess.PIPE, + stderr=subprocess.DEVNULL) + (stdo, _) = pc.communicate() + if pc.returncode == 0: + archpath = stdo.decode().strip() + return 'lib/' + archpath + except Exception: + pass if os.path.isdir('/usr/lib64'): return 'lib64' return 'lib' -- cgit v1.1