1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-19 13:21:13 +00:00

build: unbreak __get_osslibdir__()

- without Utils.* always returns empty string
- subprocess doesn't need extra quoting for sh -c
- "source" is a bash'ism, not in POSIX sh
- most shell commands embed newline at the end
This commit is contained in:
bugmen0t 2013-11-23 14:25:04 +00:00 committed by Stefano Pigozzi
parent f26fb0098f
commit defbe48dee

View File

@ -76,12 +76,14 @@ def __fail_oss_check__(ctx):
return False
def __get_osslibdir__():
from waflib import Utils
try:
cmd = ['sh', '-c', "'source /etc/oss.conf && echo $OSSLIBDIR'"]
cmd = ['sh', '-c', '. /etc/oss.conf && echo $OSSLIBDIR']
p = Utils.subprocess.Popen(cmd, stdin=Utils.subprocess.PIPE,
stdout=Utils.subprocess.PIPE,
stderr=Utils.subprocess.PIPE)
return p.communicate()[0]
return p.communicate()[0].rstrip()
except Exception:
return ""