source:
utils/developer/branch_check.sh
@
14182
Last change on this file since 14182 was 14182, checked in by nicolasmartin, 3 years ago | |
---|---|
|
|
File size: 1.8 KB |
Rev | Line | |
---|---|---|
[14182] | 1 | #!/bin/bash |
2 | ||
3 | #set -ex | |
4 | ||
5 | [ -z "$*" ] && { echo 'No branch path(s) given => QUIT'; exit 2; } | |
6 | ||
7 | branches=$* | |
8 | ||
9 | ## Find broken symlinks | |
10 | echo 'Broken links?' | |
11 | find $branches -xtype l -not \( -name "*.idx" -or -name "*WORK*" -or -name "*BLD*" \) | |
12 | echo | |
13 | ||
14 | ## Check | |
15 | echo 'Files with superfluous -x perm?' | |
16 | find $branches -type f -perm -u+rwx -not \ | |
17 | \( -name "*.sh" -or -name "*.bash" -or \ | |
18 | -name "*.t" -or -name "*.p[lmy]" -or \ | |
19 | -name "*.exe" -or -name Makefile \) \ | |
20 | -print -exec head -1 {} \; | |
21 | echo | |
22 | ||
23 | ## Doc | |
24 | cd $branches/doc | |
25 | ||
26 | ## Updating namelist blocks | |
27 | echo 'Updating namelist blocks' | |
28 | echo ' - namelist_ref' | |
29 | ./tools/nlsts_update.sh -i ../cfgs/SHARED/namelist_ref -o namelist_ref > /dev/null | |
30 | echo ' - namelist_ice_ref' | |
31 | ./tools/nlsts_update.sh -i ../cfgs/SHARED/namelist_ice_ref -o namelist_ice > /dev/null | |
32 | echo ' - namelist_pisces_ref' | |
33 | ./tools/nlsts_update.sh -i ../cfgs/SHARED/namelist_pisces_ref -o namelist_pisces > /dev/null | |
34 | echo ' - namelist_top_ref' | |
35 | ./tools/nlsts_update.sh -i ../cfgs/SHARED/namelist_top_ref -o namelist_top > /dev/null | |
36 | echo ' - namelist_trc_ref' | |
37 | ./tools/nlsts_update.sh -i ../cfgs/SHARED/namelist_trc_ref -o namelist_trc > /dev/null | |
38 | echo 'Removal of unused namelists if any' | |
39 | mkdir namelist_new | |
40 | mv namelist_ice/* namelist_pisces/* namelist_ref/* namelist_top/* namelist_trc/* namelist_new/ | |
41 | diff -arq namelist_new namelists | grep 'Only in namelists:' | cut -d: -f2 \ | |
42 | | xargs -n 1 -i svn rm namelists/{} | |
43 | rm -rf namelist_* | |
44 | ||
45 | ## Compilation | |
46 | echo 'Testing doc build' | |
47 | ./manual_build.sh all | |
48 | [ "$?" != 0 ] && exit 2 | |
49 | ||
50 | ## Undefined references in LaTeX | |
51 | if [ "$( grep 'undefined on' ./latex/*/build/*_manual.log )" ]; then | |
52 | echo 'Undefined refs in doc' | |
53 | grep 'undefined on' ./latex/*/build/*_manual.log | |
54 | exit 2 | |
55 | fi | |
56 | ||
57 | cd - > /dev/null | |
58 | ||
59 | exit 0 |
Note: See TracBrowser
for help on using the repository browser.