'local' is more common than 'typeset' after all... reverting.

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@796 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
meep-eep
2003-02-21 17:19:30 +00:00
parent 721298ca72
commit 787a334a39
3 changed files with 34 additions and 34 deletions
+6 -6
View File
@@ -37,7 +37,7 @@ usage() {
# The actual recursing function
build_recurse() {
typeset FILES SUBDIRS
local FILES SUBDIRS
# Perform an action for this dir
eval FILES="\${$BUILD_FILES_VAR}"
for FILE in $FILES; do
@@ -69,7 +69,7 @@ build_dependancies() {
# Recursively build dependancy information
build_rec_dependancies() {
typeset DEPEND_FILE EXTRA_OFILES
local DEPEND_FILE EXTRA_OFILES
echo "Building dependancy information..." 1>&2
@@ -103,7 +103,7 @@ build_collect_extra_o_files() {
# Recursively collect .o-files
build_rec_collect_o_files() {
typeset EXTRA_OFILES
local EXTRA_OFILES
BUILD_FILES_VAR=${BUILD_PROJECT}_CFILES
export BUILD_FILES_VAR
@@ -139,7 +139,7 @@ build_clean_dir() {
}
build_clean() {
typeset DEPEND_FILE
local DEPEND_FILE
eval DEPEND_FILE=".depend.\${${BUILD_PROJECT}_NAME%/}"
rm -f "$DEPEND_FILE" build.vars config.state src/config.h
BUILD_FILES_VAR=${BUILD_PROJECT}_CFILES
@@ -183,7 +183,7 @@ build_check_dependencies() {
# Description: check if the program is compiled, and otherwise compile
build_check_compile() {
typeset NAME
local NAME
eval NAME="\${${BUILD_PROJECT}_NAME}"
[ ! -e "$NAME" ] || return
@@ -192,7 +192,7 @@ build_check_compile() {
# Install the program
build_install() {
typeset BINS LIBS SRC DEST DESTDIR BINDIR LIBDIR
local BINS LIBS SRC DEST DESTDIR BINDIR LIBDIR
echo "Installing libraries..." 2>&1
eval LIBS="\${${BUILD_PROJECT}_INSTALL_LIBS}"
+9 -9
View File
@@ -107,7 +107,7 @@ lexlt() {
# Description: check if a program is present in the path
# Arguments:
have_program() {
typeset TEMP_NAME TEMP_FILE TEMP_VERSION
local TEMP_NAME TEMP_FILE TEMP_VERSION
eval eval TEMP_NAME="\\\"\$PROG_${1}_NAME\\\""
if [ -z "$TEMP_NAME" ]; then
@@ -151,7 +151,7 @@ but version $2 is required!"
# Returns: 0 - if the library is found
# 1 - if the library is not found
have_library() {
typeset LIB TEMP_NAME TEMP_PRESENT TEMP_LDFLAGS TEMP_CFLAGS \
local LIB TEMP_NAME TEMP_PRESENT TEMP_LDFLAGS TEMP_CFLAGS \
TEMP_VERSION
LIB="$1"
@@ -213,7 +213,7 @@ but version $2 is required"
# LIB_${1}_LDFLAGS are expected to exist. If two arguments are
# supplied, so is LIB_${1}_VERSION.
use_library() {
typeset TEMP_CFLAGS TEMP_LDFLAGS
local TEMP_CFLAGS TEMP_LDFLAGS
have_library "$@"
[ $? -eq 0 ] || exit 1
@@ -227,7 +227,7 @@ use_library() {
# Description: check if a symbol is defined.
# Arguments: $1 - the name of the symbol
have_symbol() {
typeset SYMBOL
local SYMBOL
SYMBOL="$1"
# TODO: I'll want the include handling to be done differently
@@ -256,7 +256,7 @@ EOF
# name of the symbol.
# Arguments: $1 - the name of the symbol
define_have_symbol() {
typeset NAME VALUE
local NAME VALUE
NAME=`$TR a-z A-Z << EOF
$1
EOF
@@ -271,7 +271,7 @@ EOF
# Description: check if a header is available.
# Arguments: $1 - the name of the header file
have_header() {
typeset HEADER
local HEADER
HEADER="$1"
try_compile_c "$TEMP_CFLAGS" "$TEMP_LDFLAGS" << EOF 2>&1 > /dev/null
@@ -293,7 +293,7 @@ EOF
# name of the header file. "sys/time.h" becomes "SYS_TIME_H".
# Arguments: $1 - the name of the symbol
define_have_header() {
typeset NAME VALUE
local NAME VALUE
NAME=`$TR /.a-z __A-Z << EOF
$1
EOF
@@ -312,7 +312,7 @@ EOF
# Arguments: $1 - the symbol to add
# $2 - the value of the symbol
add_symbol() {
typeset NAME
local NAME
eval NAME="$1"
eval "$NAME"=\"\$2\"
@@ -349,7 +349,7 @@ EOF
# If a filename doesn't end on .in, that filename is used
# as target, and the filename with .in attached as source.
substitute_vars() {
typeset VARS VAR VALUE FILES FILE
local VARS VAR VALUE FILES FILE
eval VARS=\"\$$1\"
eval FILES=\"\$$2\"
+19 -19
View File
@@ -57,7 +57,7 @@ EOF
# Arguments: $1 - the type of menu item
# $2 - the name of the menu item
menu_init() {
typeset INIT_FUN
local INIT_FUN
eval INIT_FUN="\$MENU_ITEM_TYPE_$1_INIT"
"$INIT_FUN" "$2"
@@ -66,7 +66,7 @@ menu_init() {
# Description: Initialise this menu
# Arguments: $1 - the name of the menu
menu_init_menu() {
typeset MENU TEMP_ITEMS ITEM TEMP_TYPE
local MENU TEMP_ITEMS ITEM TEMP_TYPE
MENU="$1"
eval TEMP_ITEMS="\$MENU_${MENU}_ITEMS"
@@ -82,7 +82,7 @@ menu_init_menu() {
# Returns: 0 - if the choice is available
# 1 - if the choice is not available
menu_have_choice() {
typeset MENU CHOICE TEMP_VALID TEMP_PRECOND
local MENU CHOICE TEMP_VALID TEMP_PRECOND
MENU="$1"
CHOICE="$2"
eval TEMP_VALID="\$CHOICE_${MENU}_OPTION_${CHOICE}_VALID"
@@ -101,7 +101,7 @@ menu_have_choice() {
# Description: Initialise this choice menu
# Arguments: $1 - the name of the choice menu
menu_init_choice() {
typeset MENU TEMP_VALUE TEMP_DEFAULT TEMP_OPTIONS OPTION TEMP_TITLE
local MENU TEMP_VALUE TEMP_DEFAULT TEMP_OPTIONS OPTION TEMP_TITLE
MENU="$1"
eval TEMP_VALUE="\$CHOICE_${MENU}_VALUE"
eval TEMP_DEFAULT="\$CHOICE_${MENU}_DEFAULT"
@@ -121,7 +121,7 @@ menu_init_choice() {
# Description: Initialise this input menu
# Arguments: $1 - the name of the input menu
menu_init_input() {
typeset MENU TEMP_VALUE TEMP_DEFAULT
local MENU TEMP_VALUE TEMP_DEFAULT
MENU="$1"
eval TEMP_VALUE="\$INPUT_${MENU}_VALUE"
if [ -z "$TEMP_VALUE" ]; then
@@ -136,7 +136,7 @@ menu_init_input() {
# $2 - the name of the menu item
# Outputs: The string describing the value of the menu item
menu_print_value() {
typeset PRINT_VALUE
local PRINT_VALUE
eval PRINT_VALUE="\$MENU_ITEM_TYPE_$1_PRINT_VALUE"
"$PRINT_VALUE" "$2"
@@ -153,7 +153,7 @@ menu_print_value_menu() {
# Arguments: $1 - the name of the choice menu item
# Outputs: The string describing the value of this choice menu
menu_print_value_choice() {
typeset TEMP_VALUE TEMP_TITLE
local TEMP_VALUE TEMP_TITLE
eval TEMP_VALUE="\$CHOICE_$1_VALUE"
eval TEMP_TITLE=\"\$CHOICE_$1_OPTION_${TEMP_VALUE}_TITLE\"
cat << EOF
@@ -165,7 +165,7 @@ EOF
# Arguments: $1 - the name of the input menu item
# Outputs: The value of the given input menu
menu_print_value_input() {
typeset TEMP_VALUE TEMP_TITLE
local TEMP_VALUE TEMP_TITLE
eval TEMP_VALUE="\$INPUT_$1_VALUE"
cat << EOF
$TEMP_VALUE
@@ -177,7 +177,7 @@ EOF
# $2 - the name of the menu item
# Outputs: The string describing the value of the menu item
menu_handle() {
typeset HANDLER
local HANDLER
eval HANDLER="\$MENU_ITEM_TYPE_$1_HANDLER"
"$HANDLER" "$2"
@@ -186,7 +186,7 @@ menu_handle() {
# Description: Process a menu-type menu item
# Arguments: $1 - The name of the menu
menu_handle_menu() {
typeset TEMP_ITEMS I CHOICE NUM_ITEMS TEMP_TYPE MENU ITEM TEMP_TITLE
local TEMP_ITEMS I CHOICE NUM_ITEMS TEMP_TYPE MENU ITEM TEMP_TITLE
eval TEMP_ITEMS="\$MENU_$1_ITEMS"
MENU="$1"
@@ -248,7 +248,7 @@ EOF
# Description: Process a choice-type menu item
# Arguments: $1 - The name of the menu
menu_handle_choice() {
typeset TEMP_OPTIONS I CHOICE NUM_OPTIONS TEMP_TYPE MENU OPTION \
local TEMP_OPTIONS I CHOICE NUM_OPTIONS TEMP_TYPE MENU OPTION \
TEMP_VALUE TEMP_TITLE SELECTED
eval TEMP_OPTIONS="\$CHOICE_$1_OPTIONS"
@@ -335,7 +335,7 @@ EOF
# Description: Process an input-type menu item
# Arguments: $1 - The name of the menu
menu_handle_input() {
typeset ITEM TEMP_TITLE TEMP_VALUE TEMP_DEFAULT NEW_VALUE TEMP_VALIDATOR
local ITEM TEMP_TITLE TEMP_VALUE TEMP_DEFAULT NEW_VALUE TEMP_VALIDATOR
ITEM="$1"
eval TEMP_TITLE="\$INPUT_${ITEM}_TITLE"
@@ -376,7 +376,7 @@ EOF
# $2 - the name of the menu item
# Outputs: The string describing the value of the menu item
menu_save() {
typeset SAVE_FUN
local SAVE_FUN
eval SAVE_FUN="\$MENU_ITEM_TYPE_$1_SAVE"
"$SAVE_FUN" "$2"
}
@@ -386,7 +386,7 @@ menu_save() {
# Arguments: $1 - the name of the menu
# Outputs: The string describing the value of the menu
menu_save_menu() {
typeset MENU TEMP_ITEMS ITEM TEMP_TYPE
local MENU TEMP_ITEMS ITEM TEMP_TYPE
MENU="$1"
eval TEMP_ITEMS="\$MENU_${MENU}_ITEMS"
@@ -401,7 +401,7 @@ menu_save_menu() {
# Arguments: $1 - the name of the choice menu
# Outputs: The string describing the value of the choice menu
menu_save_choice() {
typeset MENU TEMP_VALUE
local MENU TEMP_VALUE
MENU="$1"
eval TEMP_VALUE="\$CHOICE_${MENU}_VALUE"
cat << EOF
@@ -414,7 +414,7 @@ EOF
# Arguments: $1 - the name of the input menu
# Outputs: The string describing the value of the input menu
menu_save_input() {
typeset MENU TEMP_VALUE
local MENU TEMP_VALUE
MENU="$1"
eval TEMP_VALUE="\$INPUT_${MENU}_VALUE"
cat << EOF
@@ -427,7 +427,7 @@ EOF
# Arguments: $1 - the type of menu item
# $2 - the name of the menu item
menu_process() {
typeset PROCESS_FUN
local PROCESS_FUN
eval PROCESS_FUN="\$MENU_ITEM_TYPE_$1_PROCESS"
"$PROCESS_FUN" "$2"
}
@@ -436,7 +436,7 @@ menu_process() {
# for a menu.
# Arguments: $1 - the name of the menu
menu_process_menu() {
typeset MENU TEMP_ITEMS ITEM TEMP_TYPE
local MENU TEMP_ITEMS ITEM TEMP_TYPE
MENU="$1"
eval TEMP_ITEMS="\$MENU_${MENU}_ITEMS"
@@ -450,7 +450,7 @@ menu_process_menu() {
# a choice menu.
# Arguments: $1 - the name of the choice menu
menu_process_choice() {
typeset MENU TEMP_VALUE TEMP_ACTION
local MENU TEMP_VALUE TEMP_ACTION
MENU="$1"
eval TEMP_VALUE="\$CHOICE_${MENU}_VALUE"
eval TEMP_ACTION="\$CHOICE_${MENU}_OPTION_${TEMP_VALUE}_ACTION"