grim/guifications3

Parents f37dc8fa8e08
Children 948e2d5fe7ed
turns out i'm an idiot and was nuking the FLAGS list in the darwin specific stuff. This should fix everything and has a bunch of variable name cleanups to try and avoid this in the future.
--- a/gflib/gflib-autogen.sh Sun Nov 08 16:02:11 2009 -0600
+++ b/gflib/gflib-autogen.sh Sun Nov 08 16:48:05 2009 -0600
@@ -126,37 +126,37 @@
# Some helper functions
###############################################################################
add_command () {
- CMD=${1}
+ __cmd=${1}
shift
- ARGS=${@}
+ __flags=${@}
- lappend COMMANDS ${CMD}
- lappend FLAGS ${ARGS}
+ lappend COMMANDS ${__cmd}
+ lappend FLAGS ${__flags}
}
insert_command () {
- INSERT_POINT=${1}
- COMMAND=${2}
+ __insert=${1}
+ __cmd=${2}
shift 2
- ARGS=${@}
+ __flags=${@}
- INDEX=`lsearch COMMANDS ${INSERT_POINT}`
- linsert COMMANDS ${INDEX} ${COMMAND}
- linsert FLAGS ${INDEX} ${ARGS}
+ __index=`lsearch COMMANDS ${__insert}`
+ linsert COMMANDS ${__index} ${__cmd}
+ linsert FLAGS ${__index} ${__flags}
}
update_command () {
- OLD_COMMAND=$1
- NEW_COMMAND=$2
+ __old_command=$1
+ __new_command=$2
shift 2
- ARGS=${@}
+ __flags=${@}
- INDEX=`lsearch COMMANDS ${OLD_COMMAND}`
- test ${INDEX} -ne 0 || return
+ __index=`lsearch COMMANDS ${__old_command}`
+ test ${__index} -ne 0 || return
- lreplace COMMANDS ${INDEX} ${NEW_COMMAND}
+ lreplace COMMANDS ${__index} ${__new_command}
- test -z "${ARGS}" || lreplace FLAGS ${INDEX} ${ARGS}
+ test -z "${__flags}" || lreplace FLAGS ${__index} ${__flags}
}
check_config_file() {
@@ -172,10 +172,10 @@
# dash will only source a file from a source file if it's in the path
# so we add . to the PATH for the source and then revert the path back
# to what it was.
- OLD_PATH=${PATH}
+ __old_path=${PATH}
PATH=".:${PATH}"
. ${ARGS_FILE}
- PATH="${OLD_PATH}"
+ PATH="${__old_path}"
echo "done."
else
@@ -184,66 +184,66 @@
}
check_command () {
- CMD=$1
+ __cmd=$1
- printf "checking for ${CMD}... "
- BIN=`which ${CMD}`
+ printf "checking for ${__cmd}... "
+ __bin=`which ${__cmd}`
- if [ x"${BIN}" = x"" ] ; then
+ if [ x"${__bin}" = x"" ] ; then
echo "not found."
- echo "${CMD} is required to build ${PACKAGE}!"
+ echo "${__cmd} is required to build ${PACKAGE}!"
exit 1;
fi
- echo "${BIN}"
+ echo "${__bin}"
}
check_commands () {
- catlist COMMANDS | while read CMD; do
- check_command ${CMD}
+ catlist COMMANDS | while read __cmd; do
+ check_command ${__cmd}
done
}
run_command () {
- CMD=$1
+ __cmd=$1
shift
# we need to make sure to use a six-character template because some versions
# of mktemp blow up on anything shorter or longer.
- OUTPUT=`mktemp autogen-XXXXXX`
+ __output=`mktemp autogen-XXXXXX`
# we have to stash ${@} into a variable, otherwise printf has "issues" if
# ${@} was expanded from a variable. Fortunately, this lets us clean up
# the output a bit too.
- ARGS="${@}"
- if [ x"${ARGS}" != x"" ] ; then
- ARGS=" ${ARGS}"
+ __args="${@}"
+ if [ x"${__args}" != x"" ] ; then
+ ARGS=" ${__args}"
fi
- printf "running '${CMD}${ARGS}' ... "
- ${CMD} ${@} >${OUTPUT} 2>&1
+ printf "running '${__cmd}${__args}' ... "
+ ${__cmd} ${@} >${__output} 2>&1
if [ $? != 0 ] ; then
echo "failed."
- cat ${OUTPUT}
- rm -f ${OUTPUT}
+ cat ${__output}
+ rm -f ${__output}
exit 1
else
echo "done."
- cat ${OUTPUT}
+ cat ${__output}
- rm -f ${OUTPUT}
+ rm -f ${__output}
fi
}
run_commands () {
- LEN=`llength COMMANDS`
+ __len=`llength COMMANDS`
- for i in `${SEQ_COMMAND} 1 ${LEN}` ; do
- CMD=`lindex COMMANDS ${i}`
- ARGS=`lindex FLAGS ${i}`
+ for i in `${SEQ_COMMAND} 1 ${__len}` ; do
+ __cmd=`lindex COMMANDS ${i}`
+ __flags=`lindex FLAGS ${i}`
- run_command ${CMD} ${ARGS}
+ run_command ${__cmd} ${__flags}
done
}
@@ -293,20 +293,20 @@
update_command libtoolize glibtoolize
# look for fink and add it's aclocal dir to the aclocal flags
- FLAGS=""
+ __flags=""
if [ -d /sw/share/aclocal ] ; then
- FLAGS='-I /sw/share/aclocal'
+ __flags="${__flags} -I /sw/share/aclocal"
fi
- update_command aclocal aclocal ${FLAGS}
+ update_command aclocal aclocal ${__flags}
}
check_platform () {
- PLATFORM=$(uname -s)
+ __platform=$(uname -s)
- printf "adjusting for platform '%s' ... " ${PLATFORM}
+ printf "adjusting for platform '%s' ... " ${__platform}
- case ${PLATFORM} in
+ case ${__platform} in
*BSD*)
platform_bsd
;;