Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master sorcery by Thomas Orgis (3a72b84a03a77221634018881a2aa66d60328aa8)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Thomas Orgis <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master sorcery by Thomas Orgis (3a72b84a03a77221634018881a2aa66d60328aa8)
  • Date: Tue, 12 Dec 2023 22:21:13 +0000

GIT changes to master sorcery by Thomas Orgis <sobukus AT sourcemage.org>:

var/lib/sorcery/modules/libdepengine | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)

New commits:
commit 3a72b84a03a77221634018881a2aa66d60328aa8
Author: Thomas Orgis <sobukus AT sourcemage.org>
Commit: Thomas Orgis <sobukus AT sourcemage.org>

libdepengine: ignore pre_remove and post_remove failures for failure
detection

The loop prevention hack guessed wrongly that a pre_remove failure is
serious and hence caused lots of spells being dropped once e.g.
grep was cast, which has a PRE_REMOVE that returns non-zero (something we
could
investigate). Sorcery ignores that return value also for post_remove, but
the runtime mechanism still stores the failure reason.

Maybe we should ignore that failure reason log altogether. But I think I
had a reason including it.

We need to rewrite this all ...

This commit also makes the two messages different, adding 'subtly' for the
cases where the spell didn't outright fail but still has a reason
(conflicts
is one remaining case which we might want to settle) and listing the
found reasons. This mainly should aid debugging once we get rid of these
cases. Either there is a failure or not, please.

diff --git a/var/lib/sorcery/modules/libdepengine
b/var/lib/sorcery/modules/libdepengine
index 486fb63..70b3832 100755
--- a/var/lib/sorcery/modules/libdepengine
+++ b/var/lib/sorcery/modules/libdepengine
@@ -135,19 +135,22 @@ depengine_cast_engine() {
rc=$?
fi

+ # pre_sub_depends failure is non-fatal, just means re-cast
+ # Also, pre_remove and post_remove return values are ignored, anyway.
+ local fail_reasons=$(grep -s "^$spell "
"$CAST_BACKUPDIR/failure_reason_log" \
+ | cut -f 2 -d ' ' \
+ | grep -v -e '(pre_sub_depends)' -e '(pre_remove)' -e '(post_remove)')
# Crude hacks to avoid casting spells whose dependencies failed.
# Since sorcery does not properly keep track of spell state with
# its multiple passes, some grepping in files that store failures
# does the trick.
if grep -qs "^$spell$" "$FAILED_LIST"; then
message "${MESSAGE_COLOR}The spell ${SPELL_COLOR}$spell$MESSAGE_COLOR" \
- " failed to cast. Remembering that.$DEFAULT_COLOR"
+ " failed to cast. Remembering that.
${fail_reasons}$DEFAULT_COLOR"
rc=1
- # pre_sub_depends failure is non-fatal, just means re-cast
- elif grep -s "^$spell " "$CAST_BACKUPDIR/failure_reason_log" \
- | grep -q -v pre_sub_depends; then
+ elif [[ -n $fail_reasons ]]; then
message "${MESSAGE_COLOR}The spell ${SPELL_COLOR}$spell$MESSAGE_COLOR" \
- " failed before cast. Remembering that.$DEFAULT_COLOR"
+ " subtly failed before cast. Remembering that.
${fail_reasons}$DEFAULT_COLOR"
rc=1
fi




  • [SM-Commit] GIT changes to master sorcery by Thomas Orgis (3a72b84a03a77221634018881a2aa66d60328aa8), Thomas Orgis, 12/12/2023

Archive powered by MHonArc 2.6.24.

Top of Page