Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (3e230a73680ed95174f97eddcef89ce9b5f31c91)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Jaka Kranjc <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (3e230a73680ed95174f97eddcef89ce9b5f31c91)
  • Date: Sat, 10 Oct 2009 06:05:22 -0500

GIT changes to master sorcery by Jaka Kranjc <lynxlynxlynx AT sourcemage.org>:

ChangeLog | 2 +
etc/sorcery/config | 1
usr/sbin/sorcery | 6 ++-
var/lib/sorcery/modules/libdepends | 60
+++++++++++++++++++++++++++++++++++--
4 files changed, 64 insertions(+), 5 deletions(-)

New commits:
commit 3e230a73680ed95174f97eddcef89ce9b5f31c91
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

sorcery, libdepends: added option to show a spell description option
in queries for optional dependencies #14675, patch by Bor Kraljič

diff --git a/ChangeLog b/ChangeLog
index d2fbc77..c575453 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,8 @@
* api2: call delve with -g when not working with all grimoires #15211
* sorcery, libsorcery: removed combreloc, it is on by default where
appropriate #10750
+ * sorcery, libdepends: added option to show a spell description option
+ in queries for optional dependencies #14675, patch by Bor Kraljič

2009-09-04 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* api2: fixed two debug statements
diff --git a/etc/sorcery/config b/etc/sorcery/config
index c5b4b59..9b9f0b2 100755
--- a/etc/sorcery/config
+++ b/etc/sorcery/config
@@ -45,6 +45,7 @@ color() {
EXTENSION=${EXTENSION-.bz2}
SET_TERM_TITLE=${SET_TERM_TITLE:=off}
PER_SPELL_CFLAGS=${PER_SPELL_CFLAGS:=off}
+SHOW_GAZE_SHORT_QUERY=${SHOW_GAZE_SHORT_QUERY:=on}
COLOR=${COLOR:=on}
CONFIG_LOC=${CONFIG_LOC:=on}
GATHER_DOCS=${GATHER_DOCS:=on}
diff --git a/usr/sbin/sorcery b/usr/sbin/sorcery
index b3c76c4..15c804a 100755
--- a/usr/sbin/sorcery
+++ b/usr/sbin/sorcery
@@ -1551,6 +1551,7 @@ feature_menu() {
local UF_HELP="Ensure a sane environment before sorcery update"
local SCR_HELP="Toggle usage of screen in cast"
local PSC_HELP="Ask for custom cflags for each spell"
+ local SHSQ_HELP="Show spell description option in queries for optional
dependencies"

if TOGGLES=`eval $DIALOG ' --title "Feature Menu" \
--no-cancel \
@@ -1580,9 +1581,10 @@ feature_menu() {
"CROSS_INSTALL" "Toggle" "$CROSS_INSTALL" "$CI_HELP" \
"SET_TERM_TITLE" "Toggle" "$SET_TERM_TITLE" "$ST_HELP" \
"SCREEN" "Toggle" "$SCREEN" "$SCR_HELP" \
- "PER_SPELL_CFLAGS" "Toggle" "$PER_SPELL_CFLAGS" "$PSC_HELP"'`
+ "PER_SPELL_CFLAGS" "Toggle" "$PER_SPELL_CFLAGS" "$PSC_HELP" \
+ "SHOW_GAZE_SHORT_QUERY" "Toggle" "$SHOW_GAZE_SHORT_QUERY"
"$SHSQ_HELP"'`
then
- TEMP=(ARCHIVE AUTOFIX UPDATEFIX AUTOPRUNE CCACHE COLOR CONFIG_LOC
GATHER_DOCS MAIL_REPORTS PRESERVE SUSTAIN TMPFS VIEW_REPORTS VOYEUR REAP
STORE_CONF_LOG NET_SELECT CLEAN_SOURCE CROSS_INSTALL SET_TERM_TITLE SCREEN
PER_SPELL_CFLAGS)
+ TEMP=(ARCHIVE AUTOFIX UPDATEFIX AUTOPRUNE CCACHE COLOR CONFIG_LOC
GATHER_DOCS MAIL_REPORTS PRESERVE SUSTAIN TMPFS VIEW_REPORTS VOYEUR REAP
STORE_CONF_LOG NET_SELECT CLEAN_SOURCE CROSS_INSTALL SET_TERM_TITLE SCREEN
PER_SPELL_CFLAGS SHOW_GAZE_SHORT_QUERY)
for i in ${TEMP[*]} ; do
eval $i=off
done
diff --git a/var/lib/sorcery/modules/libdepends
b/var/lib/sorcery/modules/libdepends
index 4cc8128..5fa0f41 100755
--- a/var/lib/sorcery/modules/libdepends
+++ b/var/lib/sorcery/modules/libdepends
@@ -1193,6 +1193,60 @@ function work_optional_depends_provider()
}

#---------------------------------------------------------------------
+## @param spell
+## @param question
+## @param default answer
+##
+## @return 0 on yes
+## @return 1 on no
+##
+## Works just like normal query but can show short description of a
+## spell and stops the timer for taking the default answer if
+## h/H is pressed. Type of query is chosen in sorcery feature menu.
+##
+#---------------------------------------------------------------------
+function optional_depends_query() {
+ local _response
+ local spell_name=$1
+ local time_to_answer=$PROMPT_DELAY
+
+ while true; do
+ _response=""
+
+ if [[ -z $SILENT ]]; then
+ if [[ $SHOW_GAZE_SHORT_QUERY == off ]]; then
+ echo -e -n "${QUERY_COLOR}$2 [$3] ${DEFAULT_COLOR}"
+ else
+ if [[ $3 == y ]]; then
+ echo -e -n "${QUERY_COLOR}$2 [Y/n/h] ${DEFAULT_COLOR}"
+ else
+ echo -e -n "${QUERY_COLOR}$2 [y/N/h] ${DEFAULT_COLOR}"
+ fi
+ fi
+
+ if [[ -n $time_to_answer ]]; then
+ read -t $time_to_answer -n 1 _response
+ echo
+ else
+ read -n 1 _response
+ echo
+ fi
+ fi
+
+ _response=${_response:=$3}
+ case $_response in
+ n|N) return 1 ;;
+ y|Y) return 0 ;;
+ h|H) ( codex_set_current_spell_by_name $spell_name
+ echo $SHORT
+ echo More information at: $WEB_SITE
+ )
+ unset time_to_answer
+ esac
+ done
+}
+
+#---------------------------------------------------------------------
## @param spell name
## @param addition to OPTS if enabled
## @param addition to OPTS if disabled
@@ -1296,10 +1350,10 @@ function work_optional_depends_spell()
[[ $default == off ]] && stuff=n || stuff=y

if spell_ok $1 ; then
- query "Do you want to use ${SPELL_COLOR}$1${DEFAULT_COLOR}?" "$stuff" &&
- install="on"
+ optional_depends_query "$1" "Do you want to use
${SPELL_COLOR}$1${QUERY_COLOR}?" "$stuff" &&
+ install="on"
else
- query "Do you want to cast ${SPELL_COLOR}$1${DEFAULT_COLOR}?" "$stuff" &&
+ optional_depends_query "$1" "Do you want to cast
${SPELL_COLOR}$1${QUERY_COLOR}?" "$stuff" &&
install="on"
fi




  • [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (3e230a73680ed95174f97eddcef89ce9b5f31c91), Jaka Kranjc, 10/10/2009

Archive powered by MHonArc 2.6.24.

Top of Page