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:
parent
0552e7d2c3
commit
a74ee85809
@ -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
|
||||
|
||||
#
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user