]>
Commit | Line | Data |
---|---|---|
0bb166ed | 1 | #!/bin/bash |
2 | ||
3 | cd "${ALICE_ROOT}"/../src/ | |
4 | ||
7f327628 | 5 | [[ $EDITOR == '' ]] && EDITOR=vim |
6 | ||
907a63ed | 7 | function remove_trailing_whitespaces() { |
8 | F="$1" | |
9 | cat "$F" | sed -e 's/\s*$//' > "$F".0 | |
10 | mv "$F".0 "$F" | |
11 | } | |
12 | ||
e88743d7 | 13 | # List of files from external source |
14 | Files=$( | |
15 | cat "$(dirname "$0")"/list-of-files-to-process.txt | \ | |
16 | sed -e '/^$/d' | \ | |
17 | grep -v ^# | \ | |
18 | sort ) | |
0bb166ed | 19 | |
20 | while [[ $# -gt 0 ]] ; do | |
21 | case "$1" in | |
22 | -r) RestoreOnly=1 ;; | |
23 | -x) DoxygenOnly=1 ;; | |
24 | -d) Debug='--debug=debug' ;; | |
25 | -o) Stdout='-o' ;; | |
26 | esac | |
27 | shift 1 | |
28 | done | |
29 | ||
30 | cd "${ALICE_ROOT}"/../src/doxygen | |
31 | ||
32 | for F in ${Files[@]} ; do | |
33 | F="${ALICE_ROOT}/../src/${F}" | |
7f327628 | 34 | if [[ $DoxygenOnly != 1 ]] ; then |
35 | git checkout "$F" | |
36 | r=$? | |
37 | fi | |
38 | if [[ $RestoreOnly != 1 ]] ; then | |
4d4db466 | 39 | #./thtml2doxy.py $Stdout $Debug $( cat debug/includes.txt ) "$F" |
40 | ./thtml2doxy.py $Stdout $Debug -I$ALICE_ROOT/include "$F" | |
7f327628 | 41 | r=$? |
d86903f9 | 42 | |
43 | # Remove the $Id$ line | |
44 | cat "$F" | sed -e '/\$Id.*\$/d' > "$F".0 | |
45 | mv "$F".0 "$F" | |
46 | ||
7f327628 | 47 | fi |
48 | if [[ $r != 0 ]] ; then | |
49 | echo -e "\033[31mFatal error at ${F}: stopping here\033[m" | |
50 | break | |
51 | else | |
52 | while [[ 1 ]] ; do | |
53 | git diff "$F" | |
54 | echo '' | |
55 | FNorm=$( cd "`dirname "$F"`";pwd )/$( basename "$F" ) | |
56 | AliRootLen=${#ALICE_ROOT} | |
57 | FNorm=${FNorm:$AliRootLen} | |
58 | echo -e "\033[35mFile \033[34m${FNorm}\033[m" | |
7818b2b2 | 59 | echo -e -n "\033[35mWhat to do? \033[34medit, stage, parts, continue, restore, restorequit\033[m \033[35m> \033[m" |
7f327628 | 60 | read ans |
61 | case "$ans" in | |
62 | edit) | |
63 | "$EDITOR" "$F" | |
64 | ;; | |
65 | stage) | |
907a63ed | 66 | remove_trailing_whitespaces "$F" |
7f327628 | 67 | git add "$F" || exit 1 |
68 | break | |
69 | ;; | |
4d4db466 | 70 | parts) |
907a63ed | 71 | remove_trailing_whitespaces "$F" |
4d4db466 | 72 | git add -p "$F" || exit 1 |
73 | git checkout "$F" || exit 1 | |
e88743d7 | 74 | echo -e "\033[35mPart of \033[34m${FNorm}\033[35m was staged, the rest was restored. Press \033[34mEnter\033[35m to continue.\033[m" |
75 | read | |
4d4db466 | 76 | break |
77 | ;; | |
7f327628 | 78 | continue) |
79 | break | |
80 | ;; | |
4d4db466 | 81 | restore) |
82 | git checkout "$F" || exit 1 | |
83 | break | |
84 | ;; | |
7818b2b2 | 85 | restorequit) |
86 | git checkout "$F" || exit 1 | |
87 | exit 0 | |
88 | ;; | |
7f327628 | 89 | esac |
90 | done | |
91 | fi | |
0bb166ed | 92 | done |
7f327628 | 93 | |
94 | echo -e "\033[32mAll OK\033[m" |