#!/bin/bash PROGNAME=${0##*/} APP_SVNID='$HeadURL$ $LastChangedRevision$' echo "setting up environment ..." PATTERNS=( # ADE 2.0 ade_mua # PBP '(defined|printf|close|unlink|join|split|system)\(' # More Pythony '(&&|\|\|)' '!(defined|close|unlink)' # Misc '[^$]\{[a-zA-Z][a-zA-Z0-9_]+\}' # ${word} is okay, but $somevar{word} should be $somevar{'word'} 'ade_get_progname\(\)' # parameter-less call ) for PATTERN in "${PATTERNS[@]}"; do echo "grepping for use of '$PATTERN' ..." while read FILENAME; do # ADE references its global variables without the $ADE::whatever prefix. if [[ $PATTERN =~ ERR_FAIL ]] && [[ $FILENAME = */ADE.pm ]]; then continue fi # The '(?!.*${PROGNAME%%_*})' bit means that if the line ends with 'ADESTDTEST501' then # the grep will be silent, i.e. it is a way to suppress this check reporting things it's # not intelligent enough to comprehend. grep -PH "^[^#]*$PATTERN(?!.*${PROGNAME%%_*})" $FILENAME || true done < <(find $ADETEST_MODROOT/ -type f -name '*.p[lm]') done echo "all done"