Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master sorcery by Bor Kraljič (d8e2d76cf40f69c191c374a954f1e783fd428f44)

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 master sorcery by Bor Kraljič (d8e2d76cf40f69c191c374a954f1e783fd428f44)
  • Date: Sat, 22 Oct 2011 06:18:49 -0500

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

ChangeLog | 7 +++
var/lib/sorcery/modules/libcodex | 3 +
var/lib/sorcery/modules/libmisc | 73
++++++++-------------------------------
3 files changed, 24 insertions(+), 59 deletions(-)

New commits:
commit d8e2d76cf40f69c191c374a954f1e783fd428f44
Author: Bor Kraljič <pyrobor AT ver.si>
Commit: Bor Kraljič <pyrobor AT ver.si>

libmisc: use brace expansion to shorten the list of functions for hooks,
changed run_hooks to be more generic

commit 4e534a1fa14d6ed023c6012a8d703fdeb336495e
Author: Bor Kraljič <pyrobor AT ver.si>
Commit: Bor Kraljič <pyrobor AT ver.si>

libcodex: wrap long description to the width of the terminal

diff --git a/ChangeLog b/ChangeLog
index 5c0b7e6..40dcedf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-10-22 Bor Kraljič <pyrobor AT ver.si>
+ * libmisc: use brace expansion to shorten the list of functions for
hooks,
+ changed run_hooks to be more generic
+
+2011-10-17 Bor Kraljič <pyrobor AT ver.si>
+ * libcodex: wrap long description to the width of the terminal
+
2011-10-16 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* libressurect: clarified a merge message
* alter, vcast: removed last mentions of cast --fix
diff --git a/var/lib/sorcery/modules/libcodex
b/var/lib/sorcery/modules/libcodex
index b3e9c05..176225a 100755
--- a/var/lib/sorcery/modules/libcodex
+++ b/var/lib/sorcery/modules/libcodex
@@ -1028,7 +1028,8 @@ function codex_find_spell_or_section_by_name() {
##
#---------------------------------------------------------------------
function codex_get_spell_description() {
- codex_is_directory_a_spell "$1" && . "$1/DETAILS"
+ local width=$(stty size | cut -d' ' -f2)
+ codex_is_directory_a_spell "$1" && . "$1/DETAILS" | fmt -w $width -s
}

#---------------------------------------------------------------------
diff --git a/var/lib/sorcery/modules/libmisc b/var/lib/sorcery/modules/libmisc
index 80172a7..4960726 100755
--- a/var/lib/sorcery/modules/libmisc
+++ b/var/lib/sorcery/modules/libmisc
@@ -371,62 +371,15 @@ function init_hooks() {
fi
done
local function_name function_list
- function_list="cast_initialize \
- cast_start_spell \
- cast_final \
- real_query \
- real_query_string \
+ function_list=$(echo cast_{initialize,start_spell,final} \
+ 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"
+ {pre_,post_}{dispel,SUCCESS,FAILURE,BUILD,config_loc} \
+ {pre_,post_}{CONFIGURE,DEPENDS,DOWNLOAD,FINAL,INSTALL} \
+ {pre_,post_}{INSTALL_EXTRAS,POST_INSTALL,POST_REMOVE} \
+
{pre_,post_}{POST_RESURRECT,PRE_BUILD,PRE_INSTALL,PREPARE} \
+ {pre_,post_}{PRE_REMOVE,PRE_RESURRECT,SECURITY,TRANSFER} \
+ {pre_,post_}{TRIGGER_CHECK,TRIGGERS,UP_TRIGGERS})
local i f of
# [[ -z $hooks_list ]] && return
for function_name in $function_list; do
@@ -466,9 +419,13 @@ function run_hook() {
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 ;;
+ DETAILS|CONFLICTS|PRE_SUB_DEPENDS|SUB_DEPENDS) return 0 ;;
+ *)
+ if [[ $hook_order ]]; then
+ sorcery_default_${hook_order}_${spell_file}_hook $rc
+ else
+ sorcery_default_${spell_file}_hook $rc
+ fi ;;
esac
}




  • [SM-Commit] GIT changes to master sorcery by Bor Kraljič (d8e2d76cf40f69c191c374a954f1e783fd428f44), Bor Kraljič, 10/22/2011

Archive powered by MHonArc 2.6.24.

Top of Page