| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 | #!/bin/bashset -xif [ "x$TEST" == "x" ] ; then  TEST=falseficd `dirname $0`/../..mako_renderer=tools/buildgen/mako_renderer.pygen_build_json=test/core/end2end/gen_build_json.pyend2end_test_build=`mktemp /tmp/genXXXXXX`$gen_build_json > $end2end_test_buildglobal_plugins=`find ./tools/buildgen/plugins -name '*.py' |  sort | grep -v __init__ |  while read p ; do echo -n "-p $p " ; done`for dir in . ; do  local_plugins=`find $dir/templates -name '*.py' |    sort | grep -v __init__ |    while read p ; do echo -n "-p $p " ; done`  plugins="$global_plugins $local_plugins"  find -L $dir/templates -type f -and -name *.template | while read file ; do    out=${dir}/${file#$dir/templates/}  # strip templates dir prefix    out=${out%.*}  # strip template extension    json_files="build.json $end2end_test_build"    data=`for i in $json_files; do echo -n "-d $i "; done`    if [ $TEST == true ] ; then      actual_out=$out      out=`mktemp`    fi    $mako_renderer $plugins $data -o $out $file    if [ $TEST == true ] ; then      diff -q $out $actual_out      rm $out    fi  donedonerm $end2end_test_build
 |