From fd711114772b2af40e2d56845e77b5c1cb5ebdb0 Mon Sep 17 00:00:00 2001 From: mduigou Date: Wed, 3 Apr 2013 16:26:10 -0700 Subject: [PATCH] 8011350: hgforest.sh uses non-POSIX sh features that may fail with some shells Reviewed-by: tbell, katleman, dholmes --- common/bin/hgforest.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/bin/hgforest.sh b/common/bin/hgforest.sh index ebb76df..12cf023 100644 --- a/common/bin/hgforest.sh +++ b/common/bin/hgforest.sh @@ -30,7 +30,7 @@ pull_extra_base="$2" # Python always buffers stdout significantly, thus we will not see any output from hg clone jdk, # until a lot of time has passed! By passing -u to python, we get incremental updates # on stdout. Much nicer. -whichhg="`which hg`" +whichhg="`which hg 2> /dev/null | grep -v '^no hg in'`" if [ "${whichhg}" = "" ] ; then echo Cannot find hg! @@ -51,7 +51,7 @@ if [ "#!" = "$has_hash_bang" ] ; then bpython="`basename "$python"`" fi -if [ -x "$python" -a ! -d "$python" -a "`${python} -V 2>&1 | cut -f 1 -d " "`" == "Python" ] ; then +if [ -x "$python" -a ! -d "$python" -a "`${python} -V 2>&1 | cut -f 1 -d ' '`" = "Python" ] ; then hg="${python} -u ${whichhg}" else echo Cannot find python from hg launcher. Running plain hg, which probably has buffered stdout. -- GitLab