diff options
author | bugmen0t <@> | 2013-11-23 14:25:04 +0000 |
---|---|---|
committer | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-11-25 22:16:57 +0100 |
commit | defbe48deeb5611667f41a4d78ee17b53dea71cd (patch) | |
tree | ab0291643eb9cb869cc27602c4d2e1de8826c3cd /waftools | |
parent | f26fb0098fdddb03cbb53377416bbd7b0668609d (diff) | |
download | mpv-defbe48deeb5611667f41a4d78ee17b53dea71cd.tar.bz2 mpv-defbe48deeb5611667f41a4d78ee17b53dea71cd.tar.xz |
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
Diffstat (limited to 'waftools')
-rw-r--r-- | waftools/checks/custom.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/waftools/checks/custom.py b/waftools/checks/custom.py index 03f8335279..f070141a23 100644 --- a/waftools/checks/custom.py +++ b/waftools/checks/custom.py @@ -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 "" |