New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
branch_check.sh in utils/developer – NEMO

source: utils/developer/branch_check.sh

Last change on this file was 14182, checked in by nicolasmartin, 3 years ago

Move scripts for checking branch to developer dir and create symlinks at the root of /NEMO

  • Property svn:executable set to *
File size: 1.8 KB
Line 
1#!/bin/bash
2
3#set -ex
4
5[ -z "$*" ] && { echo 'No branch path(s) given => QUIT'; exit 2; }
6
7branches=$*
8
9## Find broken symlinks
10echo 'Broken links?'
11find $branches -xtype l -not \( -name "*.idx" -or -name "*WORK*" -or -name "*BLD*" \)
12echo
13
14## Check
15echo 'Files with superfluous -x perm?'
16find $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 {} \;
21echo
22
23## Doc
24cd $branches/doc
25
26## Updating namelist blocks
27echo 'Updating namelist blocks'
28echo '   - namelist_ref'
29./tools/nlsts_update.sh -i ../cfgs/SHARED/namelist_ref        -o namelist_ref    > /dev/null
30echo '   - namelist_ice_ref'
31./tools/nlsts_update.sh -i ../cfgs/SHARED/namelist_ice_ref    -o namelist_ice    > /dev/null
32echo '   - namelist_pisces_ref'
33./tools/nlsts_update.sh -i ../cfgs/SHARED/namelist_pisces_ref -o namelist_pisces > /dev/null
34echo '   - namelist_top_ref'
35./tools/nlsts_update.sh -i ../cfgs/SHARED/namelist_top_ref    -o namelist_top    > /dev/null
36echo '   - namelist_trc_ref'
37./tools/nlsts_update.sh -i ../cfgs/SHARED/namelist_trc_ref    -o namelist_trc    > /dev/null
38echo 'Removal of unused namelists if any'
39mkdir namelist_new
40mv namelist_ice/* namelist_pisces/* namelist_ref/* namelist_top/* namelist_trc/* namelist_new/
41diff -arq namelist_new namelists | grep 'Only in namelists:' | cut -d: -f2 \
42   | xargs -n 1 -i svn rm namelists/{}
43rm -rf namelist_*
44
45## Compilation
46echo 'Testing doc build'
47./manual_build.sh all
48[ "$?" != 0 ] && exit 2
49
50## Undefined references in LaTeX
51if [ "$( 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
55fi
56
57cd - > /dev/null
58
59exit 0
Note: See TracBrowser for help on using the repository browser.