gravatar
alpar (Alpar Juttner)
alpar@cs.elte.hu
Merge
0 2 0
merge default
0 files changed with 19 insertions and 10 deletions:
↑ Collapse diff ↑
Show white space 48 line context
... ...
@@ -67,49 +67,54 @@
67 67
    echo $CHANGED_FILES out of $TOTAL_FILES files has been changed.
68 68
    echo $WARNED_FILES out of $TOTAL_FILES files triggered warnings.
69 69
}
70 70

	
71 71
function update_begin() {
72 72
    ((TOTAL_FILES++))
73 73
    CHANGED=NO
74 74
    WARNED=NO
75 75
}
76 76

	
77 77
function update_end() {
78 78
    if [ $CHANGED == YES ]
79 79
    then
80 80
	((++CHANGED_FILES))
81 81
    fi
82 82
    if [ $WARNED == YES ]
83 83
    then
84 84
	((++WARNED_FILES))
85 85
    fi
86 86
}
87 87

	
88 88
function check_action() {
89 89
    if [ "$3" == 'tabs' ]
90 90
    then
91
        if echo $2 | grep -q -v -E 'Makefile\.am$'
92
        then
91 93
        PATTERN=$(echo -e '\t')
94
        else
95
            PATTERN='        '
96
        fi
92 97
    elif [ "$3" == 'trailing spaces' ]
93 98
    then
94 99
        PATTERN='\ +$'
95 100
    else
96 101
        PATTERN='*'
97 102
    fi
98 103

	
99 104
    if ! diff -q $1 $2 >/dev/null
100 105
    then
101 106
        if [ "$PATTERN" == '*' ]
102 107
        then
103 108
            diff $1 $2 | grep '^[0-9]' | sed "s|^\(.*\)c.*$|$2:\1: check failed: $3|g" |
104 109
              sed "s/:\([0-9]*\),\([0-9]*\):\(.*\)$/:\1:\3 (until line \2)/g"
105 110
        else
106 111
            grep -n -E "$PATTERN" $2 | sed "s|^\([0-9]*\):.*$|$2:\1: check failed: $3|g"
107 112
        fi
108 113
        FAILED=YES
109 114
    fi
110 115
}
111 116

	
112 117
function check_warning() {
113 118
    if [ "$2" == 'long lines' ]
114 119
    then
115 120
        grep -n -E '.{81,}' $1 | sed "s|^\([0-9]*\):.*$|$1:\1: warning: $2|g"
Show white space 48 line context
1 1
#!/bin/bash
2 2

	
3 3
set -e
4 4

	
5 5
if [ $# -eq 0 -o x$1 = "x-h" -o x$1 = "x-help" -o x$1 = "x--help" ]; then
6 6
    echo "Usage:"
7 7
    echo "  $0 source-file(s)"
8 8
    exit
9 9
fi
10 10

	
11 11
for i in $@
12 12
do
13 13
    echo Update $i...
14 14
    TMP=`mktemp`
15 15
    sed -e "s/\<undirected graph\>/_gr_aph_label_/g"\
16 16
        -e "s/\<undirected graphs\>/_gr_aph_label_s/g"\
17 17
        -e "s/\<undirected edge\>/_ed_ge_label_/g"\
18 18
        -e "s/\<undirected edges\>/_ed_ge_label_s/g"\
19 19
        -e "s/\<directed graph\>/_digr_aph_label_/g"\
20 20
        -e "s/\<directed graphs\>/_digr_aph_label_s/g"\
21 21
        -e "s/\<directed edge\>/_ar_c_label_/g"\
22 22
        -e "s/\<directed edges\>/_ar_c_label_s/g"\
23 23
        -e "s/UGraph/_Gr_aph_label_/g"\
24 24
        -e "s/u[Gg]raph/_gr_aph_label_/g"\
25
        -e "s/\<Graph\>/_Digr_aph_label_/g"\
25
        -e "s/Graph\>/_Digr_aph_label_/g"\
26 26
        -e "s/\<graph\>/_digr_aph_label_/g"\
27
        -e "s/\<Graphs\>/_Digr_aph_label_s/g"\
27
        -e "s/Graphs\>/_Digr_aph_label_s/g"\
28 28
        -e "s/\<graphs\>/_digr_aph_label_s/g"\
29
        -e "s/_Graph/__Gr_aph_label_/g"\
30
        -e "s/\([Gg]\)raph\([a-z_]\)/_\1r_aph_label_\2/g"\
29
        -e "s/\([Gg]\)raph\([a-z]\)/_\1r_aph_label_\2/g"\
31 30
        -e "s/\([a-z_]\)graph/\1_gr_aph_label_/g"\
32 31
        -e "s/Graph/_Digr_aph_label_/g"\
33 32
        -e "s/graph/_digr_aph_label_/g"\
34 33
        -e "s/UEdge/_Ed_ge_label_/g"\
35 34
        -e "s/u[Ee]dge/_ed_ge_label_/g"\
36 35
        -e "s/IncEdgeIt/_In_cEd_geIt_label_/g"\
37
        -e "s/\<Edge\>/_Ar_c_label_/g"\
36
        -e "s/Edge\>/_Ar_c_label_/g"\
38 37
        -e "s/\<edge\>/_ar_c_label_/g"\
39
        -e "s/\<Edges\>/_Ar_c_label_s/g"\
38
        -e "s/_edge\>/_ar_c_label_/g"\
39
        -e "s/Edges\>/_Ar_c_label_s/g"\
40 40
        -e "s/\<edges\>/_ar_c_label_s/g"\
41
        -e "s/_Edge/__Ed_ge_label_/g"\
42
        -e "s/Edge\([a-z_]\)/_Ed_ge_label_\1/g"\
43
        -e "s/edge\([a-z_]\)/_ed_ge_label_\1/g"\
44
        -e "s/\([a-z_]\)edge/\1_ed_ge_label_/g"\
41
        -e "s/_edges\>/_ar_c_label_s/g"\
42
        -e "s/\([Ee]\)dge\([a-z]\)/_\1d_ge_label_\2/g"\
43
        -e "s/\([a-z]\)edge/\1_ed_ge_label_/g"\
45 44
        -e "s/Edge/_Ar_c_label_/g"\
46 45
        -e "s/edge/_ar_c_label_/g"\
47 46
        -e "s/A[Nn]ode/_Re_d_label_/g"\
48 47
        -e "s/B[Nn]ode/_Blu_e_label_/g"\
49 48
        -e "s/A-[Nn]ode/_Re_d_label_/g"\
50 49
        -e "s/B-[Nn]ode/_Blu_e_label_/g"\
51 50
        -e "s/a[Nn]ode/_re_d_label_/g"\
52 51
        -e "s/b[Nn]ode/_blu_e_label_/g"\
53 52
        -e "s/\<UGRAPH_TYPEDEFS\([ \t]*([ \t]*\)typename[ \t]/TEMPLATE__GR_APH_TY_PEDE_FS_label_\1/g"\
54 53
        -e "s/\<GRAPH_TYPEDEFS\([ \t]*([ \t]*\)typename[ \t]/TEMPLATE__DIGR_APH_TY_PEDE_FS_label_\1/g"\
55 54
        -e "s/\<UGRAPH_TYPEDEFS\>/_GR_APH_TY_PEDE_FS_label_/g"\
56 55
        -e "s/\<GRAPH_TYPEDEFS\>/_DIGR_APH_TY_PEDE_FS_label_/g"\
57 56
        -e "s/_Digr_aph_label_/Digraph/g"\
58 57
        -e "s/_digr_aph_label_/digraph/g"\
59 58
        -e "s/_Gr_aph_label_/Graph/g"\
60 59
        -e "s/_gr_aph_label_/graph/g"\
61 60
        -e "s/_Ar_c_label_/Arc/g"\
62 61
        -e "s/_ar_c_label_/arc/g"\
63 62
        -e "s/_Ed_ge_label_/Edge/g"\
64 63
        -e "s/_ed_ge_label_/edge/g"\
65 64
        -e "s/_In_cEd_geIt_label_/IncEdgeIt/g"\
66 65
        -e "s/_Re_d_label_/Red/g"\
67 66
        -e "s/_Blu_e_label_/Blue/g"\
68 67
        -e "s/_re_d_label_/red/g"\
... ...
@@ -95,27 +94,32 @@
95 94
        -e "s/\<RevDigraphAdaptor\>/ReverseDigraph/g"\
96 95
        -e "s/\<revDigraphAdaptor\>/reverseDigraph/g"\
97 96
        -e "s/\<SubDigraphAdaptor\>/SubDigraph/g"\
98 97
        -e "s/\<subDigraphAdaptor\>/subDigraph/g"\
99 98
        -e "s/\<SubGraphAdaptor\>/SubGraph/g"\
100 99
        -e "s/\<subGraphAdaptor\>/subGraph/g"\
101 100
        -e "s/\<NodeSubDigraphAdaptor\>/FilterNodes/g"\
102 101
        -e "s/\<nodeSubDigraphAdaptor\>/filterNodes/g"\
103 102
        -e "s/\<ArcSubDigraphAdaptor\>/FilterArcs/g"\
104 103
        -e "s/\<arcSubDigraphAdaptor\>/filterArcs/g"\
105 104
        -e "s/\<UndirDigraphAdaptor\>/Undirector/g"\
106 105
        -e "s/\<undirDigraphAdaptor\>/undirector/g"\
107 106
        -e "s/\<ResDigraphAdaptor\>/ResidualDigraph/g"\
108 107
        -e "s/\<resDigraphAdaptor\>/residualDigraph/g"\
109 108
        -e "s/\<SplitDigraphAdaptor\>/SplitNodes/g"\
110 109
        -e "s/\<splitDigraphAdaptor\>/splitNodes/g"\
111 110
        -e "s/\<SubGraphAdaptor\>/SubGraph/g"\
112 111
        -e "s/\<subGraphAdaptor\>/subGraph/g"\
113 112
        -e "s/\<NodeSubGraphAdaptor\>/FilterNodes/g"\
114 113
        -e "s/\<nodeSubGraphAdaptor\>/filterNodes/g"\
115 114
        -e "s/\<ArcSubGraphAdaptor\>/FilterEdges/g"\
116 115
        -e "s/\<arcSubGraphAdaptor\>/filterEdges/g"\
117 116
        -e "s/\<DirGraphAdaptor\>/Orienter/g"\
118 117
        -e "s/\<dirGraphAdaptor\>/orienter/g"\
118
        -e "s/\<LpCplex\>/CplexLp/g"\
119
        -e "s/\<MipCplex\>/CplexMip/g"\
120
        -e "s/\<LpGlpk\>/GlpkLp/g"\
121
        -e "s/\<MipGlpk\>/GlpkMip/g"\
122
        -e "s/\<LpSoplex\>/SoplexLp/g"\
119 123
    <$i > $TMP
120 124
    mv $TMP $i
121 125
done
0 comments (0 inline)