# HG changeset patch # User mduigou # Date 1365031570 25200 # Node ID dc4ec31fe96a1e0fd30d95a7c69f36ad6dc53e9a # Parent 159143926e11d096365631757e864cb8ee413d41 8011350: hgforest.sh uses non-POSIX sh features that may fail with some shells Reviewed-by: tbell, katleman, dholmes diff -r 159143926e11 -r dc4ec31fe96a common/bin/hgforest.sh --- a/common/bin/hgforest.sh Tue Apr 02 14:56:19 2013 -0700 +++ b/common/bin/hgforest.sh Wed Apr 03 16:26:10 2013 -0700 @@ -30,7 +30,7 @@ # 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 @@ 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.