if [[ $init_default == y ]] && [[ $xinetd_default == y ]] ; then
- default=3
+ default=both
elif [[ $xinetd_default == y ]] ; then
- default=2
+ default=xinetd
elif [[ $init_default == y ]] ; then
- default=1
+ default=init
else
- default=0
+ default=neither
fi
select_list $returnvar $default neither init xinetd both
}
@@ -526,7 +526,7 @@
! grep -v disable $inst_file|diff - $file &>/dev/null ; then
message "${QUERY_COLOR}$inst_file differs from the default $file," \
"what would you like to do?${DEFAULT_COLOR}"
- select_list choice 0 "ignore" "overwrite" "overwrite/backup"
+ select_list choice "ignore" "ignore" "overwrite" "overwrite/backup"
case $choice in
"overwrite/backup")
local backup=$inst_file.$(date +'%Y%m%d%H%M')
=== modified file 'var/lib/sorcery/modules/libgpg'
--- var/lib/sorcery/modules/libgpg
+++ var/lib/sorcery/modules/libgpg
@@ -416,7 +416,7 @@
"${DEFAULT_COLOR}${PROBLEM_COLOR}failed!"
message "What would you like to do?${DEFAULT_COLOR}"
local choice
- select_list choice 0 "set aside" "remove" "ignore"
+ select_list choice "" "set aside" "remove" "ignore"
case "$choice" in
"set aside") local tgt=$grimoire_name.$(date +%Y%m%d%H%M).corrupt
message "moving grimoire to $tgt"
=== modified file 'var/lib/sorcery/modules/libmisc'
--- var/lib/sorcery/modules/libmisc
+++ var/lib/sorcery/modules/libmisc
@@ -493,6 +493,7 @@
local returnvar=$1
local default=$2
local stuff=()
+ local default_num=0
shift 2
hash_unset select_list_hash
@@ -503,11 +504,12 @@
for foo in "$@"; do
message "\t$DEFAULT_COLOR(${stuff[$i]})
$SPELL_COLOR$foo$DEFAULT_COLOR"
hash_put select_list_hash "${stuff[$i]}" "$foo"
+ [[ "$foo" ]] && [[ "$foo" == "$default" ]] &&
default_num=${stuff[$i]}
let i++
done
- local msg="\n${QUERY_COLOR}Which one do you want?
[$default]$DEFAULT_COLOR "
- select_list_sub "$returnvar" select_list_hash "$msg" "$default"
+ local msg="\n${QUERY_COLOR}Which one do you want?
[$default_num]$DEFAULT_COLOR "
+ select_list_sub "$returnvar" select_list_hash "$msg" "$default_num"
hash_unset select_list_hash
}
@@ -997,19 +999,10 @@
# if there was an answer before, find it
local default default_num=0 foo
config_get_last_option "$VARIABLE" default
- [[ $default ]] || default="$1"
- let i=0
- for foo in "$@"; do
- if [[ "$foo" == "$default" ]] ; then
- default_num=$i
- break
- fi
- let i++
- done
-
- # we have to ask user
+
+ # we have to ask the user
message "$QUESTION"
- select_list ANSWER ${default_num} "$@"
+ select_list ANSWER "$default" "$@"
config_set_option "$VARIABLE" "$ANSWER"
fi
[SM-Commit] BZR Change 13 to devel sorcery by Andrew Stitt <astitt AT sourcemage.org>,
bzr, 04/10/2006