X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=tools%2Fgst-indent;h=9309ed38b52a7958ced56aafe73ab807332644a3;hb=2fe5b4cf91baa94c91b57914238f7e1773656c15;hp=7c150bfe8f25b777f4daac1d73b9eb94c3634c4f;hpb=c01cd4e835c47d81677f6d8bcf8ddd9acdf6ff6a;p=platform%2Fupstream%2Fgstreamer.git diff --git a/tools/gst-indent b/tools/gst-indent index 7c150bf..9309ed3 100755 --- a/tools/gst-indent +++ b/tools/gst-indent @@ -1,16 +1,40 @@ #!/bin/sh -indent \ + +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 + fi + INDENT=indent +else + INDENT=gnuindent +fi + +case `$INDENT --version` in + GNU*) + ;; + default) + echo "Did not find GNU indent, please install it before continuing." + echo "(Found $INDENT, but it doesn't seem to be GNU indent)" + exit 1 + ;; +esac + +$INDENT \ --braces-on-if-line \ - --blank-lines-after-declarations \ --case-brace-indentation0 \ --case-indentation2 \ --braces-after-struct-decl-line \ --line-length80 \ - --use-tabs \ + --no-tabs \ --cuddle-else \ --dont-line-up-parentheses \ --continuation-indentation4 \ --honour-newlines \ --tab-size8 \ --indent-level2 \ + --leave-preprocessor-space \ $*