scripts/unify-sources.sh
changeset 329 d900fd1e760f
parent 328 cdbff91c2166
child 331 2f5c0c42a5cd
equal deleted inserted replaced
3:4d6cfb10b3d4 4:d462b252b1eb
    86 }
    86 }
    87 
    87 
    88 function check_action() {
    88 function check_action() {
    89     if ! diff -q $1 $2 >/dev/null
    89     if ! diff -q $1 $2 >/dev/null
    90     then
    90     then
    91 	echo -n " [$3 failed]"
    91 	echo
       
    92 	echo -n "      $3 failed at line(s): "
       
    93 	echo -n $(diff $1 $2 | grep '^[0-9]' | sed "s/^\(.*\)c.*$/ \1/g" | 
       
    94 	          sed "s/,/-/g" | paste -s -d',')
    92 	FAILED=YES
    95 	FAILED=YES
    93     fi
    96     fi
    94 }
    97 }
    95 
    98 
    96 function check_warning() {
    99 function check_warning() {
    97     echo -n " [$2 warning]"
   100     echo
       
   101     if [ "$2" == 'long lines' ]
       
   102     then
       
   103         echo -n "      $2 warning at line(s): "
       
   104         echo -n $(grep -n -E '.{81,}' $1 | sed "s/^\([0-9]*\)/ \1\t/g" | 
       
   105                   cut -f 1 | paste -s -d',')
       
   106     else
       
   107         echo -n "      $2 warning"
       
   108     fi
    98     WARNED=YES
   109     WARNED=YES
    99 }
   110 }
   100 
   111 
   101 function check_init() {
   112 function check_init() {
   102     echo Check source files...
   113     echo Check source files...