Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] BZR Change 13 to devel sorcery by Andrew Stitt <astitt@sourcemage.org>

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: bzr AT fawkes.sourcemage.org
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] BZR Change 13 to devel sorcery by Andrew Stitt <astitt AT sourcemage.org>
  • Date: Mon, 10 Apr 2006 10:45:27 -0500

------------------------------------------------------------
revno: 13
committer: Andrew Stitt <astitt AT sourcemage.org>
branch nick: devel-hack2
timestamp: Tue 2006-04-04 21:06:53 -0700
message:
fix bug 10538
=== modified file 'ChangeLog'
--- ChangeLog
+++ ChangeLog
@@ -1,3 +1,7 @@
+2006-04-04 Andrew Stitt <astitt AT sourcemage.org>
+ * libmisc: fix select_list default value selection, bug 10538
+ * cleanse, libcast, libgpg: update to slightly modified select_list
api
+
2006-04-04 Andrew Stitt <astitt AT sourcemage.org>
* libmisc: fix bug 10357, add extra check for a file incase theres
a directory named make.

=== modified file 'usr/sbin/cleanse'
--- usr/sbin/cleanse
+++ usr/sbin/cleanse
@@ -220,7 +220,7 @@
printf("options[%d]=\"%s\"\n", count++, $0); ENTRIES[$0]=1;
} }' $DEPENDS_STATUS)
if [ ${#options[@]} -gt 1 ] ; then
- select_list choice 0 "${options[@]}"
+ select_list choice "" "${options[@]}"
message "Removing other entries and keeping selected entry"
else
choice="${options[0]}"
@@ -366,7 +366,7 @@
fi

#Get the user's choice of action
- select_list choice 0 "${options[@]}"
+ select_list choice "" "${options[@]}"
case ${choice} in
I*) message "Ignoring." ;;
D*) echo $1 >> $TMP_DIR/prune.dispel ;;

=== modified file 'var/lib/sorcery/modules/libcast'
--- var/lib/sorcery/modules/libcast
+++ var/lib/sorcery/modules/libcast
@@ -404,13 +404,13 @@
fi

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

Archive powered by MHonArc 2.6.24.

Top of Page