Guard against ALL THE THINGS!

pull/387/merge
Jussi Pakkanen 9 years ago
parent 9463c5965e
commit f74d6201eb
  1. 15
      mesonbuild/mesonlib.py

@ -160,12 +160,15 @@ def version_compare(vstr1, vstr2):
return cmpop(varr1, varr2)
def default_libdir():
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
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'

Loading…
Cancel
Save