[PATCH] Lindent: Handle missing indent gracefully

Jean Delvare
2015-07-10T11:48:02Z

If indent is not found, bail out immediately instead of spitting
random shell script error messages.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
scripts/Lindent | 3 +++
1 file changed, 3 insertions(+)

--- linux-4.2-rc0.orig/scripts/Lindent 2015-06-22 07:05:43.000000000 +0200
+++ linux-4.2-rc0/scripts/Lindent 2015-07-10 13:45:56.864031472 +0200
@@ -1,6 +1,9 @@
#!/bin/sh
PARAM="-npro -kr -i8 -ts8 -sob -l80 -ss -ncs -cp1"
RES=`indent --version`
+if [ "$RES" = "" ]; then
+ exit 1
+fi
V1=`echo $RES | cut -d' ' -f3 | cut -d'.' -f1`
V2=`echo $RES | cut -d' ' -f3 | cut -d'.' -f2`
V3=`echo $RES | cut -d' ' -f3 | cut -d'.' -f3`

--
Jean Delvare
SUSE L3 Support