Replace "( : ${var?} )" syntax with better "[ ${var+set} ]" syntax.

Reviewed by:	jilles, adrian (co-mentor)
Approved by:	jilles, adrian (co-mentor)
This commit is contained in:
Devin Teske 2012-09-22 04:04:02 +00:00
parent 2d49f165a9
commit 8d8d314d78
5 changed files with 7 additions and 11 deletions

View File

@ -132,7 +132,7 @@ f_sysrc_get()
# Clear the environment of all variables, preventing the
# expansion of normals such as `PS1', `TERM', etc.
#
f_clean_env --except RC_CONFS RC_DEFAULTS SUCCESS
f_clean_env --except RC_CONFS RC_DEFAULTS
. "$RC_DEFAULTS" > /dev/null 2>&1
@ -153,15 +153,11 @@ f_sysrc_get()
# If RC_CONFS is defined, set $rc_conf_files to an explicit
# value, modifying the default behavior of source_rc_confs().
#
( : ${RC_CONFS?} ) > /dev/null 2>&1
if [ $? -eq ${SUCCESS:-0} ]; then
if [ "${RC_CONFS+set}" ]; then
rc_conf_files="$RC_CONFS"
_rc_confs_set=1
fi
unset SUCCESS
# no longer needed
source_rc_confs > /dev/null 2>&1
#

View File

@ -46,7 +46,7 @@ ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
# Options
#
# Inherit SHOW_DESC value if set, otherwise default to 1
( : ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1
[ "${SHOW_DESC+set}" ] || SHOW_DESC=1
############################################################ FUNCTIONS

View File

@ -54,7 +54,7 @@ RCCONF_MENU_LIST=
# Options
#
# Inherit SHOW_DESC value if set, otherwise default to 1
( : ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1
[ "${SHOW_DESC+set}" ] || SHOW_DESC=1
# Selectively inherit SHOW_* value (in order of preference)
if [ "$SHOW_DEFAULT_VALUE" ]; then
SHOW_DEFAULT_VALUE=1

View File

@ -54,7 +54,7 @@ RCCONF_MENU_LIST=
# Options
#
# Inherit SHOW_DESC value if set, otherwise default to 1
( : ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1
[ "${SHOW_DESC+set}" ] || SHOW_DESC=1
# Selectively inherit SHOW_* value (in order of preference)
if [ "$SHOW_DEFAULT_VALUE" ]; then
SHOW_DEFAULT_VALUE=1
@ -348,7 +348,7 @@ while :; do
var="${mtag# }"
# Toggle the state-variable and loop back to menu
if ( eval : \${_${var}_delete?} ) > /dev/null 2>&1; then
if eval [ \"\${_${var}_delete+set}\" ]; then
unset _${var}_delete
else
setvar _${var}_delete 1

View File

@ -54,7 +54,7 @@ RCVAR_MENU_LIST=
# Options
#
# Inherit SHOW_DESC value if set, otherwise default to 1
( ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1
[ "${SHOW_DESC+set}" ] || SHOW_DESC=1
############################################################ FUNCTIONS