Skip to Content.
Sympa Menu

sm-discuss - Re: [SM-Discuss] One new cool feature for sorcery...

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: Aaron Brice <abrice2 AT cox.net>
  • To: pradierdavid AT yahoo.fr
  • Cc: sm-discuss AT lists.ibiblio.org
  • Subject: Re: [SM-Discuss] One new cool feature for sorcery...
  • Date: 22 Sep 2002 01:14:18 -0700

Attached is the script I used to use to do this. It probably doesn't
work with the new codex stuff, and I'm not at home to be able to test it
and fix it, but basically all it does is get a listing of all the
directories in $GRIMOIRE before and after a sorcery update, and reports
a diff (displays on the screen and/or emails the report). I think that
replacing $GRIMOIRE with $GRIMOIRE[0] might sort of work, assuming you
only are using one grimoire. I think there's also an enhancement filed
in bugzilla about reporting the status after a sorcery update, which
would hopefully include the new spells added to the grimoire.. Let me
know if there's any interest in this script and I'll fix it..

Aaron

On Thu, 2002-09-19 at 13:26, david wrote:
> ... would be to have displayed the list of new spells when doing a sorcery
> update :-)
>
> It's not always easy to know that a new spell has been added, except by
> watching the submit mailing list :-|
>
> What do you think about it ?
>
> day
> _______________________________________________
> SM-Discuss mailing list
> SM-Discuss AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/sm-discuss

#!/bin/sh

. /etc/sorcery/config
. $SUBROUTINES
OLD_GRIMOIRE_FILE=/tmp/spells.old
NEW_GRIMOIRE_FILE=/tmp/spells.new
GRIMOIRE_DIFF_FILE=/tmp/spells.diff

# Get a list of all the spells in the Grimoire
OLD_GRIMOIRE=$(ls -d $GRIMOIRE/*/*)

rm $OLD_GRIMOIRE_FILE 2>&-
for spell in $OLD_GRIMOIRE
do
  echo $spell | sed -e "s!$GRIMOIRE/!!" >> $OLD_GRIMOIRE_FILE
done

#Update the Grimoire
sorcery update

#Get an updated list of spells in the Grimoire
NEW_GRIMOIRE=$(ls -d $GRIMOIRE/*/*)

rm $NEW_GRIMOIRE_FILE 2>&-
for spell in $NEW_GRIMOIRE
do
  echo $spell | sed -e "s!$GRIMOIRE/!!" >> $NEW_GRIMOIRE_FILE
done

# NEW_SPELLS contains the spells that are in the new grimoire
#	that weren't in the old.  If a spell is moved to a new
#	section, it will show up in the list also.
NEW_SPELLS=$(diff $OLD_GRIMOIRE_FILE $NEW_GRIMOIRE_FILE | grep "^>" | sed -e "s/> //")

rm $GRIMOIRE_DIFF_FILE 2>&-
for spell in $NEW_SPELLS
do
  . $GRIMOIRE/$spell/DETAILS 1>&- 2>&-
  echo -e "$spell:\n\t$SHORT\n" >> $GRIMOIRE_DIFF_FILE 2>&-
done

if [[ -f $GRIMOIRE_DIFF_FILE ]]
then
  #These variables don't really apply, it's a kluge to use report()
  export SPELL="new"
  export VERSION="grimoire"
  report $GRIMOIRE_DIFF_FILE "new spells"
fi

rm $OLD_GRIMOIRE_FILE $NEW_GRIMOIRE_FILE $GRIMOIRE_DIFF_FILE



Archive powered by MHonArc 2.6.24.

Top of Page