From defbe48deeb5611667f41a4d78ee17b53dea71cd Mon Sep 17 00:00:00 2001 From: bugmen0t <@> Date: Sat, 23 Nov 2013 14:25:04 +0000 Subject: [PATCH] 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 --- waftools/checks/custom.py | 6 ++++-- 1 file 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 ""