akaros/scripts/spatch/spatch-me.sh
<<
>>
Prefs
   1#!/bin/bash
   2# Helper to run spatch on multiple files
   3
   4if [ $# -lt 3 ]
   5then
   6        echo "Usage: $0 cocci_file yes/no dir [other args to spatch]"
   7        exit -1
   8fi
   9
  10COCCI=$1
  11
  12INPLACE=""
  13
  14if [ $2 = "yes" ]
  15then
  16        INPLACE="-in-place"
  17fi
  18
  19DIR=$3
  20
  21shift 3
  22
  23FILES=`find $DIR -name '*.[ch]'`
  24
  25for i in $FILES
  26do
  27        spatch -sp-file $COCCI $i $INPLACE $*
  28done
  29