diff options
author | Jean Delvare <jdelvare@suse.de> | 2015-09-04 18:43:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-09-04 19:54:41 -0400 |
commit | fa70900e0984792cc45a9e51c28684c3287058c2 (patch) | |
tree | 897a35925cda919d4b8d2eed19a0269a54f521f5 | |
parent | d40e1e6532efbb40f8fc1f5af093063a3d186754 (diff) |
scripts/Lindent: handle missing indent gracefully
If indent is not found, bail out immediately instead of spitting random
shell script error messages.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rwxr-xr-x | scripts/Lindent | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/Lindent b/scripts/Lindent index 9c4b3e2b7098..6d889de4e70b 100755 --- a/scripts/Lindent +++ b/scripts/Lindent | |||
@@ -1,6 +1,9 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | PARAM="-npro -kr -i8 -ts8 -sob -l80 -ss -ncs -cp1" | 2 | PARAM="-npro -kr -i8 -ts8 -sob -l80 -ss -ncs -cp1" |
3 | RES=`indent --version` | 3 | RES=`indent --version` |
4 | if [ "$RES" = "" ]; then | ||
5 | exit 1 | ||
6 | fi | ||
4 | V1=`echo $RES | cut -d' ' -f3 | cut -d'.' -f1` | 7 | V1=`echo $RES | cut -d' ' -f3 | cut -d'.' -f1` |
5 | V2=`echo $RES | cut -d' ' -f3 | cut -d'.' -f2` | 8 | V2=`echo $RES | cut -d' ' -f3 | cut -d'.' -f2` |
6 | V3=`echo $RES | cut -d' ' -f3 | cut -d'.' -f3` | 9 | V3=`echo $RES | cut -d' ' -f3 | cut -d'.' -f3` |