#!/bin/bash #set -ex [ -z "$*" ] && { echo 'No branch path(s) given => QUIT'; exit 2; } branches=$* ## Find broken symlinks echo 'Broken links?' find $branches -xtype l -not \( -name "*.idx" -or -name "*WORK*" -or -name "*BLD*" \) echo ## Check echo 'Files with superfluous -x perm?' find $branches -type f -perm -u+rwx -not \ \( -name "*.sh" -or -name "*.bash" -or \ -name "*.t" -or -name "*.p[lmy]" -or \ -name "*.exe" -or -name Makefile \) \ -print -exec head -1 {} \; echo ## Doc cd $branches/doc ## Updating namelist blocks echo 'Updating namelist blocks' echo ' - namelist_ref' ./tools/nlsts_update.sh -i ../cfgs/SHARED/namelist_ref -o namelist_ref > /dev/null echo ' - namelist_ice_ref' ./tools/nlsts_update.sh -i ../cfgs/SHARED/namelist_ice_ref -o namelist_ice > /dev/null echo ' - namelist_pisces_ref' ./tools/nlsts_update.sh -i ../cfgs/SHARED/namelist_pisces_ref -o namelist_pisces > /dev/null echo ' - namelist_top_ref' ./tools/nlsts_update.sh -i ../cfgs/SHARED/namelist_top_ref -o namelist_top > /dev/null echo ' - namelist_trc_ref' ./tools/nlsts_update.sh -i ../cfgs/SHARED/namelist_trc_ref -o namelist_trc > /dev/null echo 'Removal of unused namelists if any' mkdir namelist_new mv namelist_ice/* namelist_pisces/* namelist_ref/* namelist_top/* namelist_trc/* namelist_new/ diff -arq namelist_new namelists | grep 'Only in namelists:' | cut -d: -f2 \ | xargs -n 1 -i svn rm namelists/{} rm -rf namelist_* ## Compilation echo 'Testing doc build' ./manual_build.sh all [ "$?" != 0 ] && exit 2 ## Undefined references in LaTeX if [ "$( grep 'undefined on' ./latex/*/build/*_manual.log )" ]; then echo 'Undefined refs in doc' grep 'undefined on' ./latex/*/build/*_manual.log exit 2 fi cd - > /dev/null exit 0