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}`
21 ## perl -wapi\~ -f fix-header-locs.pl "${F}" >/dev/null 2>&1 && rm -f "${F}~"
26 # Optionally fix whitespace
27 (( ${fix_whitespace:-0} )) && ed "$F" < fix-whitespace.ed > /dev/null 2>&1
29 perl -wapi\~ -f ${thisdir}/fix_headers_nugen.pl "${F}" >/dev/null 2>&1 && rm -f "${F}~"
32 function cmake_file() {
35 # Optionally fix whitespace
36 (( ${fix_whitespace:-0} )) && ed "$F" < fix-whitespace.ed > /dev/null 2>&1
38 perl -wapi\~ -f ${thisdir}/fix_cmake_nugen.pl "${F}" >/dev/null 2>&1 && rm -f "${F}~"
41 # ======================================================================
43 getopt -T >/dev/null 2>&1
44 if (( $? != 4 )); then
45 echo "ERROR: GNU getopt required! Check SETUP_GETOPT and PATH." 1>&2
49 TEMP=`getopt -n "$prog" -o a --long all-lumi-cases --long one-file: --long no-fix-pset -- "${@}"`
66 echo "Bad argument \"$OPT\"" 1>&2
76 # ======================================================================
77 # Run scripts to update
79 TMP=`mktemp -t update_sources.sh.XXXXXX`
80 trap "rm $TMP* 2>/dev/null" EXIT
82 if [[ -n "${file}" ]]; then
83 if ! [[ -r "${file}" ]]; then
84 echo "ERROR: ${file} does not exist or is not readable." 1>&2
90 for F in `find "${TOP:-.}" \( -name "*.c*" -o -name "*.C*" -o -name "*.icc" -o -name "*.h*" -o -name "*.H*" \) -print`; do
93 for F in `find "${TOP:-.}" -name CMakeLists.txt -print`; do