2 # script args: source_file target_file
5 if [ ! -z "$USE_CLUSTERS" ]; then
6 use_clusters=$USE_CLUSTERS
10 # file will be modified in place
11 include_dot_snippet ()
13 echo "Adding to $1 graphviz snippet $2 ..."
14 sed -i "/digraph/r $2" $1
18 # file will be modified in place
21 echo "Adding to $1 KLOCs stats from $2 ..."
22 tmp=`mktemp tmp.stats.XXXXXX`
24 module=$(basename $(echo $l | cut -d : -f 1))
25 stat=$(echo $l | cut -d : -f 2)
26 if [ "$stat" = "LOC" ]; then
27 locs=$(echo $l | cut -d : -f 3)
28 klocs=$(echo "scale=1; $locs / 1000" | bc)
29 if [ "$klocs" = "0" ]; then klocs=".1"; fi
30 printf ' %s [label="%s\\n%s klocs"];\n' $module $module $klocs >> $tmp
33 include_dot_snippet $1 $tmp
41 echo "Applying to $1 patch $2 ..."
47 include_loc_stats $2 .stats
48 apply_patch $2 STATS/deps.patch
49 include_dot_snippet $2 STATS/daemons.dot
50 if [ "$use_clusters" = "yes" ]; then
51 include_dot_snippet $2 STATS/clusters.dot