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
1 changed files with 4 additions and 2 deletions

View File

@ -76,12 +76,14 @@ def __fail_oss_check__(ctx):
return False return False
def __get_osslibdir__(): def __get_osslibdir__():
from waflib import Utils
try: 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, p = Utils.subprocess.Popen(cmd, stdin=Utils.subprocess.PIPE,
stdout=Utils.subprocess.PIPE, stdout=Utils.subprocess.PIPE,
stderr=Utils.subprocess.PIPE) stderr=Utils.subprocess.PIPE)
return p.communicate()[0] return p.communicate()[0].rstrip()
except Exception: except Exception:
return "" return ""