Re: [LEDE-DEV] [PATCH] ct-bugcheck: fix globbing, word splitting and change formatting

2016-10-15 Thread John Crispin


On 14/10/2016 18:03, Ben Greear wrote:
> On 10/14/2016 08:58 AM, Jan-Tarek Butt wrote:
>> Double quote to prevent globbing and word splitting.
>> Use short syntax to enhance reading quallity.
> 
> I disagree that the short syntax helps reading quality,
> but if others like it then I guess that change is fine with me.
> 
> Thanks,
> Ben
> 

this patch looks wonky. i agree with ben here, that the style long vs
short style only makes a readability difference for some and reduces
readability for others. additionally the == is changed to -eq yet the
value compared to changes from integer to string by adding the quotes
around 0. the change to the while loop is also not related. i understand
the reasoning behind jan-tareks patches, but for most of it i dont see
the point. might be better to simply concentrate on the word globbing
issue and not make lots of small unrelated formatting changes in the
patches.

John

>>
>> Signed-off-by: Jan-Tarek Butt 
>> ---
>>  package/utils/ct-bugcheck/src/bugchecker.sh | 14 +++---
>>  1 file changed, 3 insertions(+), 11 deletions(-)
>>
>> diff --git a/package/utils/ct-bugcheck/src/bugchecker.sh
>> b/package/utils/ct-bugcheck/src/bugchecker.sh
>> index be305af..eb221db 100755
>> --- a/package/utils/ct-bugcheck/src/bugchecker.sh
>> +++ b/package/utils/ct-bugcheck/src/bugchecker.sh
>> @@ -12,18 +12,10 @@ DO_BUGCHECK=0
>>  #  DO_BUGCHECK=1
>>  #  export DO_BUGCHECK
>>
>> -if [ -f /etc/config/bugcheck ]
>> -then
>> -. /etc/config/bugcheck
>> -fi
>> +[ -f /etc/config/bugcheck ] && . /etc/config/bugcheck
>> +[ "$DO_BUGCHECK" -eq "0" ] && exit 0
>>
>> -if [ $DO_BUGCHECK == 0 ]
>> -then
>> -exit 0
>> -fi
>> -
>> -while true
>> -  do
>> +while true; do
>>$CHECKER
>>sleep $SLEEPFOR
>>  done
>>
> 
> 

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] ct-bugcheck: fix globbing, word splitting and change formatting

2016-10-14 Thread Ben Greear

On 10/14/2016 08:58 AM, Jan-Tarek Butt wrote:

Double quote to prevent globbing and word splitting.
Use short syntax to enhance reading quallity.


I disagree that the short syntax helps reading quality,
but if others like it then I guess that change is fine with me.

Thanks,
Ben



Signed-off-by: Jan-Tarek Butt 
---
 package/utils/ct-bugcheck/src/bugchecker.sh | 14 +++---
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/package/utils/ct-bugcheck/src/bugchecker.sh 
b/package/utils/ct-bugcheck/src/bugchecker.sh
index be305af..eb221db 100755
--- a/package/utils/ct-bugcheck/src/bugchecker.sh
+++ b/package/utils/ct-bugcheck/src/bugchecker.sh
@@ -12,18 +12,10 @@ DO_BUGCHECK=0
 #  DO_BUGCHECK=1
 #  export DO_BUGCHECK

-if [ -f /etc/config/bugcheck ]
-then
-. /etc/config/bugcheck
-fi
+[ -f /etc/config/bugcheck ] && . /etc/config/bugcheck
+[ "$DO_BUGCHECK" -eq "0" ] && exit 0

-if [ $DO_BUGCHECK == 0 ]
-then
-exit 0
-fi
-
-while true
-  do
+while true; do
   $CHECKER
   sleep $SLEEPFOR
 done




--
Ben Greear 
Candela Technologies Inc  http://www.candelatech.com


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH] ct-bugcheck: fix globbing, word splitting and change formatting

2016-10-14 Thread Jan-Tarek Butt
Double quote to prevent globbing and word splitting.
Use short syntax to enhance reading quallity.

Signed-off-by: Jan-Tarek Butt 
---
 package/utils/ct-bugcheck/src/bugchecker.sh | 14 +++---
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/package/utils/ct-bugcheck/src/bugchecker.sh 
b/package/utils/ct-bugcheck/src/bugchecker.sh
index be305af..eb221db 100755
--- a/package/utils/ct-bugcheck/src/bugchecker.sh
+++ b/package/utils/ct-bugcheck/src/bugchecker.sh
@@ -12,18 +12,10 @@ DO_BUGCHECK=0
 #  DO_BUGCHECK=1
 #  export DO_BUGCHECK
 
-if [ -f /etc/config/bugcheck ]
-then
-. /etc/config/bugcheck
-fi
+[ -f /etc/config/bugcheck ] && . /etc/config/bugcheck
+[ "$DO_BUGCHECK" -eq "0" ] && exit 0
 
-if [ $DO_BUGCHECK == 0 ]
-then
-exit 0
-fi
-
-while true
-  do
+while true; do
   $CHECKER
   sleep $SLEEPFOR
 done
-- 
2.10.0


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev