From 957a81eef9aa581aab192edc5ce2084564245203 Mon Sep 17 00:00:00 2001 From: Vivia Nikolaidou Date: Wed, 3 Jun 2015 19:04:15 +0300 Subject: [PATCH] gst-indent: Add support for gindent as executable name gst-indent used to support gnuindent and indent as executable names. However, on OSX one can "brew install gnu-indent" and then the executable name will be gindent. Added support for that. https://bugzilla.gnome.org/show_bug.cgi?id=750351 --- tools/gst-indent | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tools/gst-indent b/tools/gst-indent index e75338be0d..a9b8bfe430 100755 --- a/tools/gst-indent +++ b/tools/gst-indent @@ -1,16 +1,17 @@ #!/bin/sh -version=`gnuindent --version 2>/dev/null` -if test "x$version" = "x"; then - version=`indent --version 2>/dev/null` - if test "x$version" = "x"; then - echo "GStreamer git pre-commit hook:" - echo "Did not find GNU indent, please install it before continuing." - exit 1 +for execname in gnuindent gindent indent; do + version=`$execname --version 2>/dev/null` + if test "x$version" != "x"; then + INDENT=$execname + break fi - INDENT=indent -else - INDENT=gnuindent +done + +if test -z $INDENT; then + echo "GStreamer git pre-commit hook:" + echo "Did not find GNU indent, please install it before continuing." + exit 1 fi case `$INDENT --version` in