4 # ======================================================================
7 usage: $prog [--one-file <file>] <top-dir>
13 ( cd / ; /bin/pwd -P ) >/dev/null 2>&1
14 if (( $? == 0 )); then
18 thisdir=`cd ${reldir} && /bin/pwd ${pwd_P_arg}`
24 # Optionally fix whitespace
25 (( ${fix_whitespace:-0} )) && ed "$F" < fix-whitespace.ed > /dev/null 2>&1
27 perl -wapi\~ -f ${thisdir}/fix-header-locs-ifdh.pl "${F}" >/dev/null 2>&1 && rm -f "${F}~"
30 function cmake_file() {
33 # Optionally fix whitespace
34 (( ${fix_whitespace:-0} )) && ed "$F" < fix-whitespace.ed > /dev/null 2>&1
36 perl -wapi\~ -f ${thisdir}/fix-cmake-nutools.pl "${F}" >/dev/null 2>&1 && rm -f "${F}~"
38 function cmake_file_2() {
41 # Optionally fix whitespace
42 (( ${fix_whitespace:-0} )) && ed "$F" < fix-whitespace.ed > /dev/null 2>&1
44 perl -wapi\~ -f ${thisdir}/fix-cmake-ifdh.pl "${F}" >/dev/null 2>&1 && rm -f "${F}~"
46 function cmake_file_3() {
49 # Optionally fix whitespace
50 (( ${fix_whitespace:-0} )) && ed "$F" < fix-whitespace.ed > /dev/null 2>&1
52 perl -wapi\~ -f ${thisdir}/fix-cmake-genie.pl "${F}" >/dev/null 2>&1 && rm -f "${F}~"
55 # ======================================================================
57 getopt -T >/dev/null 2>&1
58 if (( $? != 4 )); then
59 echo "ERROR: GNU getopt required! Check SETUP_GETOPT and PATH." 1>&2
63 TEMP=`getopt -n "$prog" -o a --long all-lumi-cases --long one-file: --long no-fix-pset -- "${@}"`
80 echo "Bad argument \"$OPT\"" 1>&2
90 # ======================================================================
91 # Run scripts to update
93 TMP=`mktemp -t update_sources.sh.XXXXXX`
94 trap "rm $TMP* 2>/dev/null" EXIT
96 if [[ -n "${file}" ]]; then
97 if ! [[ -r "${file}" ]]; then
98 echo "ERROR: ${file} does not exist or is not readable." 1>&2
106 ## for F in `find $TOP \( -name "*.c*" -o -name "*.C*" -o -name "*.icc" -o -name "*.h*" -o -name "*.H*" \) -print`; do
110 for F in `find $TOP -name CMakeLists.txt -print`; do