Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to devel-pyrobor2 sorcery by Bor Kraljič (07bf30b46dcec73167cc01d3c5c030fe870b4296)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Bor Kraljič <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to devel-pyrobor2 sorcery by Bor Kraljič (07bf30b46dcec73167cc01d3c5c030fe870b4296)
  • Date: Mon, 17 Oct 2011 05:03:01 -0500

GIT changes to devel-pyrobor2 sorcery by Bor Kraljič <pyrobor AT ver.si>:

ChangeLog | 3
etc/sorcery/config | 1
etc/sorcery/hooks/mail.hook | 53 +++++++++
etc/sorcery/hooks/sound.hook | 62 ++++++++++
etc/sorcery/hooks/xterm_title.hook | 115 ++++++++++++++++++++
etc/sorcery/version | 2
install | 5
usr/sbin/cast | 7 -
usr/sbin/delve | 1
usr/sbin/dispel | 2
usr/sbin/resurrect | 1
usr/sbin/summon | 1
var/lib/sorcery/modules/build_api/common | 10 +
var/lib/sorcery/modules/libcast | 2
var/lib/sorcery/modules/libdispel | 2
var/lib/sorcery/modules/libmisc | 176
++++++++++++++++++++++++-------
var/lib/sorcery/modules/libresurrect | 4
var/lib/sorcery/modules/libsorcery | 12 --
var/lib/sorcery/modules/libspell | 6 +
19 files changed, 414 insertions(+), 51 deletions(-)

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

cosmetic version bump for developers

commit 6d7624a48d9c9c7c3321639191261e8aa9370a9e
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

hooks: final fixes

commit abe97c02c32bd9999247e055cfef4a43af519338
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

hooks: avoid extraneus (re)inits

commit 74dccf25ce9c03ea1ee4df1f658059ef7b3a327e
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

hooks: propagate the starting return code and some cleanup

commit 481ac65e2166c51c45b27a6b8e5cd3084994123d
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

cleaned up hooks/etc: reformatting, boilerplate, simplifications, fixes

commit 9684fa984e9faec86957751fba81972953678b13
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

removed cleantext hook, it belongs to the grimoire

commit a412b453a73da822690fc9a60de5f7a8dc006453
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

Squashed commit of the following from ruskie/hooks:

commit a689ae96baadb99a777f00e349d2d96cb85ef64f
Author: Andraž Levstik <ruskie+2054d253 AT codemages.net>
Date: Fri Jul 2 11:58:17 2010 +0200

finalized query hooks

commit 6e4a32c99fbcb34630c05ef3d9455589152f0e35
Author: Andraž Levstik <ruskie+2054d253 AT codemages.net>
Date: Fri Jul 2 11:54:17 2010 +0200

update

commit c5bc1eae5e45f87d7c8649a1756fa608ba56a795
Author: Andraž Levstik <ruskie+2054d253 AT codemages.net>
Date: Fri Jul 2 11:51:45 2010 +0200

update hooks, now with optional pre|post support and added a hook to
run on query

commit 37a55ff1b9cf0d9ec31095f32ac8281a77f59332
Author: Andraž 'ruskie' Levstik <ruskie AT codemages.net>
Date: Tue Apr 27 20:08:17 2010 +0200

adding example hooks

commit 0c8921d59c3e991412e69210d3913b68e36da9ea
Author: Andraž 'ruskie' Levstik <ruskie AT codemages.net>
Date: Tue Apr 27 20:06:41 2010 +0200

libhook: removed completly - now in example hooks

commit 281c8313182cd50405d47c4b4b7f12b3c612eb60
Author: Andraž 'ruskie' Levstik <ruskie AT codemages.net>
Date: Tue Apr 27 19:31:37 2010 +0200

fixup install

commit 35e32a378b329c385d24b94e4743c9a8a862aae3
Author: root <root@odin.(none)>
Date: Tue Apr 27 19:27:50 2010 +0200

removed CONFLICTS hooks - the way sorcery does it breaks any output
by hooks, moved things around a bit

commit a6ae4e6122a84aeabd9fa10ffbf4b2d85be65cf3
Author: root <root@odin.(none)>
Date: Tue Apr 27 18:33:27 2010 +0200

hooks: updates to make it work

commit 74df009d6079963c94a90f3c57411249c6f02b88
Author: Andraž Levstik <ruskie+2054d253 AT codemages.net>
Date: Tue Apr 27 17:42:18 2010 +0200

remove DETAILS, PRE_SUB_DEPENDS and SUB_DEPENDS from various files

commit 00778e0bc8e51c944e467bf00299e1b71cb87b8d
Author: Andraž Levstik <ruskie+2054d253 AT codemages.net>
Date: Mon Apr 26 11:02:11 2010 +0200

don't run on DETAILS

commit a0f3c76f6dc187d2b61ef68bc6b89baf4e345b5b
Merge: 287aa71 070be19
Author: Andraž Levstik <ruskie+2054d253 AT codemages.net>
Date: Fri Apr 2 09:17:34 2010 +0200

Merge branch 'master' into hooks

commit 287aa71d36e6eafa88c7ad3e529ba5626418b589
Author: Andraž Levstik <ruskie+2054d253 AT codemages.net>
Date: Sun Oct 11 16:40:26 2009 +0200

libspell: fixed the obvious bug

commit 927227b233ce0790dde3b7668561bc406b8bb6ca
Author: Andraž Levstik <ruskie+2054d253 AT codemages.net>
Date: Sun Oct 11 16:24:51 2009 +0200

fixed the final whitespace in ChangeLog

commit 5e2921d62f956dbebe684ebaeaeffa4f9cb93de6
Author: Andraž Levstik <ruskie+2054d253 AT codemages.net>
Date: Sun Oct 11 16:23:37 2009 +0200

fixed up some whitespaces part 5

commit f8b172c07693fa313864a18ff90517ce6e92ed84
Author: Andraž Levstik <ruskie+2054d253 AT codemages.net>
Date: Sun Oct 11 16:22:22 2009 +0200

fixed up some whitespaces part 4

commit 8c8816def14fafe100f9f88cbd609c04dd4496c4
Author: Andraž Levstik <ruskie+2054d253 AT codemages.net>
Date: Sun Oct 11 16:21:54 2009 +0200

fixed up some whitespaces part 3

commit 4e6afd041293641a2dd38c3fad2ae291c7e69937
Author: Andraž Levstik <ruskie+2054d253 AT codemages.net>
Date: Sun Oct 11 16:21:03 2009 +0200

fixed up some whitespaces part 2

commit 66c2facae41a766ce7a4f1fd1bffa03cdc4b623c
Author: Andraž Levstik <ruskie+2054d253 AT codemages.net>
Date: Sun Oct 11 16:16:54 2009 +0200

fixed up some whitespaces

commit a4e398be000dd12966bba68d0ae738405368139a
Author: Andraž Levstik <ruskie+2054d253 AT codemages.net>
Date: Sun Oct 11 16:09:52 2009 +0200

updated SORCERY_HOOKS dir

commit 92acd4665f4ffe85e6ab6eb3e179a1aec5c14f67
Author: Andraž Levstik <ruskie+2054d253 AT codemages.net>
Date: Sun Oct 11 16:04:04 2009 +0200

config: removed USE_HOOKS

commit 89a492bb8f7fba78cc81cfe8f20903b12238786b
Author: Andraž Levstik <ruskie+2054d253 AT codemages.net>
Date: Sun Oct 11 16:01:14 2009 +0200

sorcery: removed USE_HOOKS

commit c75cd7819ea249b2052ebe818c7d0628653ad940
Merge: f4eb9f6 488f2a3
Author: Andraž Levstik <ruskie+2054d253 AT codemages.net>
Date: Sun Oct 11 16:00:14 2009 +0200

Merge branch 'master' into hooks
Fixed up confilct
Conflicts:
usr/sbin/sorcery

commit f4eb9f6ef29132228d212701f6b74b3ce7684504
Author: Andraž Levstik <ruskie+2054d253 AT codemages.net>
Date: Sun Oct 11 15:58:38 2009 +0200

ChangeLog: not needed to update

commit 7681f745971e26604928c05497efb0c6a1903779
Author: Andraž Levstik <ruskie+2054d253 AT codemages.net>
Date: Sun Oct 11 15:56:59 2009 +0200

rewriting of internal functions hopefully complete

commit 44435791f82b69c4c11c89e0413de5b8bd429753
Author: Andraž Levstik <ruskie+2054d253 AT codemages.net>
Date: Thu Oct 8 10:54:19 2009 +0200

updates as per bug #13938

commit 64ca5cd86a1361035e5da9d0dfd36ad0aca42249
Author: Andraž Levstik <ruskie+2054d253 AT codemages.net>
Date: Fri Sep 25 12:04:06 2009 +0200

fixed formating

commit e973c6230b60b18f76363076cada02a4e5919693
Author: Andraž Levstik <ruskie+2054d253 AT codemages.net>
Date: Fri Sep 25 11:48:06 2009 +0200

fixed entry in ChangeLog

commit e0d64e6c2f08cdc87e57b83c5a7ba5c80a040f5b
Author: Andraž Levstik <ruskie+2054d253 AT codemages.net>
Date: Fri Sep 25 11:47:15 2009 +0200

spun off all example hooks

commit 0d23896944ffa67624d07d7d45c4c0ad61540391
Author: Andraž Levstik <ruskie+2054d253 AT codemages.net>
Date: Fri Sep 25 11:45:25 2009 +0200

updates as per bug

commit 245ddefb00793d2d291ffaf69604401bc03f439a
Author: Andraž Levstik <ruskie+2054d253 AT codemages.net>
Date: Fri Sep 25 10:56:00 2009 +0200

more fixups

commit b3ff654a4685ac5016ad23f1c64f21c3d61ecf31
Author: Andraž Levstik <ruskie+2054d253 AT codemages.net>
Date: Fri Sep 25 10:34:46 2009 +0200

libcast: updated run_security

commit 86a5d966e82ec36a01447de47eff21aed93a80bc
Author: Andraž Levstik <ruskie+2054d253 AT codemages.net>
Date: Fri Sep 25 10:19:56 2009 +0200

updated mail hooks and got rid of mail_report

commit 95134046d51b1d633b0dd6f2605223e19777ab3b
Author: Andraž Levstik <ruskie+2054d253 AT codemages.net>
Date: Fri Sep 25 09:51:19 2009 +0200

updated mail hooks

commit 6bb8e64527613bb935b8e3c8ef7d6c19776193d0
Merge: e9faf84 75fa475
Author: Andraž Levstik <ruskie+2054d253 AT codemages.net>
Date: Fri Sep 25 09:42:01 2009 +0200

Merge branch 'master' into hooks
Hopefully properly resolved the stuff
Conflicts:
ChangeLog
usr/sbin/sorcery
var/lib/sorcery/modules/build_api/api2
var/lib/sorcery/modules/build_api/common
var/lib/sorcery/modules/libcast
var/lib/sorcery/modules/libmisc

commit e9faf8438dbaaf5d1877ec8f617c00f27c2519fb
Merge: 59c320f 29db8d6
Author: Andraž Levstik <ruskie+2054d253 AT codemages.net>
Date: Fri Sep 25 09:12:53 2009 +0200

Merge branch 'hooks' of
http://ruskie.codemages.net/repos/projects/sorcery into hooks
Fixed conflicts
Conflicts:
usr/sbin/cast
var/lib/sorcery/modules/build_api/common
var/lib/sorcery/modules/libdepends

commit 59c320f16a25e9c380bdeacb6ad65781bde7289a
Merge: 931918d 1c666b2
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Sat Mar 22 18:34:02 2008 +0100

Merge branch 'master' into hooks

commit 931918dcca5b37136dc41a8b2a6e0fee1c242392
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Sun Feb 10 16:49:43 2008 +0100

bad merge: var/lib/sorcery/modules/libmisc

commit 956afc4f73a2294bc8d052d32e4d5ee1ce06ca6c
Merge: 0031280 6d36b7b
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Sun Feb 10 16:48:39 2008 +0100

Merge branch 'master' into hooks

Conflicts:

usr/sbin/cast
var/lib/sorcery/modules/build_api/api1
var/lib/sorcery/modules/build_api/api2
var/lib/sorcery/modules/build_api/common
var/lib/sorcery/modules/libdepends
var/lib/sorcery/modules/libmisc

commit 0031280863705aab59b09d740b857870c02b759a
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Tue Nov 27 17:12:36 2007 +0100

erm whatever libdepends change

commit 96ce3d1ce475ea6f945c227690d06f0a8d9510c8
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:06:13 2007 +0200

forgot ChangeLog

commit 4bb3c7a40db3ba785330133bb2659a1568c33186
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:05:25 2007 +0200

use SORCERY_HOOKS

commit 51791d808cc2cf81c2b98b447b0ac39ec0968122
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:05:21 2007 +0200

some more updates

commit a11ef256e2b9882726897d38f888c62537dd69f8
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:05:01 2007 +0200

doh stupid me... copy paste is bad

commit a3f3679bc87f796dfb3798f10ff70d44b6d9b3f7
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:04:58 2007 +0200

minor fix

commit 61b3c8ab021af7328a82da1acfcb29e425ed934c
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:04:54 2007 +0200

minor tweaks to the mail scripts

commit a7b6f6f73cd13b8998b21f7d30467c83a3bebd54
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:04:50 2007 +0200

added mail hooks

commit 4d07184132fb93723912603e38b0c30fbf661f23
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:04:36 2007 +0200

added two sample hooks, xterm and cleartext

commit 32010eb3dd302def4a34c4a75f7535528801f7fe
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:04:17 2007 +0200

forgot the sorcery etc var

commit ce0426ff9b474a95c2359a46c9550283daee9201
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:04:13 2007 +0200

adde DETAILS and added FEATURE MENU option

commit eb31b2579f3492abd70b00332a08bdf0b6450229
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:04:07 2007 +0200

added CONFLICTS and renamed cast_pass_five into cast_final

commit 01be7d707c50cd53e892dffbfe52dfc73afb36b7
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:04:01 2007 +0200

added libhook

commit c570f69b94d55dac700946c1c0e8b774cf315152
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:03:51 2007 +0200

new hook

commit 1607207683b637dba69cf9e58d157a524c35b648
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:03:48 2007 +0200

more hooks updates

commit 99005907ee2651afb82023823897161c5c22f4a5
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:03:12 2007 +0200

added cast_pass_five hook

commit ce7838baf952cc57dd1c7e5c6cfccc27771f4128
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:02:54 2007 +0200

added inital hook support and droped out the saund() function, will

commit 29db8d6e418468787fa927437455fc89d1600eba
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:06:13 2007 +0200

forgot ChangeLog

commit a10d228ebfe24ef4d28498e1b96f5eb81e00912d
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:05:25 2007 +0200

use SORCERY_HOOKS

commit 72861cc69df118634e15cb90671122c01cf5776c
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:05:21 2007 +0200

some more updates

commit 0577e112762fd376e73ed7dc90b202103d37fc4c
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:05:01 2007 +0200

doh stupid me... copy paste is bad

commit 3debfe2555b68aec4d9f43c321a7187c4cc1460b
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:04:58 2007 +0200

minor fix

commit 6fbe9e65d709cf428f54a85f848f7b04f9c29b8b
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:04:54 2007 +0200

minor tweaks to the mail scripts

commit e2bfd83ad5850d982bd21880f224741264bcd2fe
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:04:50 2007 +0200

added mail hooks

commit 4dcedb1c5b3b125401f3185b62ccdb5d3bc32ddb
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:04:36 2007 +0200

added two sample hooks, xterm and cleartext

commit 5c784bffe427b73e34635c8ebf28cac23fba0969
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:04:17 2007 +0200

forgot the sorcery etc var

commit 25cf50625477f6c5f3ccb0c714140e12b2a884a1
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:04:13 2007 +0200

adde DETAILS and added FEATURE MENU option

commit 7750a7ebbf928ef8bd24b17a17ff759df34e402f
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:04:07 2007 +0200

added CONFLICTS and renamed cast_pass_five into cast_final

commit c45d8707b168b4df4b42ed1585be669eabf34aef
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:04:01 2007 +0200

added libhook

commit 6e8542b2f0e43740179b93766ccbcf5cb2482db9
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:03:51 2007 +0200

new hook

commit 56cc93cbc8b5663df374b40e75dac8904ab0af79
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:03:48 2007 +0200

more hooks updates

commit 40425f220e351489de1edd11d2554ebdd7721432
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:03:12 2007 +0200

added cast_pass_five hook

commit 21758de2801ceabb3b54952fd8ee6352d3425c5e
Author: Andraž Levstik <ruskie AT mages.ath.cx>
Date: Fri Aug 10 14:02:54 2007 +0200

added inital hook support and droped out the saund() function, will

diff --git a/ChangeLog b/ChangeLog
index a057c4b..acade83 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2011-10-16 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * etc/hooks ...: added hooks support, initial patch by Andraž Levstik
+
2011-10-10 Bor Kraljič <pyrobor AT ver.si>
* dl_git: added option to clean git repository if git pull failed
(#15920)

diff --git a/etc/sorcery/config b/etc/sorcery/config
index d482459..01b930f 100755
--- a/etc/sorcery/config
+++ b/etc/sorcery/config
@@ -136,6 +136,7 @@
GRIMOIRE_MANIFEST_ALGORITHM=${GRIMOIRE_MANIFEST_ALGORITHM:-sha1}
SOLO=${SGL_LIBRARY}/solo
SUBROUTINES=${SGL_LIBRARY}/subroutines
SUSTAINED=${SGL_LIBRARY}/sustained
+ SORCERY_HOOKS=${SORCERY_HOOKS:-/etc/sorcery/hooks}
SM_LICENSE_LIST=${SM_LICENSE_DIRECTORY}/license_list

SPELL_INDEX_FILE=${SPELL_INDEX_FILE:-codex.index}
diff --git a/etc/sorcery/hooks/mail.hook b/etc/sorcery/hooks/mail.hook
new file mode 100755
index 0000000..3cadd63
--- /dev/null
+++ b/etc/sorcery/hooks/mail.hook
@@ -0,0 +1,53 @@
+#!/bin/bash
+#---------------------------------------------------------------------
+## @Synopsis Hooks for sending mail
+## @Copyright Copyright (C) 2010 The Source Mage Team
<http://www.sourcemage.org>
+## Functions implementing mail hooks for the end of cast reporting
+#---------------------------------------------------------------------
+
+[[ -x /usr/bin/mail && $MAIL_REPORTS == on ]] || return 0
+
+function mail_cast_final_hook() {
+ {
+ echo "---Success---"
+ cat $SUCCESS_LIST | column
+ echo "---Failure---"
+ cat $FAILED_LIST | column
+ echo "---Dropped---"
+ echo $NOT_CAST | column
+ echo "---Conflicts---"
+ cut -d" " -f2- $CONFLICT_LIST 2>/dev/null | column
+ echo "---check_self succeed---"
+ cat $CHECK_TRIGGERS_SUCCESS | column
+ echo "---check_self fail---"
+ cat $CHECK_TRIGGERS_FAILURE | column
+ } | mail -s "Final report" $SORCERER
+}
+
+function mail_post_FAILURE_hook() {
+ date -u | mail -s "Compile log" -a $C_LOG $SORCERER 2>/dev/null
+}
+
+function mail_post_SUCCESS_hook() {
+ date -u | mail -s "Compile log" -a $C_LOG $SORCERER 2>/dev/null
+ date -u | mail -s "Install log" -a $INST_LOG $SORCERER 2>/dev/null
+}
+
+#---------------------------------------------------------------------
+## @License
+##
+## This software is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This software is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this software; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+#---------------------------------------------------------------------
diff --git a/etc/sorcery/hooks/sound.hook b/etc/sorcery/hooks/sound.hook
new file mode 100755
index 0000000..cb30236
--- /dev/null
+++ b/etc/sorcery/hooks/sound.hook
@@ -0,0 +1,62 @@
+#!/bin/bash
+#---------------------------------------------------------------------
+## @Synopsis Hooks for playing sounds
+## @Copyright Copyright (C) 2010 The Source Mage Team
<http://www.sourcemage.org>
+## Functions implementing sound hooks for the end of cast reporting
+#---------------------------------------------------------------------
+
+[[ -x /usr/bin/play ]] || return 0
+
+#---------------------------------------------------------------------
+##
+## @Globals SOUND SOUND_DIRECTORY SOUND_THEME
+## Plays a given soundfile if sounds are on and the file exists in
+## the chosen theme.
+##
+## Needs sox
+#---------------------------------------------------------------------
+function sound() {
+ local sound_file
+ case $SOUND in
+ on) sound_file=$SOUND_DIRECTORY/$SOUND_THEME/$1
+ if [[ -e $sound_file ]]; then
+ ( cd / ; play $sound_file 2>/dev/null & )
+ debug "libmisc" "Playing $sound_file"
+ else
+ debug "libmisc" "Error playing $sound_file: no such file"
+ fi
+ ;;
+ esac
+
+}
+
+function sound_REPORT_hook() {
+ sound REPORT
+}
+
+function sound_post_FAILURE_hook() {
+ sound FAILURE
+}
+
+function sound_post_SUCCESS_hook() {
+ sound SUCCESS
+}
+
+#---------------------------------------------------------------------
+## @License
+##
+## This software is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This software is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this software; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+#---------------------------------------------------------------------
diff --git a/etc/sorcery/hooks/xterm_title.hook
b/etc/sorcery/hooks/xterm_title.hook
new file mode 100755
index 0000000..45ea5bc
--- /dev/null
+++ b/etc/sorcery/hooks/xterm_title.hook
@@ -0,0 +1,115 @@
+#!/bin/bash
+#---------------------------------------------------------------------
+## @Synopsis Hooks for setting the term title
+## @Copyright Copyright (C) 2010 The Source Mage Team
<http://www.sourcemage.org>
+## Functions implementing term title hooks for all the hook points
+
+[[ $SET_TERM_TITLE != "on" ]] && return 0
+
+#---------------------------------------------------------------------
+## @param title
+## @Globals TERM
+##
+## sets the terminal title if TERM=xterm|rxvt or the window title if
+## TERM=screen
+##
+#---------------------------------------------------------------------
+function set_term_title()
+{
+ case $TERM in
+ xterm*|rxvt) echo -ne "\e]0;$@\007" ;;
+ screen) echo -ne "\ek$@\e\\" ;;
+ *) true ;;
+ esac
+}
+
+function xterm_title_cast_initialize_hook() {
+ set_term_title "cast started"
+}
+
+function xterm_title_cast_start_spell_hook() {
+ set_term_title "[$SPELL]: casting"
+}
+
+function xterm_title_cast_final_hook() {
+ if [[ $ANTE_RC == 0 ]]; then
+ set_term_title "cast finished succesfully"
+ else
+ set_term_title "cast finished with failures!"
+ fi
+}
+
+function xterm_title_pre_SUCCESS_hook() {
+ set_term_title "[$SPELL]: success!"
+}
+
+function xterm_title_pre_FAILURE_hook() {
+ set_term_title "[$SPELL]: failure!"
+}
+
+function xterm_title_pre_BUILD_hook() {
+ set_term_title "[$SPELL]: building"
+}
+
+function xterm_title_pre_DOWNLOAD_hook() {
+ # summon and cast are run in parallel, so try to avoid conflicts
+ # let cast have precedence
+ if test -t 1; then
+ set_term_title "[$SPELL]: downloading"
+ fi
+}
+
+function xterm_title_pre_INSTALL_hook() {
+ if [[ $STAGED_INSTALL != on ]]; then
+ set_term_title "[$SPELL]: installing"
+ else
+ set_term_title "[$SPELL]: installing to stage"
+ fi
+}
+
+function xterm_title_pre_INSTALL_EXTRAS_hook() {
+ set_term_title "[$SPELL]: installing extras"
+}
+
+function xterm_title_pre_PRE_BUILD_hook() {
+ set_term_title "[$SPELL]: unpacking"
+}
+
+function xterm_title_pre_dispel_hook() {
+ set_term_title "[$SPELL]: dispelling"
+}
+
+function xterm_title_pre_PRE_RESURRECT_hook() {
+ set_term_title "[$SPELL]: resurrecting"
+}
+
+function xterm_title_pre_TRANSFER_hook() {
+ set_term_title "[$SPELL]: transfering to system"
+}
+
+function xterm_title_pre_TRIGGERS_hook() {
+ set_term_title "[$SPELL]: checking triggers"
+}
+
+function xterm_title_pre_UP_TRIGGERS_hook() {
+ set_term_title "[$SPELL]: checking reverse triggers"
+}
+
+#---------------------------------------------------------------------
+## @License
+##
+## This software is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This software is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this software; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+#---------------------------------------------------------------------
diff --git a/etc/sorcery/version b/etc/sorcery/version
index 51f7593..5dbf14a 100644
--- a/etc/sorcery/version
+++ b/etc/sorcery/version
@@ -1 +1 @@
-20080324
+20111014
diff --git a/install b/install
index a94f3f7..e1dcf2b 100755
--- a/install
+++ b/install
@@ -117,6 +117,11 @@ for FILE in \
fi
done

+# Create the hooks dir since hooks try to check that the files are properly
owned
+mkdir -p "${INSTALL_ROOT}/etc/sorcery/hooks"
+chown 0:0 "${INSTALL_ROOT}/etc/sorcery/hooks"
+chmod 0755 "${INSTALL_ROOT}/etc/sorcery/hooks"
+

#---------------------------------------------------------------------
##=back
diff --git a/usr/sbin/cast b/usr/sbin/cast
index 5f31dc6..c940a80 100755
--- a/usr/sbin/cast
+++ b/usr/sbin/cast
@@ -217,6 +217,7 @@ function cast_spell() { (
set_term_title "Casting spell [$SPELL] ($gsp_done of $gsp_total)"
message "${MESSAGE_COLOR}Casting spell
[${SPELL_COLOR}$SPELL${MESSAGE_COLOR}]" \
"($gsp_done of $gsp_total)"
+ run_hook cast_start_spell

run_details
load_build_api || return 1
@@ -422,6 +423,8 @@ function pass_two() {
get_cast_progress gsp_done gsp_total
message "${MESSAGE_COLOR}Spells are to be cast" \
"(${DEFAULT_COLOR}${gsp_total}${MESSAGE_COLOR}):${DEFAULT_COLOR}"
+ run_hook cast_initialize
+
message "---------------------------"
message "${SPELL_COLOR}${SPELLS_TO_CAST}" | tr '[:blank:]' '\n' | column
message "${DEFAULT_COLOR}"
@@ -677,7 +680,6 @@ function pass_five() {
message "$item"
done | sort | column

- set_term_title "Casting successful."
message "${DEFAULT_COLOR}"

fi
@@ -741,7 +743,6 @@ function pass_five() {
done < $FAILED_LIST | sort -u | column
rm -f $failure_reason_log

- set_term_title "Casting failed."
message "${DEFAULT_COLOR}"
rc=1

@@ -759,6 +760,7 @@ function pass_five() {
rc=1
fi
fi
+ run_hook cast_final "" $rc

# check if confmeld should be run
local spell deferred_list
@@ -1036,6 +1038,7 @@ else
fi

trap int_trap INT
+ init_hooks
main "$@"
rc=$?
if [ $SHLVL -eq $TOP_LEVEL ] ; then
diff --git a/usr/sbin/delve b/usr/sbin/delve
index 591c522..8070d2d 100755
--- a/usr/sbin/delve
+++ b/usr/sbin/delve
@@ -474,6 +474,7 @@ elif [ "$UID" -gt 0 ]; then
else
# Make a nice dir structure to put stuff in, this exits if it fails
mk_tmp_dirs delve
+ init_hooks
main "$@"
rc=$?
cleanup_tmp_dir $TMP_DIR
diff --git a/usr/sbin/dispel b/usr/sbin/dispel
index 94a045e..4ef5d66 100755
--- a/usr/sbin/dispel
+++ b/usr/sbin/dispel
@@ -622,6 +622,8 @@ if [ $# == 0 ]; then help | $PAGER
elif [[ $1 == -h ]] || [[ $1 == --help ]] ; then help
elif [ "$UID" == 0 ]; then
mk_tmp_dirs dispel
+ # FIXME: not sure if this is the right place for it
+ init_hooks
main "$@"
rc=$?
cleanup_tmp_dir $TMP_DIR
diff --git a/usr/sbin/resurrect b/usr/sbin/resurrect
index 9b53469..db3a894 100755
--- a/usr/sbin/resurrect
+++ b/usr/sbin/resurrect
@@ -315,6 +315,7 @@ if [[ $UID -gt 0 ]]; then
PARAMS=$(consolidate_params "$@")
run_as_root resurrect "$@"
else
+ init_hooks
main "$@"
fi

diff --git a/usr/sbin/summon b/usr/sbin/summon
index cda9cdf..a010603 100755
--- a/usr/sbin/summon
+++ b/usr/sbin/summon
@@ -240,6 +240,7 @@ if [ "$UID" == 0 ] ; then
renice $NICE -p $$ >/dev/null
fi
mk_tmp_dirs summon
+ init_hooks
main "$@"
rc=$?
cleanup_tmp_dir $TMP_DIR
diff --git a/var/lib/sorcery/modules/build_api/common
b/var/lib/sorcery/modules/build_api/common
index 57edb2b..41cfe3c 100755
--- a/var/lib/sorcery/modules/build_api/common
+++ b/var/lib/sorcery/modules/build_api/common
@@ -23,6 +23,7 @@
function run_config_loc () {
debug "build_api/common" "Starting run_config_loc() on $SPELL"
pushd . > /dev/null # may have been somewhere else
+ run_hook config_loc pre
[ -d "$SOURCE_DIRECTORY" ] &&
cd $SOURCE_DIRECTORY # we need to be in here for this function to
work
if [[ $CONFIG_LOC == on ]]; then
@@ -71,6 +72,7 @@ function run_config_loc () {
fi

popd &>/dev/null
+ run_hook config_loc post

}

@@ -206,12 +208,11 @@ function run_spell_success() {
local TMP_MD5_LOG="$TMP_DIR/$SPELL-$VERSION.md5"
local C_LOG_COMP="$COMPILE_LOGS/$SPELL-$VERSION$EXTENSION"

+ run_hook SUCCESS pre
local CACHE
construct_cache_name "$INSTALL_CACHE/$SPELL-$VERSION-$HOST" CACHE
local CACHE_COMP=$CACHE$EXTENSION

- sound SUCCESS
-
tablet_check_version_cache "$VERSION_STATUS" &&
(
codex_set_current_spell_by_name $SPELL
@@ -363,6 +364,7 @@ function run_spell_success() {
create_cache_archive $TMP_INST_LOG $CACHE $CACHE_COMP

report_install
+ run_hook SUCCESS post
rm -f $IW_LOG $C_LOG $TMP_INST_LOG $TMP_MD5_LOG "$STAGE_INST_LOG" \
"$spell_sub_depends" "$spell_rsub_depends" "$spell_depends"
}
@@ -375,7 +377,7 @@ function run_spell_failure() {
debug "build_api/common" "cast of $SPELL-$VERSION failed"
local rc=$1

- sound FAILURE
+ run_hook FAILURE pre

local reason
get_failure_reason reason
@@ -400,6 +402,8 @@ function run_spell_failure() {
IW_LOG="${INSTALLWATCHFILE:-$INSTW_LOGFILE}"
devoke_installwatch

+ run_hook FAILURE post
+
rm -f $IW_LOG $C_LOG

local spell_sub_depends spell_rsub_depends
diff --git a/var/lib/sorcery/modules/libcast b/var/lib/sorcery/modules/libcast
index d380146..29aa542 100755
--- a/var/lib/sorcery/modules/libcast
+++ b/var/lib/sorcery/modules/libcast
@@ -166,6 +166,7 @@ function run_security() {
debug "build_api/common" "Starting run_security() on $SPELL"
local rc=0
if [[ -f $SCRIPT_DIRECTORY/SECURITY ]]; then
+ run_hook SECURITY pre
message "${SPELL_COLOR}${SPELL}:${DEFAULT_COLOR}"
tee -a $SECURITY_LOG < $SCRIPT_DIRECTORY/SECURITY
if grep -q critical $SCRIPT_DIRECTORY/SECURITY; then
@@ -174,6 +175,7 @@ function run_security() {
query "SECURITY: Do you still want to cast
${SPELL_COLOR}$SPELL${DEFAULT_COLOR}${QUERY_COLOR}?" "y"
fi
rc=$?
+ run_hook SECURITY post
fi
[[ $rc != 0 ]] && log_failure_reason "security"
return $rc
diff --git a/var/lib/sorcery/modules/libdispel
b/var/lib/sorcery/modules/libdispel
index 06c09b8..b6f5baf 100755
--- a/var/lib/sorcery/modules/libdispel
+++ b/var/lib/sorcery/modules/libdispel
@@ -319,6 +319,7 @@ function post_remove() {
function dispel_spell() {

local SPELL=$1
+ run_hook dispel pre
# fake dispel, only remove sorcery metadata
if [[ $DEBUG_DISPEL ]] ; then
echo "pretending to dispel $SPELL"
@@ -362,6 +363,7 @@ function dispel_spell() {
"${PROBLEM_COLOR}failed!${DEFAULT_COLOR}"
return $rc
fi
+ run_hook dispel post
return 0
}

diff --git a/var/lib/sorcery/modules/libmisc b/var/lib/sorcery/modules/libmisc
index 55a56db..8e4635f 100755
--- a/var/lib/sorcery/modules/libmisc
+++ b/var/lib/sorcery/modules/libmisc
@@ -103,6 +103,7 @@ function isalpha() {
function real_query() {
debug "libmisc" "Running query() with the following arguments: '$1' and
'$2'"
local _response
+ run_hook real_query

while true; do
_response=""
@@ -142,6 +143,7 @@ function real_query_string () {
local ANSWER_first ANSWER_rest

local DEFAULT=""
+ run_hook real_query_string
[ -n "$3" ] && DEFAULT=" [$3] "

if [ -z "$SILENT" ]; then
@@ -323,27 +325,151 @@ function clear_line() {

}

-
#---------------------------------------------------------------------
##
-## @Globals SOUND
-## Plays a given soundfile if sounds are on and the file exists in
-## the chosen theme.
+## @Globals USE_HOOKS LIST_OF_HOOKS
+## Used to initialize hooks
+## Limitations: hook functions need to be defined as:
+## something_hookname_hook
+## in files named: something.hook
+##
+## Example:
+## mail.hook
+## function mail_post_SUCCESS_hook(){
+## send_that_mail
+## }
##
#---------------------------------------------------------------------
-function sound() {
+function init_hooks() {
+ debug "libmisc" "init_hooks - starting"
+ # check if we were called already
+ declare -F hook_marker &>/dev/null && return 0
+
+ local hook_file
+ local hookdir_perms="$(ls -lnd $SORCERY_HOOKS 2>/dev/null|awk '{printf
"%s:%s:%s\n" ,$1,$3,$4;}')"
+ local hooks_list=""
+
+ if [[ $hookdir_perms == "drwxr-xr-x:0:0" ]]; then
+ for hook_file in $SORCERY_HOOKS/* ; do
+ # check if the effective owner and group are
+ # the same as the running process - root
+ # check for read and execute perms
+ # still lacks better security checking
+ # ideally this should be:
+ # if it's owned by 0:0 and has no write perms
+ # for group or other then it's assumed safe
+ # Extra precaution is done by permissions on the hooks
+ # directory and checked before the loop
+ if [[ -G $hook_file ]] &&
+ [[ -O $hook_file ]] &&
+ [[ -x $hook_file ]] &&
+ [[ -r $hook_file ]]
+ then
+ . $hook_file
+ hooks_list="$hooks_list $(smgl_basename ${hook_file/.hook})"
+ debug "libmisc" "init_hooks - loaded $hook_file"
+ fi
+ done
+ local function_name function_list
+ function_list="cast_initialize \
+ cast_start_spell \
+ cast_final \
+ real_query \
+ real_query_string \
+ REPORT \
+ pre_dispel \
+ post_dispel \
+ pre_SUCCESS \
+ post_SUCCESS \
+ pre_FAILURE \
+ post_FAILURE \
+ pre_BUILD \
+ post_BUILD \
+ pre_config_loc \
+ post_config_loc \
+ pre_CONFIGURE \
+ post_CONFIGURE \
+ pre_DEPENDS \
+ post_DEPENDS \
+ pre_DOWNLOAD \
+ post_DOWNLOAD \
+ pre_FINAL \
+ post_FINAL \
+ pre_INSTALL \
+ post_INSTALL \
+ pre_INSTALL_EXTRAS \
+ post_INSTALL_EXTRAS \
+ pre_POST_INSTALL \
+ post_POST_INSTALL \
+ pre_POST_REMOVE \
+ post_POST_REMOVE \
+ pre_POST_RESURRECT \
+ post_POST_RESURRECT \
+ pre_PRE_BUILD \
+ post_PRE_BUILD \
+ pre_PRE_INSTALL \
+ post_PRE_INSTALL \
+ pre_PREPARE \
+ post_PREPARE \
+ pre_PRE_REMOVE \
+ post_PRE_REMOVE \
+ pre_PRE_RESURRECT \
+ post_PRE_RESURRECT \
+ pre_SECURITY \
+ post_SECURITY \
+ pre_SUB_DEPENDS \
+ post_SUB_DEPENDS \
+ pre_TRANSFER \
+ post_TRANSFER \
+ pre_TRIGGER_CHECK \
+ post_TRIGGER_CHECK \
+ pre_TRIGGERS \
+ post_TRIGGERS \
+ pre_UP_TRIGGERS \
+ post_UP_TRIGGERS"
+ local i f of
+# [[ -z $hooks_list ]] && return
+ for function_name in $function_list; do
+ of="function sorcery_default_${function_name}_hook () { local
ANTE_RC=\$1; "
+ f="$of"
+ for i in $hooks_list; do
+ # check if the function as is is declared
+ if declare -F ${i}_${function_name}_hook &>/dev/null; then
+ f="$f ${i}_${function_name}_hook;"
+ fi
+ done
+ # check if there was anything done if yes then just close it else
+ # default it to true
+ if [[ $f != $of ]]; then
+ f="$f }"
+ else
+ f="$f true; }"
+ fi
+ eval "$f"
+ done
+ fi
+ hook_marker() { true; };
+ debug "libmisc" "init_hooks - finished initial load"
+}

- case $SOUND in
- on) SOUND_FILE=$SOUND_DIRECTORY/$SOUND_THEME/$1
- if [ -e $SOUND_FILE ]; then
- ( cd / ; play $SOUND_FILE 2>/dev/null & )
- debug "libmisc" "Playing $SOUND_FILE"
- else
- debug "libmisc" "Error playing $SOUND_FILE: no such file"
- fi
- ;;
- esac

+#---------------------------------------------------------------------
+##
+## This function first checks if the spell_file hook should be run
+## and then assembles the parameters into a call to the relevant function
+## @param spell_file
+## @optional_param hook_order pre|post
+##
+#---------------------------------------------------------------------
+function run_hook() {
+ local spell_file="$1"
+ local hook_order="$2"
+ local rc=$3
+ case $spell_file in
+ DETAILS|CONFLICTS|PRE_SUB_DEPENDS|SUB_DEPENDS) return 0 ;;
+
REPORT|cast_start_spell|cast_initialize|cast_final|real_query|real_query_string)
sorcery_default_${spell_file}_hook $rc ;;
+ *) sorcery_default_${hook_order}_${spell_file}_hook $rc ;;
+ esac
}


@@ -599,26 +725,6 @@ function select_list_sub() {
}

#---------------------------------------------------------------------
-## @param title
-##
-## sets the terminal title if TERM=xterm|rxvt or the window title if
-## TERM=screen
-##
-#---------------------------------------------------------------------
-function set_term_title()
-{
- if [[ $SET_TERM_TITLE != on ]]; then return; fi
- case $TERM in
- xterm*|rxvt*) echo -ne "\e]0;$@\007"
- ;;
- screen) echo -ne "\ek$@\e\\"
- ;;
- *) ;;
- esac
-}
-
-
-#---------------------------------------------------------------------
## @param return_var
## @param elements, ...
##
diff --git a/var/lib/sorcery/modules/libresurrect
b/var/lib/sorcery/modules/libresurrect
index f73a657..1062712 100755
--- a/var/lib/sorcery/modules/libresurrect
+++ b/var/lib/sorcery/modules/libresurrect
@@ -325,11 +325,13 @@ function resurrect_spell() { (
function resurrect_sub() {
# 10) if theres a PRE_RESURRECT run it or fail/rollback
if test -x $SCRIPT_DIRECTORY/PRE_RESURRECT ; then
+ run_hook PRE_RESURRECT pre
. $SCRIPT_DIRECTORY/PRE_RESURRECT || {
debug "libresurrect" "PRE_RESURRECT failed"
resurrect_fail 1
return 1
}
+ run_hook PRE_RESURRECT post
fi


@@ -408,11 +410,13 @@ function resurrect_sub() {

# 14) if theres a POST_RESURRECT run it
if test -x $SCRIPT_DIRECTORY/POST_RESURRECT ; then
+ run_hook POST_RESURRECT pre
. $SCRIPT_DIRECTORY/POST_RESURRECT || {
message "POST_RESURRECT failed"
resurrect_fail 1
return 1
}
+ run_hook POST_RESURRECT post
fi
ldconfig # can never be too careful
}
diff --git a/var/lib/sorcery/modules/libsorcery
b/var/lib/sorcery/modules/libsorcery
index f322021..21399be 100755
--- a/var/lib/sorcery/modules/libsorcery
+++ b/var/lib/sorcery/modules/libsorcery
@@ -173,30 +173,22 @@ function set_umask() {
#---------------------------------------------------------------------
## @param filename
##
-## Displays and/or mails the contents of the file given as the first
-## argument.
+## Displays and the contents of the file given as the first argument.
##
#---------------------------------------------------------------------
function report() {

if ! [ -f $1 ]; then return; fi

+ run_hook REPORT
if [ "$VIEW_REPORTS" == "on" ]; then

debug "libsorcery" "Prompting to view $2 for $SPELL"

VIEW_PROMPT="View $2 for
${SPELL_COLOR}${SPELL}-${VERSION_COLOR}${VERSION}${DEFAULT_COLOR}?"
- sound REPORT
if query "$VIEW_PROMPT" n; then $PAGER $1; fi
fi

- if [ "$MAIL_REPORTS" == "on" ]; then
- debug "libsorcery" "Mailing report ($2) for $SPELL to $SORCERER"
- date -u |
- mail -s "Sorcery Report : $HOSTNAME : $2 for $SPELL-$VERSION" \
- -a $1 $SORCERER 2>/dev/null
- fi
-
true

}
diff --git a/var/lib/sorcery/modules/libspell
b/var/lib/sorcery/modules/libspell
index d51eff7..76b0fb3 100755
--- a/var/lib/sorcery/modules/libspell
+++ b/var/lib/sorcery/modules/libspell
@@ -151,6 +151,9 @@ function run_spell_file() {
# this is mostly used for messages like "<spell> checking dependencies"
local pre_function=$3

+ # hook calling moved into here
+ run_hook ${spell_file} pre
+
eval "function real_default_${function_suffix}() {
default_section_${function_suffix}
}"
@@ -179,6 +182,9 @@ function run_spell_file() {
log_failure_reason $function_suffix
fi

+ # hooks moved into here
+ run_hook ${spell_file} post $rc
+
# restore these, so they're always false except when needed
eval "function real_default_${function_suffix}() {
false



  • [SM-Commit] GIT changes to devel-pyrobor2 sorcery by Bor Kraljič (07bf30b46dcec73167cc01d3c5c030fe870b4296), Bor Kraljič, 10/17/2011

Archive powered by MHonArc 2.6.24.

Top of Page