Skip to Content.
Sympa Menu

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

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 (abe422baf368ce8af6a1a1bcb35452e39e80bbc7)
  • Date: Tue, 2 Sep 2008 07:40:18 -0500

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

ChangeLog | 4 ++
var/lib/sorcery/modules/build_api/common | 45
------------------------------
var/lib/sorcery/modules/libmisc | 46
+++++++++++++++++++++++++++++++
3 files changed, 50 insertions(+), 45 deletions(-)

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

common, libmisc: moved the notice and failure log functions to
libmisc and added a check to log_failure_reason for being in cast

diff --git a/ChangeLog b/ChangeLog
index 44bf331..7ebed54 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-09-02 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * common, libmisc: moved the notice and failure log functions to
+ libmisc and added a check to log_failure_reason for being in cast
+
2008-09-01 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* cast, libspell, libsorcery, libcast, libsummon: fixed bug #2209
display the reason for spell failure. Now the end summary will show
diff --git a/var/lib/sorcery/modules/build_api/common
b/var/lib/sorcery/modules/build_api/common
index 148dc37..9cad77d 100755
--- a/var/lib/sorcery/modules/build_api/common
+++ b/var/lib/sorcery/modules/build_api/common
@@ -447,48 +447,3 @@ function run_spell_failure() {
fi
CAST_EXIT_STATUS=1
}
-
-#---------------------------------------------------------------------
-## Appends the input to the notice log, prepending the spell name as a
-## title, appending a newline and teeing the input back unchanged.
-#---------------------------------------------------------------------
-function append_to_notice_log() {
- local notice_log=$TMP_DIR/notice_log
- local tmp_log=$TMP_DIR/tmp_notice_log
-
- tee $tmp_log
- if [[ -s $tmp_log ]]; then
- message "$SPELL_COLOR$SPELL:$DEFAULT_COLOR" >> $notice_log
- cat $tmp_log >> $notice_log
- echo >> $notice_log
- fi
- rm -f $tmp_log
-}
-
-#---------------------------------------------------------------------
-## Appends the failure reason (input) to a log for use in displaying
-## the final FAILED_LIST and the activity log
-##
-## @param reason
-#---------------------------------------------------------------------
-function log_failure_reason() {
- # delve has a different TMP_DIR, so we can't use it
- local failure_reason_log=$CAST_BACKUPDIR/failure_reason_log
- echo "$SPELL ($1)" >> "$failure_reason_log"
-}
-
-#---------------------------------------------------------------------
-## Checks if there is an entry for the spell in the failure_reason_log
-## If there is one, set the upvar to the reason
-##
-## @param upvar
-#---------------------------------------------------------------------
-function get_failure_reason() {
- local failure_reason_log=$CAST_BACKUPDIR/failure_reason_log
- local _upvar=$1
- local _reason
-
- # if a spell has more than one entry, the first will be used
- _reason=$(grep -s -m1 "^$SPELL " $failure_reason_log | sed
's,^[^(]*(\([^)]*\)).*$,\1,')
- upvar $_upvar "$_reason"
-}
diff --git a/var/lib/sorcery/modules/libmisc b/var/lib/sorcery/modules/libmisc
index e37791e..f9c1778 100755
--- a/var/lib/sorcery/modules/libmisc
+++ b/var/lib/sorcery/modules/libmisc
@@ -1522,6 +1522,52 @@ function envar_prepend_path()
fi
}

+#---------------------------------------------------------------------
+## Appends the input to the notice log, prepending the spell name as a
+## title, appending a newline and teeing the input back unchanged.
+#---------------------------------------------------------------------
+function append_to_notice_log() {
+ local notice_log=$TMP_DIR/notice_log
+ local tmp_log=$TMP_DIR/tmp_notice_log
+
+ tee $tmp_log
+ if [[ -s $tmp_log ]]; then
+ message "$SPELL_COLOR$SPELL:$DEFAULT_COLOR" >> $notice_log
+ cat $tmp_log >> $notice_log
+ echo >> $notice_log
+ fi
+ rm -f $tmp_log
+}
+
+#---------------------------------------------------------------------
+## Appends the failure reason (input) to a log for use in displaying
+## the final FAILED_LIST and the activity log
+##
+## @param reason
+#---------------------------------------------------------------------
+function log_failure_reason() {
+ # delve has a different TMP_DIR, so we can't use it
+ local failure_reason_log=$CAST_BACKUPDIR/failure_reason_log
+ [[ -z $CAST_BACKUPDIR ]] && return 1
+ echo "$SPELL ($1)" >> "$failure_reason_log"
+}
+
+#---------------------------------------------------------------------
+## Checks if there is an entry for the spell in the failure_reason_log
+## If there is one, set the upvar to the reason
+##
+## @param upvar
+#---------------------------------------------------------------------
+function get_failure_reason() {
+ local failure_reason_log=$CAST_BACKUPDIR/failure_reason_log
+ local _upvar=$1
+ local _reason
+
+ # if a spell has more than one entry, the first will be used
+ _reason=$(grep -s -m1 "^$SPELL " $failure_reason_log | sed
's,^[^(]*(\([^)]*\)).*$,\1,')
+ upvar $_upvar "$_reason"
+}
+

# Standard debug line:
# file "function@line" "all" "args"



  • [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (abe422baf368ce8af6a1a1bcb35452e39e80bbc7), Jaka Kranjc, 09/02/2008

Archive powered by MHonArc 2.6.24.

Top of Page