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>
This commit is contained in:
Jean Delvare 2015-09-04 15:43:24 -07:00 committed by Linus Torvalds
parent d40e1e6532
commit fa70900e09
1 changed files with 3 additions and 0 deletions

View File

@ -1,6 +1,9 @@
#!/bin/sh #!/bin/sh
PARAM="-npro -kr -i8 -ts8 -sob -l80 -ss -ncs -cp1" PARAM="-npro -kr -i8 -ts8 -sob -l80 -ss -ncs -cp1"
RES=`indent --version` RES=`indent --version`
if [ "$RES" = "" ]; then
exit 1
fi
V1=`echo $RES | cut -d' ' -f3 | cut -d'.' -f1` V1=`echo $RES | cut -d' ' -f3 | cut -d'.' -f1`
V2=`echo $RES | cut -d' ' -f3 | cut -d'.' -f2` V2=`echo $RES | cut -d' ' -f3 | cut -d'.' -f2`
V3=`echo $RES | cut -d' ' -f3 | cut -d'.' -f3` V3=`echo $RES | cut -d' ' -f3 | cut -d'.' -f3`