Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master sorcery by Paul Mahon (2efaed3a62852e43099c26b6a1cf6df7cd9d6f65)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Paul Mahon <scm AT mail.sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master sorcery by Paul Mahon (2efaed3a62852e43099c26b6a1cf6df7cd9d6f65)
  • Date: Sat, 13 Jan 2007 14:02:38 -0600

GIT changes to master sorcery by Paul Mahon <dufflebunk AT gmail.com>:

ChangeLog | 8 +
etc/sorcery/config | 6 +
usr/sbin/cast | 38 +++----
usr/sbin/delve | 26 ++---
usr/sbin/dispel | 34 +++---
usr/sbin/gaze | 2
usr/sbin/scribe | 2
usr/sbin/sorcery | 64 +++++++++++-
var/lib/sorcery/modules/build_api/api1 | 16 +--
var/lib/sorcery/modules/build_api/api2 | 28 ++---
var/lib/sorcery/modules/build_api/common | 16 +--
var/lib/sorcery/modules/dl_handlers/dl_tla | 2
var/lib/sorcery/modules/dl_handlers/dl_wget | 6 -
var/lib/sorcery/modules/libapi | 139
++++++++++++++--------------
var/lib/sorcery/modules/libcast | 12 +-
var/lib/sorcery/modules/libcodex | 24 ++--
var/lib/sorcery/modules/libcrossinstall | 10 +-
var/lib/sorcery/modules/libdepends | 55 +++++------
var/lib/sorcery/modules/libdepengine | 16 +--
var/lib/sorcery/modules/libdispel | 10 +-
var/lib/sorcery/modules/libdownload | 7 -
var/lib/sorcery/modules/libgrimoire | 15 +--
var/lib/sorcery/modules/libhash | 6 -
var/lib/sorcery/modules/liblock | 22 ++--
var/lib/sorcery/modules/libmisc | 66 +++----------
var/lib/sorcery/modules/libresurrect | 26 ++---
var/lib/sorcery/modules/libscreen | 30 +++---
var/lib/sorcery/modules/libsorcery | 38 +++----
var/lib/sorcery/modules/libstate | 26 ++---
var/lib/sorcery/modules/libsummon | 4
var/lib/sorcery/modules/libtablet | 2
var/lib/sorcery/modules/libtrack | 16 +--
var/lib/sorcery/modules/libtriggers | 8 -
var/lib/sorcery/modules/libunpack | 50 +++++-----
var/lib/sorcery/modules/liburl | 22 ++--
35 files changed, 441 insertions(+), 411 deletions(-)

New commits:
commit 2efaed3a62852e43099c26b6a1cf6df7cd9d6f65
Author: Paul Mahon <dufflebunk AT gmail.com>
Commit: Paul Mahon <dufflebunk AT gmail.com>

commit 8577a7b7450f09751d031e67f65707a940f25215
Author: Paul Mahon <dufflebunk AT gmail.com>
Commit: Paul Mahon <dufflebunk AT gmail.com>

Changefile update

commit 268d21604ebc553facf1f79cf5a4f9795665050e
Author: Paul Mahon <dufflebunk AT gmail.com>
Commit: Paul Mahon <dufflebunk AT gmail.com>

Add default config for new debugging, make new debugging work

commit df77dda764e295ccd38a4cf0d838d44786c467d9
Author: Paul Mahon <dufflebunk AT gmail.com>
Commit: Paul Mahon <dufflebunk AT gmail.com>

Removed the remaining debug() calls, added initial debug output filter
options to the sorcery menues

commit 30f696b724cab1b614d5d2890f57413de3f99ddd
Author: Paul Mahon <dufflebunk AT gmail.com>
Commit: Paul Mahon <dufflebunk AT gmail.com>

Most scripts chagned to use new debugging

commit 8a9c7dfa7926b38cc4ec21058d72afe9bc5644a5
Author: Paul Mahon <dufflebunk AT gmail.com>
Commit: Paul Mahon <dufflebunk AT gmail.com>

diff --git a/ChangeLog b/ChangeLog
index 8ef72c9..0fcbd68 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-01-13 Paul Mahon <pmahon AT sourcemage.org>
+ * libdebug: creation of module for handlind debugging stuff, bug 9379
+ * modules, scripts: change all calls to debug() to use $STD_DEBUG*
+ * sorcery: add configuration menus for new debugging features, bug
9514
+
+2007-01-07 Paul Mahon <pmahon AT sourcemage.org>
+ * sorcery: Fix spelling, bug 13170
+
2007-01-01 David Brown <dmlb2000 AT gmail.com>
* delve: empty install root since that's handled by transfer stage
* libstage: forgot a prepended INSTALL_ROOT on directory
diff --git a/etc/sorcery/config b/etc/sorcery/config
index 71faa4b..88eac7c 100755
--- a/etc/sorcery/config
+++ b/etc/sorcery/config
@@ -57,7 +57,8 @@ FORCE_BASESYSTEM_DEPENDS=${FORCE_BASESYS
FILEPROG=${FILEPROG:=file}
DIALOGPROG=${DIALOGPROG:=dialog}

- DEBUG=${DEBUG:=/dev/null}
+ SORCERY_DEBUG=${SORCERY_DEBUG:=/dev/null}
+ SORCERY_DEBUG_FILTER=${SORCERY_DEBUG_FILTER:=libhash libapi liblock}

CROSS_INSTALL=${CROSS_INSTALL:=off}

@@ -186,6 +187,9 @@ CASTFS_DEBUG_LEVEL=255
# this makes appending the sorcery path idempotent
[ -z ${PATH##*$SORCERY_PATH*} ] || export PATH="$PATH:$SORCERY_PATH"

+# initialize the debugging variables
+init_debugging
+
optimize
umask $UMASK >/dev/null
# this fixes breakage with multiply nested triggers, if/when we dont use
diff --git a/usr/sbin/cast b/usr/sbin/cast
index 37f97be..cd35621 100755
--- a/usr/sbin/cast
+++ b/usr/sbin/cast
@@ -209,7 +209,7 @@ function get_option() {
#---------------------------------------------------------------------
function cast_spell() { (

- debug "cast" "Casting spell [$SPELL]"
+ $STD_SORCERY_DEBUG "Casting spell [$SPELL]"
set_term_title "Casting spell [$SPELL]"

run_details
@@ -307,7 +307,7 @@ function cast_spell() { (
#---------------------------------------------------------------------
function pass_one() {
# This pass does configuration and dependency identification.
- debug "cast" "Starting pass_one()"
+ $STD_SORCERY_DEBUG_HEAD

echo -n "Computing previously installed dependencies..."
compute_installed_depends "dep_f_hash"
@@ -379,7 +379,7 @@ function pass_one() {
hash_put dep_f_hash $i "$(hash_get to_cast $i)"
done

- debug "cast" "pass_one, done with SPELLS=$SPELLS"
+ $STD_SORCERY_DEBUG "pass_one, done with SPELLS=$SPELLS"

}

@@ -398,7 +398,7 @@ function pass_one() {
function pass_two() {
# This pass downloads required sources.
# And starts the make process
- debug "cast" "Starting pass_two()"
+ $STD_SORCERY_DEBUG_HEAD

unset_details

@@ -436,7 +436,7 @@ function pass_two() {
) &
fi

- debug "cast" "Starting stage four make."
+ $STD_SORCERY_DEBUG "Starting stage four make."

(
CAST_PASS="four"
@@ -485,7 +485,7 @@ function pass_two() {
## If in screen mode it also execs a tail to the summon window
#---------------------------------------------------------------------
function pass_three() {
- debug "cast" "pass_three - $*"
+ $STD_SORCERY_DEBUG_HEAD
unset CAST_PASS
trap exit INT TERM
local SPELL=$1
@@ -555,7 +555,7 @@ function pass_three() {
#---------------------------------------------------------------------
function pass_four() {

- debug "cast" "pass_four - $*"
+ $STD_SORCERY_DEBUG_HEAD
local do_resurrect=no
local VERSION
unset CAST_PASS
@@ -603,7 +603,7 @@ function pass_four() {
#---------------------------------------------------------------------
function pass_five() {

- debug "cast" "Function : pass_five"
+ $STD_SORCERY_DEBUG_HEAD

# must exist or we get problems with checks here.
touch $SUCCESS_LIST
@@ -612,9 +612,9 @@ function pass_five() {
touch $CHECK_TRIGGERS_FAILURE
touch $CONFLICT_LIST

- debug "pass_five" "SUCCESS LIST is : `cat $SUCCESS_LIST 2>/dev/null`"
- debug "pass_five" "FAILED LIST is : `cat $FAILED_LIST 2>/dev/null`"
- debug "pass_five" "CONFLICT LIST is : `cat $CONFLICT_LIST 2>/dev/null`"
+ $STD_SORCERY_DEBUG "SUCCESS LIST is : `cat $SUCCESS_LIST 2>/dev/null`"
+ $STD_SORCERY_DEBUG "FAILED LIST is : `cat $FAILED_LIST 2>/dev/null`"
+ $STD_SORCERY_DEBUG "CONFLICT LIST is : `cat $CONFLICT_LIST 2>/dev/null`"

if [ -s $SUCCESS_LIST ] ; then

@@ -708,7 +708,7 @@ function pass_five() {
return 1
fi
fi
- debug "cast" "End of pass_five"
+ $STD_SORCERY_DEBUG "End of pass_five"

}

@@ -720,13 +720,11 @@ function pass_five() {
#---------------------------------------------------------------------
function pass_zero() {

- debug "cast" "Starting pass_zero()"
- debug "pass_zero" "Starting passes 1,2,3,4 with : '$*'"
- debug "pass_zero" " and with spells : '$SPELLS'"
+ $STD_SORCERY_DEBUG_HEAD
+ $STD_SORCERY_DEBUG "SPELLS = $SPELLS"
export CAST_PASS="one"; pass_one $* &&
export CAST_PASS="two"; pass_two $SPELLS
#pass_three and _four are run via pass_two
- debug "pass_zero" "Starting pass 5 with: '$@'"
export CAST_PASS="five"; pass_five "$@"


@@ -768,7 +766,7 @@ function cast_cleanup() {
## according to CAST_PASS
#---------------------------------------------------------------------
function main() {
- debug "cast" "main() - $*"
+ $STD_SORCERY_DEBUG_HEAD
local T_SPELLS
process_parameters "$@"
SPELLS=`strip_parameters "$@"`
@@ -881,7 +879,7 @@ else
[[ $SCREEN == on ]]
then
export SCREEN=$SCREEN_OVERRIDE
- debug "cast" "Turning $SCREEN_OVERRIDE screen mode"
+ $STD_SORCERY_DEBUG "Turning $SCREEN_OVERRIDE screen mode"
fi

# If screen mode is on, but we aren't in screen, start a new session
@@ -903,7 +901,7 @@ else
[[ $SCREEN_NAME ]] &&
[[ ! $SCREEN_INITIALIZED ]]
then
- debug "cast" "Initializing screen windows"
+ $STD_SORCERY_DEBUG "Initializing screen windows"
screen_name_window "$SCREEN_NAME" $SCREEN_MAIN_WIN "Main"

# Start debugging window if debugging is on and not set to /dev*
@@ -938,7 +936,7 @@ else
exit $rc
fi

-debug "cast" "exiting..."
+$STD_SORCERY_DEBUG "exiting..."

#---------------------------------------------------------------------
##=back
diff --git a/usr/sbin/delve b/usr/sbin/delve
index c459a64..5848df7 100755
--- a/usr/sbin/delve
+++ b/usr/sbin/delve
@@ -126,19 +126,19 @@ function delve_is_valid_step() {
}

function delve_pre_build() {
- debug "delve" "Running $FUNCNAME"
+ $STD_SORCERY_DEBUG_HEAD
delve_is_valid_step PRE_BUILD 1 2 || return 1
run_pre_build
}

function delve_config_loc() {
- debug "delve" "Running $FUNCNAME"
+ $STD_SORCERY_DEBUG_HEAD
delve_is_valid_step config_loc 1 2 || return 1
run_config_loc
}

function delve_build() {
- debug "delve" "Running $FUNCNAME"
+ $STD_SORCERY_DEBUG_HEAD
delve_is_valid_step BUILD 1 2 || return 1
delve_log_helper
(
@@ -148,7 +148,7 @@ function delve_build() {
}

function delve_pre_install() {
- debug "delve" "Running $FUNCNAME"
+ $STD_SORCERY_DEBUG_HEAD
delve_is_valid_step PRE_INSTALL 2 || return 1
delve_log_helper
(
@@ -158,7 +158,7 @@ function delve_pre_install() {
}

function delve_install() {
- debug "delve" "Running $FUNCNAME"
+ $STD_SORCERY_DEBUG_HEAD

delve_is_valid_step INSTALL 2 || return 1
delve_log_helper
@@ -193,7 +193,7 @@ function delve_install() {
}

function delve_install_extras() {
- debug "delve" "Running $FUNCNAME"
+ $STD_SORCERY_DEBUG_HEAD

delve_is_valid_step INSTALL_EXTRAS 2 || return 1
delve_log_helper
@@ -227,7 +227,7 @@ function delve_install_extras() {
}

function delve_post_build() {
- debug "delve" "Running $FUNCNAME"
+ $STD_SORCERY_DEBUG_HEAD

delve_is_valid_step POST_BUILD 1 || return 1
delve_log_helper
@@ -243,7 +243,7 @@ function delve_post_build() {
}

function delve_post_install() {
- debug "delve" "Running $FUNCNAME"
+ $STD_SORCERY_DEBUG_HEAD
delve_is_valid_step POST_INSTALL 1 2 || return 1
delve_log_helper
(
@@ -253,7 +253,7 @@ function delve_post_install() {
}

function delve_transfer() {
- debug "delve" "Running $FUNCNAME"
+ $STD_SORCERY_DEBUG_HEAD
delve_is_valid_step TRANSFER 2 || return 1
delve_log_helper
(
@@ -263,7 +263,7 @@ function delve_transfer() {
}

function delve_final() {
- debug "delve" "Running $FUNCNAME"
+ $STD_SORCERY_DEBUG_HEAD
delve_is_valid_step FINAL 2 || return 1
delve_log_helper
devoke_installwatch &&
@@ -276,13 +276,13 @@ function delve_final() {
}

function delve_triggers() {
- debug "delve" "Running $FUNCNAME"
+ $STD_SORCERY_DEBUG_HEAD
delve_is_valid_step TRIGGERS 1 2 || return 1
run_triggers
}

function delve_spell_success() {
- debug "delve" "Running $FUNCNAME"
+ $STD_SORCERY_DEBUG_HEAD
SUCCESS_LIST=/dev/null
cd /
delve_log_helper
@@ -290,7 +290,7 @@ function delve_spell_success() {
}

function delve_spell_failure() {
- debug "delve" "Running $FUNCNAME"
+ $STD_SORCERY_DEBUG_HEAD
FAILED_LIST=/dev/null
delve_log_helper
run_spell_failure 2
diff --git a/usr/sbin/dispel b/usr/sbin/dispel
index 860f8fc..c1ccafa 100755
--- a/usr/sbin/dispel
+++ b/usr/sbin/dispel
@@ -313,13 +313,13 @@ function dispel_children() {
# this assumes list_add remains idempotent, which it is
list_add our_children $(hash_get down_deps $spell)
done
- debug "children of $1 -> $our_children"
+ $STD_SORCERY_DEBUG "children of $1 -> $our_children"

local is_orphan
local orphan_list non_orphan_list
for child in $our_children; do
if [[ $(hash_get ALL_DISPELS $child) == "yes" ]] ; then
- debug "someone depends on $child but it was already removed"
+ $STD_SORCERY_DEBUG "someone depends on $child but it was already
removed"
continue
fi
# determine if this child is becomming an orphan or not
@@ -339,9 +339,9 @@ function dispel_children() {

local removed_children
for child in $orphan_list; do
- debug dispel "looking at $child:"
- debug dispel "parents: $(hash_get up_deps $child)"
- debug "children: $(hash_get down_deps $child)"
+ $STD_SORCERY_DEBUG "looking at $child:"
+ $STD_SORCERY_DEBUG "parents: $(hash_get up_deps $child)"
+ $STD_SORCERY_DEBUG "children: $(hash_get down_deps $child)"
if dispel_child_query "$child" "is an orphan" \
"Would you like to dispel it" \
"${ORPHAN_DEFAULT}" ; then
@@ -350,9 +350,9 @@ function dispel_children() {
fi
done
for child in $non_orphan_list; do
- debug "looking at $child:"
- debug "parents: $(hash_get up_deps $child)"
- debug "children: $(hash_get down_deps $child)"
+ $STD_SORCERY_DEBUG "looking at $child:"
+ $STD_SORCERY_DEBUG "parents: $(hash_get up_deps $child)"
+ $STD_SORCERY_DEBUG "children: $(hash_get down_deps $child)"
if dispel_child_query "$child" "is not an orphan" \
"Would you like to dispel it" \
"${NONORPHAN_DEFAULT}" ; then
@@ -436,7 +436,7 @@ function dispel_parent_query() {
## remove spell from the downward tree
#---------------------------------------------------------------------
function remove_from_dep_trees() {
- debug dispel "$FUNCNAME $@"
+ $STD_SORCERY_DEBUG_HEAD
local spell=$1
local down_dep_hash=$2
local up_dep_hash=$3
@@ -466,7 +466,7 @@ function get_borked_parents() {
local parent
# get the spells that depend on us
for parent in $(hash_get $up_dep_hash $spell); do
- debug dispel "hash_append $3 $parent $spell"
+ $STD_SORCERY_DEBUG "hash_append $3 $parent $spell"
hash_append $3 $parent $spell
done
}
@@ -501,9 +501,9 @@ function dispel_depends_engine() {
while [[ $new_children ]] ; do
curr_children=$new_children
unset new_children
- debug dispel "in with $curr_children"
+ $STD_SORCERY_DEBUG "in with $curr_children"
dispel_children "$curr_children" new_children
- debug dispel "out with $new_children"
+ $STD_SORCERY_DEBUG "out with $new_children"
list_add CURR_SPELLS $new_children
for SPELL in $curr_children; do
remove_from_dep_trees $SPELL down_deps up_deps
@@ -606,12 +606,12 @@ function dispel_depends_engine() {
fi
done
if [[ $NEW_CASTS ]] ; then
- debug dispel "cast -c $NEW_CASTS"
+ $STD_SORCERY_DEBUG "cast -c $NEW_CASTS"
cast -c $NEW_CASTS
fi
fi
- debug dispel "NEW_DISPELS: $NEW_DISPELS"
- debug dispel "eval $2=\"$NEW_DISPELS\""
+ $STD_SORCERY_DEBUG "NEW_DISPELS: $NEW_DISPELS"
+ $STD_SORCERY_DEBUG "eval $2=\"$NEW_DISPELS\""
eval "$2=\"$NEW_DISPELS\""

return ${DISPEL_EXIT_STATUS:-0}
@@ -639,11 +639,11 @@ function main() {
fi
if [[ $DO_DEPENDS ]] ; then
while [[ $SPELLS ]] ; do
- debug dispel "recomputing depends tree"
+ $STD_SORCERY_DEBUG "recomputing depends tree"
compute_installed_depends down_deps all
compute_reverse_installed_depends up_deps all
dispel_depends_engine "$SPELLS" SPELLS
- debug dispel "SPELLS $SPELLS"
+ $STD_SORCERY_DEBUG "SPELLS $SPELLS"
done
else
for SPELL in $SPELLS; do
diff --git a/usr/sbin/gaze b/usr/sbin/gaze
index fa91f42..5c722b2 100755
--- a/usr/sbin/gaze
+++ b/usr/sbin/gaze
@@ -821,7 +821,7 @@ function any_voyeur()
local FILE=`find /tmp/liblock-0 -maxdepth 1 -mindepth 1 -name "cast.*" |
sed "s/.*\/cast\.//" | head -n 1`
[ $FILE ] || return 1
- debug "voyeur" "Looking at spell \"$FILE\""
+ $STD_SORCERY_DEBUG "Looking at spell \"$FILE\""
nice -n +20 \
tail $(find /tmp/sorcery/cast/ -name $FILE.compile.log )\
--follow=name --pid=$(ls "/tmp/liblock-0/cast.$FILE") 2>/dev/null
diff --git a/usr/sbin/scribe b/usr/sbin/scribe
index 047d63a..30f3069 100755
--- a/usr/sbin/scribe
+++ b/usr/sbin/scribe
@@ -451,7 +451,7 @@ function scribe_reindex() {
fi
paths="$paths $grimoire"
done
- debug "scribe" "reindex: paths = \"$paths\""
+ $STD_SORCERY_DEBUG "reindex: paths = \"$paths\""

message -n "Reindexing spell list... "
codex_create_cache $paths
diff --git a/usr/sbin/sorcery b/usr/sbin/sorcery
index 767b12b..f3d3aa4 100755
--- a/usr/sbin/sorcery
+++ b/usr/sbin/sorcery
@@ -723,7 +723,7 @@ optimize_architecture() {

architecture_menu() {

- debug "sorcery" "architecture_menu()"
+ $STD_SORCERY_DEBUG_HEAD
local SPECFILE
local LIST CPUNAME specname
local specname CPUNAME
@@ -744,12 +744,12 @@ architecture_menu() {
for specname in $(hash_get_table_fields archspec_hash|sort); do
CPUNAME=""
SPECFILE=$(hash_get archspec_hash $specname) &&
- debug "sorcery" "architecture_menu() - $specname found at $SPECFILE"
+ $STD_SORCERY_DEBUG "$specname found at $SPECFILE"
CPUNAME=$( . $SPECFILE && echo $CPUNAME ) &&
LIST="$LIST $specname \"$CPUNAME\" \"$CPUNAME\""
done
hash_reset archspec_hash
- debug "sorcery" "architecture_menu() - Dialog options are $LIST"
+ $STD_SORCERY_DEBUG "Dialog options are $LIST"

local ARCH_TITLE="$2"
local ARCH_HELP="Please select a microprocessor category"
@@ -776,7 +776,7 @@ architecture_menu() {
# remove spurious ""
NEW_ARCH=`echo "${NEW_ARCH}" | sed -e 's/^"//' -e 's/"$//'`

- debug "sorcery" "architecture_menu() - NEW_ARCH='$NEW_ARCH'"
+ $STD_SORCERY_DEBUG "NEW_ARCH='$NEW_ARCH'"

modify_local_config "$1" "${NEW_ARCH}"
fi
@@ -816,7 +816,7 @@ optimization_menu(){
then

OPTIMIZATIONS=`echo ${OPTIMIZATIONS} | tr '\n' ' '`
- debug "sorcery" "optimization_menu() - OPTIMIZATIONS='${OPTIMIZATIONS}'"
+ $STD_SORCERY_DEBUG "OPTIMIZATIONS='${OPTIMIZATIONS}'"

modify_local_config "OPTIMIZATIONS" "$OPTIMIZATIONS"

@@ -1481,6 +1481,7 @@ sorcery_devel_settings() {

local D_HELP="Set the debugging file for normal debugging."
local S_HELP="Turn on Super Debug. You probably don't want to do this."
+ local F_HELP="Selectivly disable output of debugging messages."

while

@@ -1493,6 +1494,7 @@ sorcery_devel_settings() {
"" \
0 0 0 \
"D" "Debug file" "$D_HELP" \
+ "F" "Filter messages" "$F_HELP" \
"S" "Super debugging toggle" "$S_HELP"'`
do

@@ -1500,7 +1502,8 @@ sorcery_devel_settings() {

D) TEXT="Note: if you turn this on, don't forget to empty the log file
occasionaly.\nWhat file do you want the debugging logged to?"
FILE=`eval $DIALOG --ok-label "Commit" --inputbox \"$TEXT\" 0 0
\"$DEBUG\"` &&
- modify_local_config "DEBUG" "$FILE" ;;
+ modify_local_config "SORCERY_DEBUG" "$FILE" ;;
+ F) sorcery_debug_filter ;;
S) TEXT="Note: You don't want to do this probably. Don't forget to
2>/root/debug.out.\nDo you want super debugging on?"
TOGGLE=`eval $DIALOG --yesno \"$TEXT\" 0 0` &&
( modify_local_config "SUPER_DEBUG" "on" ; modify_local_config "set"
"-x" "command" ) ||
@@ -1512,6 +1515,55 @@ sorcery_devel_settings() {

}

+sorcery_debug_filter() {
+set -x
+ local i
+ local CHECKLIST=`make_debug_checklist`
+
+ local DEVEL_TITLE="Select common debug topics to filter"
+ local DEVEL_HELP="[ ]=displayed [X]=surpressed"
+
+ if OUTLIST=`eval $DIALOG ' --title "$DEVEL_TITLE" \
+ --ok-label "Commit" \
+ --separate-output \
+ --checklist \
+ "$DEVEL_HELP" \
+ 0 0 0 \
+ '$CHECKLIST`
+ then
+ # The space on the end is there on purpose, so an empty list won't give
an
+ # empty string, so default values will not be used
+ modify_local_config "SORCERY_DEBUG_FILTER" "$OUTLIST "
+ fi
+set +x
+}
+
+make_debug_checklist() {
+ local VAR
+ array=()
+
+ find $SGL_LIBRARY_MODULES -type f -name 'lib*' -printf %f\\n | sort |
+ while read LINE ; do
+ VAR=SORCERY_DEBUG_${LINE}
+ echo -en "\"${LINE}\""
+ echo -en "\t\"${LINE}\""
+ if [[ ${!VAR} == "n" ]] ; then
+ echo -e "\t\"on\""
+ else
+ echo -e "\t\"off\""
+ fi
+ done
+
+ # There's an extra special variable for turning on and off
+ # function entry messages at once
+ echo -en "\"ENTRY\"\t\"Function Entry\"\t"
+ if [[ $SORCERY_ENTRY_DEBUG == "n" ]] ; then
+ echo -e "\t\"on\""
+ else
+ echo -e "\t\"off\""
+ fi
+
+}

feature_menu() {

diff --git a/var/lib/sorcery/modules/build_api/api1
b/var/lib/sorcery/modules/build_api/api1
index f345d4b..eabfb5d 100755
--- a/var/lib/sorcery/modules/build_api/api1
+++ b/var/lib/sorcery/modules/build_api/api1
@@ -23,7 +23,7 @@
## a spell for BUILD_API 1.
#---------------------------------------------------------------------
function run_build_spell() {
- debug "build_api/api1" "run_build_spell"
+ $STD_SORCERY_DEBUG_HEAD
C_LOG=$TMP_DIR/$SPELL.compile.log
C_FIFO=/dev/stdout
STAGED_INSTALL=off
@@ -82,7 +82,7 @@ function run_build_spell() {
#---------------------------------------------------------------------
function run_pre_build() {

- debug "build_api/api1" "run_pre_build()"
+ $STD_SORCERY_DEBUG_HEAD
message "${MESSAGE_COLOR}Building" \
"${SPELL_COLOR}${SPELL}" \
"${DEFAULT_COLOR}"
@@ -102,7 +102,7 @@ function run_pre_build() {
#---------------------------------------------------------------------
function run_build() {

- debug "build_api/api1" "Starting run_build()"
+ $STD_SORCERY_DEBUG_HEAD

echo "Compile log for $SPELL $VERSION Built on `date -u`" > $C_LOG
echo "Using gcc version: `gcc -dumpversion`" >> $C_LOG
@@ -144,7 +144,7 @@ function run_build() {
#---------------------------------------------------------------------
function run_post_build() {

- debug "build_api/api1" "Starting run_post_build()"
+ $STD_SORCERY_DEBUG_HEAD
run_spell_file POST_BUILD post_build

# Lock made in prepare_install
@@ -160,7 +160,7 @@ function run_post_build() {
#---------------------------------------------------------------------
function run_post_install() {

- debug "build_api/api1" "Starting run_post_install()"
+ $STD_SORCERY_DEBUG_HEAD
run_spell_file INSTALL install
}

@@ -172,7 +172,7 @@ function run_post_install() {
#---------------------------------------------------------------------
function real_default_sorcery_pre_build() {

- debug "build_api/api1" "Starting real_default_sorcery_pre_build() -
SOURCE=$SOURCE SOURCE_DIRECTORY=$SOURCE_DIRECTORY"
+ $STD_SORCERY_DEBUG SOURCE=$SOURCE SOURCE_DIRECTORY=$SOURCE_DIRECTORY"
mk_source_dir $SOURCE_DIRECTORY &&
unpack_file

@@ -199,7 +199,7 @@ function real_default_sorcery_pre_build(
#---------------------------------------------------------------------
function real_default_sorcery_build() {

- debug "build_api/api1" "Starting real_default_sorcery_build()"
+ $STD_SORCERY_DEBUG_HEAD
OPTS="$OPTS --build=${BUILD}"
#If this switches are used, they _may_ stop distcc and ccache from working
# for some spells (bug 3798)
@@ -228,7 +228,7 @@ function real_default_sorcery_build() {
#---------------------------------------------------------------------
function real_default_sorcery_post_build() {

- debug "build_api/api1" "Starting real_default_sorcery_post_build()"
+ $STD_SORCERY_DEBUG_HEAD

install_xinetd
install_initd
diff --git a/var/lib/sorcery/modules/build_api/api2
b/var/lib/sorcery/modules/build_api/api2
index 831a025..6807352 100755
--- a/var/lib/sorcery/modules/build_api/api2
+++ b/var/lib/sorcery/modules/build_api/api2
@@ -24,7 +24,7 @@
## a spell for BUILD_API 2.
#---------------------------------------------------------------------
function run_build_spell() {
- debug "build_api/api2" "run_build_spell"
+ $STD_SORCERY_DEBUG_HEAD

local CHROOT_CHECK=""

@@ -112,7 +112,7 @@ function run_build_spell() {
#---------------------------------------------------------------------
function run_pre_build() {

- debug "build_api/api2" "run_pre_build()"
+ $STD_SORCERY_DEBUG_HEAD
message "${MESSAGE_COLOR}Building" \
"${SPELL_COLOR}${SPELL}" \
"${DEFAULT_COLOR}"
@@ -133,7 +133,7 @@ function run_pre_build() {
#---------------------------------------------------------------------
function run_build() {

- debug "build_api/api2" "Starting run_compile()"
+ $STD_SORCERY_DEBUG_HEAD

echo "Compile log for $SPELL $VERSION Built on `date -u`" > $C_LOG
echo "Using gcc version: `gcc -dumpversion`" >> $C_LOG
@@ -169,7 +169,7 @@ function run_build() {
## run_build finished, then runs PRE_INSTALL or default_pre_install
#---------------------------------------------------------------------
function run_pre_install() {
- debug "build_api/api2" "Starting run_pre_install()"
+ $STD_SORCERY_DEBUG_HEAD

if [ -f $S_PWD ] ; then
cd "`cat $S_PWD`"
@@ -193,7 +193,7 @@ function run_pre_install() {
## stage root properly
#---------------------------------------------------------------------
function run_install() {
- debug "build_api/api2" "Starting run_install()"
+ $STD_SORCERY_DEBUG_HEAD
if [ -f $S_PWD ] ; then
cd "`cat $S_PWD`"
elif [ -d $SOURCE_DIRECTORY ] ; then
@@ -214,7 +214,7 @@ function run_install() {

function run_install_extras() {

- debug "build_api/api2" "Starting run_install_extras()"
+ $STD_SORCERY_DEBUG_HEAD
run_spell_file INSTALL_EXTRAS install_extras
}

@@ -228,7 +228,7 @@ function run_install_extras() {
## stage root properly
#---------------------------------------------------------------------
function run_post_install() {
- debug "build_api/api2" "Starting run_post_install()"
+ $STD_SORCERY_DEBUG_HEAD
persistent_load &&
if [[ $STAGED_INSTALL != off ]]
then
@@ -258,7 +258,7 @@ function run_transfer() {
#---------------------------------------------------------------------
function run_final() {

- debug "build_api/api2" "Starting run_final()"
+ $STD_SORCERY_DEBUG_HEAD
run_spell_file FINAL final
}

@@ -270,7 +270,7 @@ function run_final() {
#---------------------------------------------------------------------
function real_default_sorcery_pre_build() {

- debug "libgrimoire" "default_pre_build() - SOURCE=$SOURCE
SOURCE_DIRECTORY=$SOURCE_DIRECTORY"
+ $STD_SORCERY_DEBUG "SOURCE=$SOURCE SOURCE_DIRECTORY=$SOURCE_DIRECTORY"
mk_source_dir $SOURCE_DIRECTORY &&
unpack_file

@@ -292,7 +292,7 @@ function real_default_sorcery_pre_build(
##
#---------------------------------------------------------------------
function real_default_sorcery_build() {
- debug "build_api/api2" "real_default_sorcery_build"
+ $STD_SORCERY_DEBUG_HEAD

OPTS="$OPTS --build=${BUILD}"
#If these switches are used, they _may_ stop distcc and ccache from working
@@ -320,7 +320,7 @@ function real_default_sorcery_build() {
##
#---------------------------------------------------------------------
function real_default_sorcery_pre_install() {
- debug "build_api/api2" "Starting real_default_sorcery_pre_install"
+ $STD_SORCERY_DEBUG_HEAD
prepare_install
}

@@ -334,7 +334,7 @@ function real_default_sorcery_pre_instal
##
#---------------------------------------------------------------------
function real_default_sorcery_install() {
- debug "build_api/api2" "Starting real_default_sorcery_install"
+ $STD_SORCERY_DEBUG_HEAD
make install
}

@@ -348,7 +348,7 @@ function real_default_sorcery_install()
#---------------------------------------------------------------------
function real_default_sorcery_install_extras() {

- debug "build_api/api2" "Starting real_default_sorcery_post_install"
+ $STD_SORCERY_DEBUG_HEAD
install_xinetd
install_initd
install_pam_confs
@@ -363,7 +363,7 @@ function real_default_sorcery_install_ex

function real_default_sorcery_transfer() {

- debug "build_api/api2" "Starting real_default_sorcery_post_install"
+ $STD_SORCERY_DEBUG_HEAD
transfer_staged_spell
}

diff --git a/var/lib/sorcery/modules/build_api/common
b/var/lib/sorcery/modules/build_api/common
index 5086c03..c521018 100755
--- a/var/lib/sorcery/modules/build_api/common
+++ b/var/lib/sorcery/modules/build_api/common
@@ -24,7 +24,7 @@
# checks for a security file
# returns 0 if spell should be cast, 1 otherwise
function run_security() {
- debug "build_api/common" "Starting run_security() on $SPELL"
+ $STD_SORCERY_DEBUG "SPELL = $SPELL"
if [ -f $SCRIPT_DIRECTORY/SECURITY ]; then
echo -e "${SPELL_COLOR}${SPELL}:${DEFAULT_COLOR}"
tee -a $SECURITY_LOG < $SCRIPT_DIRECTORY/SECURITY
@@ -49,7 +49,7 @@ function run_security() {
## asks the user if they want to edit the custom options
#---------------------------------------------------------------------
function run_config_loc () {
- debug "build_api/common" "Starting run_config_loc() on $SPELL"
+ $STD_SORCERY_DEBUG "SPELL = $SPELL"
pushd . > /dev/null # may have been somewhere else
[ -d "$SOURCE_DIRECTORY" ] &&
cd $SOURCE_DIRECTORY # we need to be in here for this function to
work
@@ -113,7 +113,7 @@ function run_config_loc () {
#---------------------------------------------------------------------
function real_prepare_install() { (

- debug "libgrimoire" "Running prepare_install() on $SPELL"
+ $STD_SORCERY_DEBUG "SPELL = $SPELL"

message "${MESSAGE_COLOR}Preparing to install" \
"${SPELL_COLOR}${SPELL}${DEFAULT_COLOR}"
@@ -168,7 +168,7 @@ function real_gather_docs() { (

if [ "$GATHER_DOCS" == "on" ]; then

- debug "libgrimoire" "Running gather_docs() on $SPELL DOCS=$DOCS"
+ $STD_SORCERY_DEBUG "SPELL = $SPELL" "DOCS=$DOCS"

DEST_DIR=$DOCUMENT_DIRECTORY/$SPELL
mkdir -p $DEST_DIR
@@ -203,7 +203,7 @@ function real_gather_docs() { (
#---------------------------------------------------------------------
function install_pam_confs() {

- debug "libgrimoire" "Running install_pam_confs() on $SPELL"
+ $STD_SORCERY_DEBUG "SPELL = $SPELL"

if [ -d "$SCRIPT_DIRECTORY/pam.d" ]; then
cd "$SCRIPT_DIRECTORY/pam.d"
@@ -225,7 +225,7 @@ function install_pam_confs() {
## This is intended to be overridable at some point
#---------------------------------------------------------------------
function run_spell_success() {
- debug "build_api/common" "cast of $SPELL-$VERSION was successful"
+ $STD_SORCERY_DEBUG "cast of $SPELL-$VERSION was successful"

local INST_LOG="$INSTALL_LOGS/$SPELL-$VERSION"
local MD5_LOG="$MD5SUM_LOGS/$SPELL-$VERSION"
@@ -244,7 +244,7 @@ function run_spell_success() {
pop_install_queue "$SPELL"

# update depends info
- debug "build_api/common" "Merging depends info"
+ $STD_SORCERY_DEBUG "Merging depends info"

local t_DEPENDS_STATUS=$(lock_start_transaction $DEPENDS_STATUS)
# none of the old values are valid, only the new, uncommitted values are
@@ -338,7 +338,7 @@ function run_spell_success() {
## This is intended to be overridable at some point
#---------------------------------------------------------------------
function run_spell_failure() {
- debug "build_api/common" "cast of $SPELL-$VERSION failed"
+ $STD_SORCERY_DEBUG "cast of $SPELL-$VERSION failed"
local rc=$1

sound FAILURE
diff --git a/var/lib/sorcery/modules/dl_handlers/dl_tla
b/var/lib/sorcery/modules/dl_handlers/dl_tla
index 2e7372b..fc987da 100755
--- a/var/lib/sorcery/modules/dl_handlers/dl_tla
+++ b/var/lib/sorcery/modules/dl_handlers/dl_tla
@@ -42,7 +42,7 @@ function dl_tla_get() {
continue
}
else
- debug "archive $TLA_ARCHIVE is already registered"
+ $STD_SORCERY_DEBUG "archive $TLA_ARCHIVE is already registered"
fi
if test -d $target; then
pushd $target &>/dev/null &&
diff --git a/var/lib/sorcery/modules/dl_handlers/dl_wget
b/var/lib/sorcery/modules/dl_handlers/dl_wget
index b69ca19..63efdb1 100755
--- a/var/lib/sorcery/modules/dl_handlers/dl_wget
+++ b/var/lib/sorcery/modules/dl_handlers/dl_wget
@@ -21,7 +21,7 @@
#---------------------------------------------------------------------

function dl_wget_get() {
- debug libdownload "$FUNCNAME -- $@"
+ $STD_SORCERY_DEBUG_HEAD
dl_command_check wget || return 254

local target=$1
@@ -60,7 +60,7 @@ function dl_wget_call_wget() {
local FILE=$1
local URL=$2

- debug 'dl_wget' "$funcname -- $@"
+ $STD_SORCERY_DEBUG_HEAD

rm -f $FILE
wget $WGET_OPTIONS "$URL" 2>&1 &&
@@ -118,7 +118,7 @@ function dl_wget_set_options() {
DEREF_SYM="--retr-symlinks"

WGET_OPTIONS="$URL_HTTP_TIMEOUT $URL_HTTP_RETRIES $NO_CACHE $RATE $PASSIVE
$CONTINUE $ONLY_NEWER $DEREF_SYM"
- debug 'dl_wget' "wget options: $WGET_OPTIONS"
+ $STD_SORCERY_DEBUG "wget options: $WGET_OPTIONS"
}
#---------------------------------------------------------------------
##=back
diff --git a/var/lib/sorcery/modules/libapi b/var/lib/sorcery/modules/libapi
index 01e9fbe..ba68df1 100755
--- a/var/lib/sorcery/modules/libapi
+++ b/var/lib/sorcery/modules/libapi
@@ -125,7 +125,8 @@
# CAST_PASS download_log IW_LOG SOLO QUIET INSTALL_QUEUE
# OVERRIDE_CFLAGS OVERRIDE_CXXFLAGS OVERRIDE_LDFLAGS NO_OPTIMIZATION_FLAGS
# DOT_PROGRESS VOYEUR_OVERRIDE RECONFIGURE RECAST_DOWN COMPILE RECAST_UP
-# FORCE_DOWNLOAD SILENT FIX DEBUG SEPARATE BASE_URL
+# FORCE_DOWNLOAD SILENT FIX SORCERY_DEBUG STD_SORCERY_DEBUG
+# STD_SORCERY_DEBUG_HEAD SEPARATE BASE_URL
# CAST_HASH BACK_CAST_HASH CANNOT_CAST_HASH uncommitted_hash NEW_DEPENDS
# spell_depends DEPENDS_CONFIG UP_DEPENDS SPELL_CONFIG GRIMOIRE_DIR
# BUILD_API VOYEUR_STDOUT VOYEUR_STDERR C_LOG C_FIFO INST_LOG MD5_LOG
@@ -144,7 +145,7 @@
##
#---------------------------------------------------------------------
function acquire_src() {
- debug "libapi" "$FUNCNAME - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_acquire_src "$@"
}

@@ -169,7 +170,7 @@ function acquire_src() {
##
#---------------------------------------------------------------------
function config_query () {
- debug "libapi" "config_query - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_config_query "$@"
}

@@ -191,7 +192,7 @@ function config_query () {
##
#---------------------------------------------------------------------
function config_query_list () {
- debug "libapi" "config_query_list - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_config_query_list "$@"
}

@@ -232,7 +233,7 @@ function config_query_list () {
##
#---------------------------------------------------------------------
function config_query_option () {
- debug "libapi" "config_query_option - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_config_query_option "$@"
}

@@ -254,7 +255,7 @@ function config_query_option () {
##
#---------------------------------------------------------------------
function config_query_string () {
- debug "libapi" "config_query_string - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_config_query_string "$@"
}

@@ -268,7 +269,7 @@ function config_query_string () {
## returns the given spellname if it is installed
#---------------------------------------------------------------------
function conflicts () {
- debug "libapi" "conflicts - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_conflicts "$@"
}

@@ -300,7 +301,7 @@ function conflicts () {
##
#---------------------------------------------------------------------
function default_sorcery_build () {
- debug "libapi" "default_sorcery_build - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_default_sorcery_build "$@"
}

@@ -312,7 +313,7 @@ function default_sorcery_build () {
##
#---------------------------------------------------------------------
function default_sorcery_download() {
- debug "libapi" "$FUNCNAME - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_default_sorcery_download "$@"
}

@@ -328,7 +329,7 @@ function default_sorcery_download() {
##
#---------------------------------------------------------------------
function default_sorcery_install () {
- debug "libapi" "default_sorcery_install - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_default_sorcery_install "$@"
}

@@ -339,7 +340,7 @@ function default_sorcery_install () {
## Installs configuration files and documentation.
#---------------------------------------------------------------------
function default_sorcery_install_extras () {
- debug "libapi" "default_sorcery_install_extras - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_default_sorcery_install_extras "$@"
}

@@ -353,7 +354,7 @@ function default_sorcery_install_extras
##
#---------------------------------------------------------------------
function default_sorcery_post_build () {
- debug "libapi" "default_sorcery_post_build - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_default_sorcery_post_build "$@"
}

@@ -365,7 +366,7 @@ function default_sorcery_post_build () {
## installed files can happen
#---------------------------------------------------------------------
function default_sorcery_post_install () {
- debug "libapi" "default_sorcery_post_install - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_default_sorcery_post_install "$@"
}

@@ -377,7 +378,7 @@ function default_sorcery_post_install ()
## transfer_staged_spell
#---------------------------------------------------------------------
function default_sorcery_transfer () {
- debug "libapi" "default_sorcery_transfer - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_default_sorcery_transfer "$@"
}

@@ -388,7 +389,7 @@ function default_sorcery_transfer () {
## Used if no PRE_BUILD script is found for a spell.
#---------------------------------------------------------------------
function default_sorcery_pre_build () {
- debug "libapi" "default_sorcery_pre_build - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_default_sorcery_pre_build "$@"
}

@@ -404,7 +405,7 @@ function default_sorcery_pre_build () {
##
#---------------------------------------------------------------------
function default_sorcery_pre_install () {
- debug "libapi" "default_sorcery_pre_install - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_default_sorcery_pre_install "$@"
}

@@ -418,7 +419,7 @@ function default_sorcery_pre_install ()
## Denotes that a spell requires another spell to work.
#---------------------------------------------------------------------
function depends () {
- debug "libapi" "depends - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_depends "$@"
}

@@ -428,7 +429,7 @@ function depends () {
## Stops using installwatch
#---------------------------------------------------------------------
function devoke_installwatch () {
- debug "libapi" "devoke_installwatch - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_devoke_installwatch "$@"
}

@@ -438,7 +439,7 @@ function devoke_installwatch () {
## Stops using installwatch
#---------------------------------------------------------------------
function devoke_stage_root () {
- debug "libapi" "devoke_stage_root - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_devoke_stage_root "$@"
}

@@ -454,7 +455,7 @@ function devoke_stage_root () {
##
#---------------------------------------------------------------------
function download_src() {
- debug "libapi" "$FUNCNAME - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_download_src "$@"
}
#---------------------------------------------------------------------
@@ -476,7 +477,7 @@ function download_src() {
## </pre>
#---------------------------------------------------------------------
function force_depends() {
- debug "libapi" "$FUNCNAME - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_force_depends "$@"
}

@@ -487,7 +488,7 @@ function force_depends() {
## them as part of the spell
#---------------------------------------------------------------------
function gather_docs() {
- debug "libapi" "gather_docs - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_gather_docs "$@"
}

@@ -502,7 +503,7 @@ function gather_docs() {
##
#---------------------------------------------------------------------
function get_source_nums() {
- debug "libapi" "$FUNCNAME - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_get_source_nums "$@"
}

@@ -520,7 +521,7 @@ function get_source_nums() {
## @stdout the provider name(s)
#---------------------------------------------------------------------
function get_spell_provider() {
- debug "libapi" "get_spell_provider - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_get_spell_provider "$@"
}

@@ -535,7 +536,7 @@ function get_spell_provider() {
##
#---------------------------------------------------------------------
function guess_compressor () {
- debug "libapi" "guess_compressor - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_guess_compressor "$@"
}

@@ -557,7 +558,7 @@ function guess_compressor () {
## choose what the default will be
#------------------------------------------------------------------------
function handle_changed_config() {
- debug "libapi" "handle_changed_config - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_handle_changed_config "$@"
}

@@ -570,7 +571,7 @@ function handle_changed_config() {
##
#---------------------------------------------------------------------
function is_depends_enabled() {
- debug "libapi" "is_depends_enabled - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_is_depends_enabled "$@"
}

@@ -582,7 +583,7 @@ function is_depends_enabled() {
##
#---------------------------------------------------------------------
function installed_version () {
- debug "libapi" "installed_version - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_installed_version "$@"
}

@@ -596,7 +597,7 @@ function installed_version () {
## Returns the current version of the given spell
#------------------------------------------------------------------------
function install_config_file() {
- debug "libapi" "install_config_file - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_install_config_file "$@"
}

@@ -606,7 +607,7 @@ function install_config_file() {
## Starts using installwatch
#---------------------------------------------------------------------
function invoke_installwatch () {
- debug "libapi" "invoke_installwatch - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_invoke_installwatch "$@"
}

@@ -616,7 +617,7 @@ function invoke_installwatch () {
## Starts using installwatch
#---------------------------------------------------------------------
function invoke_stage_root () {
- debug "libapi" "invoke_stage_root - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_invoke_stage_root "$@"
}

@@ -635,7 +636,7 @@ function invoke_stage_root () {
##
#---------------------------------------------------------------------
function list_remove () {
- debug "libapi" "list_remove - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_list_remove "$@"
}

@@ -655,7 +656,7 @@ function list_remove () {
##
#---------------------------------------------------------------------
function list_add () {
- debug "libapi" "list_add - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_list_add "$@"
}

@@ -679,7 +680,7 @@ function list_add () {
##
#---------------------------------------------------------------------
function list_find () {
- debug "libapi" "list_find - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_list_find "$@"
}

@@ -692,7 +693,7 @@ function list_find () {
##
#---------------------------------------------------------------------
function message () {
- debug "libapi" "message - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_message "$@"
}

@@ -714,7 +715,7 @@ function message () {
## </pre>
#---------------------------------------------------------------------
function mk_source_dir () {
- debug "libapi" "mk_source_dir - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_mk_source_dir "$@"
}

@@ -725,7 +726,7 @@ function mk_source_dir () {
##
#---------------------------------------------------------------------
function note_config_file() {
- debug "libapi" "note_config_file - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_note_config_file "$@"
}

@@ -739,7 +740,7 @@ function note_config_file() {
##
#---------------------------------------------------------------------
function on_cast () {
- debug "libapi" "on_cast - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_on_cast "$@"
}

@@ -755,7 +756,7 @@ function on_cast () {
##
#---------------------------------------------------------------------
function on_dispel () {
- debug "libapi" "on_dispel - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_on_dispel "$@"
}

@@ -770,7 +771,7 @@ function on_dispel () {
##
#---------------------------------------------------------------------
function on_pre_cast () {
- debug "libapi" "on_pre_cast - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_on_pre_cast "$@"
}

@@ -784,7 +785,7 @@ function on_pre_cast () {
##
#---------------------------------------------------------------------
function on_pre_dispel () {
- debug "libapi" "on_pre_dispel - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_on_pre_dispel "$@"
}

@@ -799,7 +800,7 @@ function on_pre_dispel () {
## Denotes that a spell can use another spell for additional functionality.
#---------------------------------------------------------------------
function optional_depends () {
- debug "libapi" "optional_depends - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_optional_depends "$@"
}

@@ -815,7 +816,7 @@ function optional_depends () {
##
#---------------------------------------------------------------------
function persistent_add () {
- debug "libapi" "persistent_add - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_persistent_add "$@"
}

@@ -831,7 +832,7 @@ function persistent_add () {
##
#---------------------------------------------------------------------
function persistent_clear () {
- debug "persistent_clear - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_persistent_clear "$@"
}

@@ -845,7 +846,7 @@ function persistent_clear () {
##
#---------------------------------------------------------------------
function persistent_load () {
- debug "libapi" "persistent_load - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_persistent_load "$@"
}

@@ -861,7 +862,7 @@ function persistent_load () {
##
#---------------------------------------------------------------------
function persistent_remove () {
- debug "libapi" "persistent_remove - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_persistent_remove "$@"
}

@@ -877,7 +878,7 @@ function persistent_remove () {
##
#---------------------------------------------------------------------
function persistent_save () {
- debug "libapi" "persistent_save - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_persistent_save "$@"
}

@@ -896,7 +897,7 @@ function persistent_save () {
##
#---------------------------------------------------------------------
function persistent_read () {
- debug "libapi" "persistent_read - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_persistent_read "$@"
}

@@ -910,7 +911,7 @@ function persistent_read () {
##
#---------------------------------------------------------------------
function prepare_install () {
- debug "libapi" "prepare_install - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_prepare_install "$@"
}

@@ -922,7 +923,7 @@ function prepare_install () {
## @return 0 if any provider of $1 is installed
#---------------------------------------------------------------------
function provider_ok() {
- debug "libapi" "provider_ok - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_provider_ok "$@"
}

@@ -936,7 +937,7 @@ function provider_ok() {
##
#---------------------------------------------------------------------
function rm_source_dir() {
- debug "libapi" "rm_source_dir - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_rm_source_dir "$@"
}

@@ -956,7 +957,7 @@ function rm_source_dir() {
##
#---------------------------------------------------------------------
function query () {
- debug "libapi" "query - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_query "$@"
}

@@ -977,7 +978,7 @@ function query () {
##
#---------------------------------------------------------------------
function query_string () {
- debug "libapi" "query_string - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_query_string "$@"
}

@@ -991,7 +992,7 @@ function query_string () {
## Denotes that a spell requires another spell to work.
#---------------------------------------------------------------------
function runtime_depends () {
- debug "libapi" "runtime_depends - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_runtime_depends "$@"
}

@@ -1011,7 +1012,7 @@ function runtime_depends () {
##
#---------------------------------------------------------------------
function sedit () {
- debug "libapi" "sedit - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_sedit "$@"
}

@@ -1025,7 +1026,7 @@ function sedit () {
## @stdout recursively prints out the spell that depend on the specified
spell
#---------------------------------------------------------------------
function show_up_depends() {
- debug "libapi" "spell_ok - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_show_up_depends "$@"
}

@@ -1037,7 +1038,7 @@ function show_up_depends() {
## @return 0 if the given spell's status is "installed"
#---------------------------------------------------------------------
function spell_installed () {
- debug "libapi" "spell_installed - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_spell_installed "$@"
}

@@ -1049,7 +1050,7 @@ function spell_installed () {
## @return 0 if the given spell's status is "held"
#---------------------------------------------------------------------
function spell_held() {
- debug "libapi" "spell_held - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_spell_held "$@"
}

@@ -1061,7 +1062,7 @@ function spell_held() {
## @return 0 if the given spell's status is "installed" or "held"
#---------------------------------------------------------------------
function spell_ok() {
- debug "libapi" "spell_ok - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_spell_ok "$@"
}

@@ -1073,7 +1074,7 @@ function spell_ok() {
## @return 0 if the given spell's status is "exiled"
#---------------------------------------------------------------------
function spell_exiled() {
- debug "libapi" "spell_ok - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_spell_exiled "$@"
}

@@ -1084,7 +1085,7 @@ function spell_exiled() {
## @See <@function var.lib.sorcery.modules.libdepends
#---------------------------------------------------------------------
function sub_depends() {
- debug "libapi" "sub_depends - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_sub_depends "$@"
}

@@ -1099,7 +1100,7 @@ function sub_depends() {
## Denotes that a spell can use another spell for additional functionality.
#---------------------------------------------------------------------
function suggest_depends () {
- debug "libapi" "suggest_depends - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_suggest_depends "$@"
}

@@ -1113,7 +1114,7 @@ function suggest_depends () {
##
#---------------------------------------------------------------------
function uncompress () {
- debug "libapi" "uncompress - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_uncompress "$@"
}

@@ -1130,7 +1131,7 @@ function uncompress () {
##
#---------------------------------------------------------------------
function unpack () {
- debug "libapi" "unpack - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_unpack "$@"
}

@@ -1145,7 +1146,7 @@ function unpack () {
##
#---------------------------------------------------------------------
function unpack_file () {
- debug "libapi" "unpack_file - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_unpack_file "$@"
}

@@ -1158,7 +1159,7 @@ function unpack_file () {
##
#---------------------------------------------------------------------
function unpack_file_simple() {
- debug "libapi" "$FUNCNAME - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_unpack_file_simple "$@"
}

@@ -1173,7 +1174,7 @@ function unpack_file_simple() {
##
#---------------------------------------------------------------------
function verify_file () {
- debug "libapi" "verify_file - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_verify_file "$@"
}

@@ -1190,7 +1191,7 @@ function verify_file () {
##
#---------------------------------------------------------------------
function up_trigger() {
- debug "libapi" "$FUNCNAME - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_up_trigger "$@"
}

@@ -1204,7 +1205,7 @@ function up_trigger() {
## to glibc. Installwatch must be running for this to work.
#---------------------------------------------------------------------
function track_manual() {
- debug "libapi" "track_manual - $*"
+ $STD_SORCERY_DEBUG_HEAD
real_track_manual "$@"
}

diff --git a/var/lib/sorcery/modules/libcast b/var/lib/sorcery/modules/libcast
index 67caf74..e738f2f 100755
--- a/var/lib/sorcery/modules/libcast
+++ b/var/lib/sorcery/modules/libcast
@@ -19,7 +19,7 @@
#---------------------------------------------------------------------
function load_build_api() {

- debug "libcast" "Starting load_build_api"
+ $STD_SORCERY_DEBUG_HEAD

source $SGL_LIBRARY_MODULES/build_api/common
case $BUILD_API in
@@ -93,7 +93,7 @@ function prepare_spell_config() {
#---------------------------------------------------------------------
function run_conflicts() {

- debug "build_api/common" "Starting run_conflicts() on $SPELL"
+ $STD_SORCERY_DEBUG_HEAD "on $SPELL"
local ignore_conflict=$1
local each rc

@@ -657,7 +657,7 @@ function create_compile_log() {
#---------------------------------------------------------------------
function view_compile_log() {

- debug "libcast" "In view_compile_log, C_LOG=$C_LOG"
+ $STD_SORCERY_DEBUG_HEAD "C_LOG=$C_LOG"
report $C_LOG "Compile log"
}

@@ -668,7 +668,7 @@ function view_compile_log() {
#---------------------------------------------------------------------
function report_install() {

- debug "libcast" "In report_install, INST_LOG=$INST_LOG"
+ $STD_SORCERY_DEBUG_HEAD "INST_LOG=$INST_LOG"
report $INST_LOG "Install log"

}
@@ -709,7 +709,7 @@ function show_downloading() {

local SPELL=$1
local download_log=$(get_spell_dl_log $SPELL)
- debug "cast" "Started show_downloading() on $SPELL from $download_log"
+ $STD_SORCERY_DEBUG "Started show_downloading() on $SPELL from
$download_log"

# poke around waiting for downloading to start
while ! ( [[ $download_log ]] &&
@@ -725,7 +725,7 @@ function show_downloading() {
done

show_download_progress $download_log
- debug "libcast" "Out of show_downloading"
+ $STD_SORCERY_DEBUG_HEAD "Out of show_downloading"
}

#---------------------------------------------------------------------
diff --git a/var/lib/sorcery/modules/libcodex
b/var/lib/sorcery/modules/libcodex
index 29c2913..ab8a901 100755
--- a/var/lib/sorcery/modules/libcodex
+++ b/var/lib/sorcery/modules/libcodex
@@ -340,7 +340,7 @@ function codex_set_grimoires() {
##
#---------------------------------------------------------------------
function codex_get_all_grimoires() {
- debug "libcodex" "codex_get_all_grimoires()"
+ $STD_SORCERY_DEBUG_HEAD
echo "${GRIMOIRE_DIR[*]}" | tr '[:blank:]' '\n'
return $?
}
@@ -366,7 +366,7 @@ function codex_find_section_by_name() {

for GRIMOIRE in `codex_get_all_grimoires`; do
if [ -d "$GRIMOIRE/$SECTION_NAME" ] ; then
- debug "libcodex" "codex_find_section_by_name() - found section
$GRIMOIRE/$SECTION_NAME"
+ $STD_SORCERY_DEBUG "found section $GRIMOIRE/$SECTION_NAME"
echo "$GRIMOIRE/$SECTION_NAME"
return 0
fi
@@ -418,7 +418,7 @@ function codex_get_section_names() {
##
#---------------------------------------------------------------------
function codex_get_sections() {
- debug "libcodex" "codex_get_sections() - $@"
+ $STD_SORCERY_DEBUG_HEAD
local GRIMOIRE

while [ $# -gt 0 ] ; do
@@ -486,7 +486,7 @@ function codex_does_spell_exist() {
#---------------------------------------------------------------------
function codex_find_spell_by_name() {

- debug "libcodex" "codex_find_spell_by_name - $*"
+ $STD_SORCERY_DEBUG_HEAD

codex_cache_spell_lookup $1 `codex_get_all_grimoires`

@@ -501,7 +501,7 @@ function codex_find_spell_by_name() {
##
#---------------------------------------------------------------------
function codex_get_spells_in_section() {
- debug "libcodex" "codex_get_spells_in_section - $*"
+ $STD_SORCERY_DEBUG_HEAD
codex_is_canonicalized $1 || return 1
local section=`basename $1`
local index="`dirname $1`/$SPELL_INDEX_FILE"
@@ -599,7 +599,7 @@ function codex_clear_current_spell() {
#---------------------------------------------------------------------
function codex_set_current_spell() {

- debug "libcodex" "runing codex_set_current_spell"
+ $STD_SORCERY_DEBUG_HEAD

codex_clear_current_spell

@@ -609,11 +609,11 @@ function codex_set_current_spell() {
. $SPELL_CONFIG > /dev/null 2> /dev/null
fi

- debug "libcodex" "looking around for API_VERSION"
+ $STD_SORCERY_DEBUG "looking around for API_VERSION"
[[ -x $GRIMOIRE/API_VERSION ]] && . $GRIMOIRE/API_VERSION
[[ -x $SECTION_DIRECTORY/API_VERSION ]] && . $SECTION_DIRECTORY/API_VERSION

- debug "libcodex" "sourcing DETAILS"
+ $STD_SORCERY_DEBUG "sourcing DETAILS"
persistent_load
. $SPELL_DIRECTORY/DETAILS 1>/dev/null 2>&1
persistent_clear
@@ -682,9 +682,9 @@ function codex_get_spell_paths() {
##
#---------------------------------------------------------------------
function codex_set_current_spell_by_name() {
- debug "libcodex" "codex_set_current_spell_by_name -- $1"
+ $STD_SORCERY_DEBUG_HEAD
local SPELL_NAME=`codex_find_spell_by_name "$1"`
- debug "libcodex" $SPELL_NAME
+ $STD_SORCERY_DEBUG $SPELL_NAME

[ -n "$SPELL_NAME" ] && codex_set_current_spell $SPELL_NAME
}
@@ -706,7 +706,7 @@ function codex_cache_spell_lookup() {
local spell="$1"
shift
while [ $# -gt 0 ] ; do
- debug "libcodex" "looking up $spell in ${1}'s cache"
+ $STD_SORCERY_DEBUG "looking up $spell in ${1}\\'s cache"
codex_check_cache $1
SECTION=`grep -m 1 "^$spell " $1/$SPELL_INDEX_FILE | cut -d' ' -f2`
[[ $SECTION ]] && echo "$SECTION/$spell" && return
@@ -742,7 +742,7 @@ function codex_check_cache() {
#---------------------------------------------------------------------
function codex_create_cache() {

- debug "libcodex" "codex_create_cache - $*"
+ $STD_SORCERY_DEBUG_HEAD
local list="$*"
[[ $list ]] || list="${GRIMOIRE_DIR[*]}"

diff --git a/var/lib/sorcery/modules/libcrossinstall
b/var/lib/sorcery/modules/libcrossinstall
index cff02cb..ade9b03 100755
--- a/var/lib/sorcery/modules/libcrossinstall
+++ b/var/lib/sorcery/modules/libcrossinstall
@@ -16,7 +16,7 @@
#---------------------------------------------------------------------
function install_root_menu() {

- debug "libcrossinstall" "cross_install_menu is being built now..."
+ $STD_SORCERY_DEBUG "cross_install_menu is being built now..."
local C_HELP="Fill in your own preferred track root location."
local I_HELP="Fill in your own preferred install root location."
local S_HELP="Fill in your own preferred state root location."
@@ -56,7 +56,7 @@ function install_root_menu() {
#---------------------------------------------------------------------
function set_install_cache_menu() {

- debug "libcrossinstall" "set_install_cache_menu - is starting..."
+ $STD_SORCERY_DEBUG "set_install_cache_menu - is starting..."
local PROMPT="Please enter the install cache location where cache tarballs
will be stored"
if NEW_INSTALL_CACHE=`eval $DIALOG ' --ok-label "Commit" \
--inputbox \
@@ -76,7 +76,7 @@ function set_install_cache_menu() {
#---------------------------------------------------------------------
function set_install_root_menu() {

- debug "libcrossinstall" "set_install_root_menu - is starting..."
+ $STD_SORCERY_DEBUG "set_install_root_menu - is starting..."
local PROMPT="Please enter the install root location where you want file
installed"
if NEW_INSTALL_ROOT=`eval $DIALOG ' --ok-label "Commit" \
--inputbox \
@@ -96,7 +96,7 @@ function set_install_root_menu() {
#---------------------------------------------------------------------
function set_state_root_menu() {

- debug "libcrossinstall" "set_state_root_menu - is starting..."
+ $STD_SORCERY_DEBUG "set_state_root_menu - is starting..."
local PROMPT="Please enter location where you want state files to be"
if NEW_STATE_ROOT=`eval $DIALOG ' --ok-label "Commit" \
--inputbox \
@@ -116,7 +116,7 @@ function set_state_root_menu() {
#---------------------------------------------------------------------
function set_track_root_menu() {

- debug "libcrossinstall" "set_track_root_menu - is starting..."
+ $STD_SORCERY_DEBUG "set_track_root_menu - is starting..."
local PROMPT="Please enter the location where you want files tracked
relative to"
if NEW_TRACK_ROOT=`eval $DIALOG ' --ok-label "Commit" \
--inputbox \
diff --git a/var/lib/sorcery/modules/libdepends
b/var/lib/sorcery/modules/libdepends
index a1cb2e9..0608487 100755
--- a/var/lib/sorcery/modules/libdepends
+++ b/var/lib/sorcery/modules/libdepends
@@ -80,7 +80,7 @@ function run_prepare()
{
local SPELL=$1

- debug "cast" "run_prepare() - SPELL = $SPELL SCRIPT_DIRECTORY =
$SCRIPT_DIRECTORY"
+ $STD_SORCERY_DEBUG "SPELL = $SPELL SCRIPT_DIRECTORY = $SCRIPT_DIRECTORY"

depends_message "${SPELL}" "preparing environment..."

@@ -119,7 +119,7 @@ function run_other() {
#---------------------------------------------------------------------
function run_configure() {
local SPELL=$1
- debug "cast" "run_configure() - SCRIPT_DIRECTORY = $SCRIPT_DIRECTORY"
+ $STD_SORCERY_DEBUG_HEAD "SCRIPT_DIRECTORY = $SCRIPT_DIRECTORY"

function run_configure_msg() {
depends_message "${SPELL}" "running configuration..."
@@ -137,7 +137,7 @@ function run_configure() {
#---------------------------------------------------------------------
function run_depends() {
local SPELL=$1
- debug "cast" "run_depends() - SCRIPT_DIRECTORY = $SCRIPT_DIRECTORY"
+ $STD_SORCERY_DEBUG_HEAD "SCRIPT_DIRECTORY = $SCRIPT_DIRECTORY"

function run_depends_msg() {
depends_message "${SPELL}" "checking dependencies..."
@@ -155,7 +155,7 @@ function run_depends() {
#---------------------------------------------------------------------
function run_up_triggers() {
local SPELL=$1
- debug "cast" "run_up_triggers() - SCRIPT_DIRECTORY = $SCRIPT_DIRECTORY"
+ $STD_SORCERY_DEBUG_HEAD "SCRIPT_DIRECTORY = $SCRIPT_DIRECTORY"

function run_up_triggers_msg() {
depends_message "${SPELL}" "checking for reverse triggers..."
@@ -255,7 +255,7 @@ function process_sub_depends() {
run_spell_file SUB_DEPENDS sub_depends || return 1
hash_append processed_sub_depends $sub_dependee $sub_depends
else
- debug libdepends "SUB_DEPENDS: $sub_dependee needs to provide
$sub_depends but has already been processed"
+ $STD_SORCERY_DEBUG "SUB_DEPENDS: $sub_dependee needs to provide
$sub_depends but has already been processed"
fi
else
# sub-depends file doesnt exist, something messed up somewhere
@@ -374,7 +374,7 @@ function compute_uninstalled_depends()
# $1=table to place spells in
# $2=table to put problem spells in, $* = root spells

- debug "libdepends" "compute_depends of $*"
+ $STD_SORCERY_DEBUG_HEAD
local CAST_HASH="$1"
local BACK_CAST_HASH="$2"
local CANNOT_CAST_HASH="$3"
@@ -397,7 +397,7 @@ function compute_uninstalled_depends()
private_remove_dependees ${spells[$_idx]}
fi
else
- debug "libdepends" "already looked at ${spells[$_idx]}, skipping"
+ $STD_SORCERY_DEBUG "already looked at ${spells[$_idx]}, skipping"
fi
done
# we no longer need these, no sense in keeping them around
@@ -420,7 +420,7 @@ function compute_uninstalled_depends()
#---------------------------------------------------------------------
function private_run_depends()
{
- debug "libdepends" "$FUNCNAME - $*"
+ $STD_SORCERY_DEBUG_HEAD
local SPELL=$1

# special accumulators for the current spell
@@ -476,7 +476,7 @@ function private_run_depends()
private_recast_optionals $SPELL &&
private_add_triggerees &&
private_add_depends ||
- { debug "libdepends" "$FUNCNAME failed to process $SPELL." ; return 1; }
+ { $STD_SORCERY_DEBUG "$FUNCNAME failed to process $SPELL." ; return 1; }
# no point in keeping the file around if its empty...
test -s $spell_depends || rm -f $spell_depends $spell_sub_depends

@@ -874,7 +874,7 @@ function real_suggest_depends() {
function work_depends_provider()
{

- debug "libdepends" "$FUNCNAME - $@"
+ $STD_SORCERY_DEBUG_HEAD
local default tmp installed=no
local status=()

@@ -955,7 +955,7 @@ function work_depends_provider()
#---------------------------------------------------------------------
function work_depends_spell()
{
- debug "libdepends" "$FUNCNAME - $@"
+ $STD_SORCERY_DEBUG_HEAD

local failure_ok=$1
local article=$2
@@ -986,7 +986,7 @@ function work_depends_spell()
function work_optional_depends_provider()
{

- debug "libdepends" "$FUNCNAME - $@"
+ $STD_SORCERY_DEBUG_HEAD
local default tmp installed=no
local status=()

@@ -1087,7 +1087,7 @@ function work_optional_depends_provider(
function work_optional_depends_spell()
{

- debug "libdepends" "$FUNCNAME - $@"
+ $STD_SORCERY_DEBUG_HEAD
local default

local failure_ok=$1
@@ -1136,39 +1136,39 @@ function work_optional_depends_spell()

# check for abandoned answers
if [ -e $ABANDONED_DEPENDS/$SPELL ] ; then
- debug "libdepends" "Checking in abandoned depends"
+ $STD_SORCERY_DEBUG "Checking in abandoned depends"
default=$(search_depends_status $ABANDONED_DEPENDS/$SPELL "$SPELL"
"$1"|awk -F: '{print $3;exit}')
fi

# check the defaults file...
# first for explicit $SPELL -> $2
if [[ ! $default ]]; then
- debug "libdepends" "Checking in default answers"
+ $STD_SORCERY_DEBUG "Checking in default answers"
default=$(search_default_depends $DEFAULT_DEPENDS $SPELL $1|awk -F:
'{print $3; exit}')
fi

# then for anything -> $2
if [[ ! $default ]]; then
- debug "libdepends" "Checking in default answers"
+ $STD_SORCERY_DEBUG "Checking in default answers"
default=$(search_default_depends $DEFAULT_DEPENDS "" $1|awk -F: '{print
$3; exit}')
fi

# then for $1 -> anything
if [[ ! $default ]]; then
- debug "libdepends" "Checking in default answers"
+ $STD_SORCERY_DEBUG "Checking in default answers"
default=$(search_default_depends $DEFAULT_DEPENDS $SPELL "" |awk -F:
'{print $3; exit}')
fi

# check the install queue
if [[ ! $default ]]; then
- debug "libdepends" "Checking in queue"
+ $STD_SORCERY_DEBUG "Checking in queue"
#\< and \> match the empty string at the start and end of a word
echo ${spells[@]}|tr " " "\n" | grep -x -q "$1" && default=on
fi

# check if installed/held
if [[ ! $default ]]; then
- debug "libdepends" "Checking if already installed"
+ $STD_SORCERY_DEBUG "Checking if already installed"
spell_ok $1 && default=on
fi

@@ -1309,7 +1309,7 @@ function real_sub_depends() {
if spell_ok $sub_dependee; then
if [[ $(search_sub_depends "$SUB_DEPENDS_STATUS" "$requester" \
"$sub_dependee" "$sub_depends") != "" ]]; then
- debug "libdepends" "$FUNCNAME -- $requester -> $sub_dependee" \
+ $STD_SORCERY_DEBUG "$requester -> $sub_dependee" \
"-> $sub_depends provided by installed spell"
return 0
fi
@@ -1325,7 +1325,7 @@ function real_sub_depends() {
rc=$?
return $rc
) && {
- debug "libdepends" "adding altruistic sub-depends for $sub_dependee
with $sub_depends from $requester"
+ $STD_SORCERY_DEBUG "adding altruistic sub-depends for $sub_dependee
with $sub_depends from $requester"
add_sub_depends "$SUB_DEPENDS_STATUS" "$requester" \
"$sub_dependee" "$sub_depends"
hash_append sub_dep_f_hash $requester $sub_dependee:$sub_depends $'\n'
@@ -1363,7 +1363,8 @@ function real_sub_depends() {
# it'll get re-processed (assuming the caller also did a depends on it)
#---------------------------------------------------------------------
function real_force_depends() {
- debug "libdepends" "$FUNCNAME - $SPELL - $@"
+ $STD_SORCERY_DEBUG_HEAD
+ $STD_SORCERY_DEBUG "SPELL = $SPELL"
local check=$(hash_get "depends_looked_at" "$1")

message "${SPELL}" "is forcing a recast of" "${1}"
@@ -1382,7 +1383,8 @@ function real_force_depends() {
#---------------------------------------------------------------------
function private_common_depends()
{
- debug "libdepends" "$FUNCNAME - $SPELL - $@"
+ $STD_SORCERY_DEBUG_HEAD
+ $STD_SORCERY_DEBUG "SPELL = $SPELL"
add_depends $spell_depends "$SPELL" "$@"

# runtime and suggested depends have no formal dependency info
@@ -1459,7 +1461,8 @@ function private_add_triggerees() {
#---------------------------------------------------------------------
function private_add_depends()
{
- debug "libdepends" "$FUNCNAME: SPELL=$SPELL, NEW_DEPENDS=${NEW_DEPENDS[*]}"
+ $STD_SORCERY_DEBUG_HEAD
+ $STD_SORCERY_DEBUG "SPELL=$SPELL, NEW_DEPENDS=${NEW_DEPENDS[*]}"
hash_append "$CAST_HASH" "$SPELL" "${NEW_DEPENDS[*]}"

for child in ${NEW_DEPENDS[*]}; do
@@ -1549,10 +1552,10 @@ function run_spell_config()
{

SPELL_CONFIG=$DEPENDS_CONFIG/$SPELL
- debug "libdepends" "run_spell_config() - DEPENDS_CONFIG=$DEPENDS_CONFIG
SPELL=$SPELL, SPELL_CONFIG=$SPELL_CONFIG DEPENDS_STATUS=$DEPENDS_STATUS"
+ $STD_SORCERY_DEBUG "DEPENDS_CONFIG=$DEPENDS_CONFIG SPELL=$SPELL,
SPELL_CONFIG=$SPELL_CONFIG DEPENDS_STATUS=$DEPENDS_STATUS"

if [ -x $SPELL_CONFIG ]; then
- debug "libdepends" "run_spell_config() - found $SPELL_CONFIG"
+ $STD_SORCERY_DEBUG "found $SPELL_CONFIG"
. $SPELL_CONFIG
fi
}
diff --git a/var/lib/sorcery/modules/libdepengine
b/var/lib/sorcery/modules/libdepengine
index 3d240a5..c3ea819 100755
--- a/var/lib/sorcery/modules/libdepengine
+++ b/var/lib/sorcery/modules/libdepengine
@@ -50,7 +50,7 @@ function depengine_entry_point() {
for spell in $spell_list; do
spell_status=$(dpgn_get_spell_color $spell)
if [[ $spell_status != white ]] ; then
- debug "libdepengine" "already did $spell"
+ $STD_SORCERY_DEBUG "already did $spell"
else
depengine_cast_engine $spell
fi
@@ -113,7 +113,7 @@ function depengine_cast_engine() {
[[ $triggerer == $spell ]] && continue
child_status=$(hash_get state_hash $triggerer)
if [[ $child_status == grey ]] ; then
- debug "libdepengine" "$spell has a $child_status triggerer on
$triggerer!"
+ $STD_SORCERY_DEBUG "$spell has a $child_status triggerer on
$triggerer!"
grey_triggerer=1
break
fi
@@ -159,7 +159,7 @@ function recurse_depends() {
:
;;
black:*)
- debug libdepengine "$spell already had a failed dep on $_child"
+ $STD_SORCERY_DEBUG "$spell already had a failed dep on $_child"
return 1
;;
esac
@@ -181,20 +181,20 @@ function recurse_depends() {
;;
grey)
if [[ $in_trigger != 0 ]] ; then
- debug "libdepengine" "found grey depend from trigger $spell ->
$child"
+ $STD_SORCERY_DEBUG "found grey depend from trigger $spell -> $child"
return 2
else
- debug "libdepengine" "detected a dependency loop $spell -> $child"
+ $STD_SORCERY_DEBUG "detected a dependency loop $spell -> $child"
fi
;;
brown)
- debug "libdepengine" "found brown depend $spell -> $child"
+ $STD_SORCERY_DEBUG "found brown depend $spell -> $child"
;;
black:0)
- debug "libdepengine" "$child already built properly, continuing"
+ $STD_SORCERY_DEBUG "$child already built properly, continuing"
;;
black:*)
- debug "libdepengine" "$child failed, minus_k is $MINUS_K"
+ $STD_SORCERY_DEBUG "$child failed, minus_k is $MINUS_K"
rc=1
[[ $MINUS_K == no ]] && break
;;
diff --git a/var/lib/sorcery/modules/libdispel
b/var/lib/sorcery/modules/libdispel
index ea078cc..9348cf7 100755
--- a/var/lib/sorcery/modules/libdispel
+++ b/var/lib/sorcery/modules/libdispel
@@ -20,7 +20,7 @@
##
#---------------------------------------------------------------------
function reap_regular_files() {
- debug "libsorcery" "reap_regular_files()"
+ $STD_SORCERY_DEBUG_HEAD
local FILE
while read FILE; do
rm -f "$FILE"
@@ -37,14 +37,14 @@ function reap_regular_files() {
##
#---------------------------------------------------------------------
function reap_config_files() {
- debug "libsorcery" "reap_config_files()"
+ $STD_SORCERY_DEBUG_HEAD
local FILE
while read FILE; do
[[ $FILE ]] || continue
if [[ $TOTAL_DISPEL ]] ; then
rm -f "$FILE"
elif grep -q "$(md5sum "$FILE" )" "$MD5S"; then
- debug libdispel "$FILE is a config file that hasnt changed,
removing..."
+ $STD_SORCERY_DEBUG "$FILE is a config file that hasnt changed,
removing..."
rm -f "$FILE"
else
reap_modified_file "$FILE"
@@ -106,7 +106,7 @@ function reap_depends() {
function reaper() {
# Example: reaper "$INSTALL_LOG" "$MD5_LOG"

- debug "libsorcery" "Running reaper() on $1"
+ $STD_SORCERY_DEBUG_HEAD

if ! [ "$REAP" == "on" ] ||
! [ -f $1 ]; then return
@@ -170,7 +170,7 @@ function reaper() {
function reap_state_files() {
# Example: reaper "$INSTALL_LOG" "$MD5_LOG"

- debug "libsorcery" "Running reaper() on $1"
+ $STD_SORCERY_DEBUG_HEAD

local UNIQUE="$$.$RANDOM"
local REAPER_FILES="$TMP_DIR/reaper.$UNIQUE.files"
diff --git a/var/lib/sorcery/modules/libdownload
b/var/lib/sorcery/modules/libdownload
index 953ff06..1075ef1 100755
--- a/var/lib/sorcery/modules/libdownload
+++ b/var/lib/sorcery/modules/libdownload
@@ -86,8 +86,7 @@ function dl_get_bucket() {
dl_${handler}_get "$target" "$url_list" "$hints" "$dl_target" "$dl_type"
rc=$?
if [[ $rc == 0 ]] ; then
- debug "libdownload" "dl_handler -- downloaded $url"
- eval debug "\$$dl_target \$$dl_type"
+ $STD_SORCERY_DEBUG "downloaded $url" "target ${!dl_target}" "type
${!dl_type}"
return 0
fi
return 1
@@ -113,14 +112,14 @@ function dl_connect() {

[[ $INTERNET_AUTOCONNECT == on ]] || return 0

- debug "libdownload" "connect()"
+ $STD_SORCERY_DEBUG_HEAD

# We agree that while this lock is held, no other script will be
# connecting or disconnecting internet service out from under us
lock_resources internet signon
for interface in $INTERNET_INTERFACES; do
if ifconfig | grep -q "^$interface" ; then
- debug "libdownload" "connected through $interface"
+ $STD_SORCERY_DEBUG "connected through $interface"
unlock_resources internet signon
return
fi
diff --git a/var/lib/sorcery/modules/libgrimoire
b/var/lib/sorcery/modules/libgrimoire
index e17d365..ace4fa7 100755
--- a/var/lib/sorcery/modules/libgrimoire
+++ b/var/lib/sorcery/modules/libgrimoire
@@ -33,7 +33,8 @@
#---------------------------------------------------------------------
function real_mk_source_dir() {

- debug "libgrimoire" "Running mk_source_dir() on $SOURCE_DIRECTORY"
+ $STD_SORCERY_DEBUG_HEAD
+ $STD_SORCERY_DEBUG "on $SOURCE_DIRECTORY"

local NEW_DIR=$1
local NEW_DIR=${NEW_DIR:=$SOURCE_DIRECTORY}
@@ -65,7 +66,7 @@ function real_rm_source_dir() {
DEAD_DIR=$1
DEAD_DIR=${DEAD_DIR:-$SOURCE_DIRECTORY}

- debug "libgrimoire" "Running rm_source_dir() on $DEAD_DIR"
+ $STD_SORCERY_DEBUG "DEAD_DIR = $DEAD_DIR"

if [ -n "$DEAD_DIR" ] && [ -d "$DEAD_DIR" ]; then

@@ -80,7 +81,7 @@ function real_rm_source_dir() {
local mountloc=$(echo $line | cut -d' ' -f3)
if echo $mountloc | grep -q "^$DEAD_DIR"
then
- debug "libgrimoire" "Unmounting $mount on $mountloc"
+ $STD_SORCERY_DEBUG "Unmounting $mount on $mountloc"
umount -l $mountloc 2> /dev/null
fi
done
@@ -142,7 +143,7 @@ function make() {
JOBS="1" # Use default of one when MAKE_NJOBS is nonsense.
fi

- debug "libgrimoire" "make: running with $JOBS jobs"
+ $STD_SORCERY_DEBUG "make: running with $JOBS jobs"
$REAL_MAKE -j $JOBS -S "$@"

# Cache the result
@@ -166,7 +167,7 @@ function make() {
## @Stdout file name
#---------------------------------------------------------------------
function install_desktop_files() {
- debug "libgrimoire" "Running install_desktop_files() on $SPELL"
+ $STD_SORCERY_DEBUG "SPELL = $SPELL"
local each file
local target_dir="/usr/share/applications"
local desktop_dir="$SCRIPT_DIRECTORY/desktop"
@@ -176,7 +177,7 @@ function install_desktop_files() {
for each in $(find $desktop_dir -maxdepth 1 -type f); do
file=$(basename $each)
if ! test -f "$target_dir/$file" ; then
- debug "libgrimoire" "Installing $file in $target_dir as a desktop file"
+ $STD_SORCERY_DEBUG "Installing $file in $target_dir as a desktop file"
cp $each $target_dir
fi
done
@@ -217,7 +218,7 @@ function private_installed_version() {
#---------------------------------------------------------------------
function real_conflicts() {

- debug "libgrimoire" "Running conflicts() on $1. Default query answer $2."
+ $STD_SORCERY_DEBUG "Running conflicts() on $1. Default query answer $2."

if spell_installed $1; then
[ "$2" = y ] && echo "$1:y" || echo "$1:n"
diff --git a/var/lib/sorcery/modules/libhash b/var/lib/sorcery/modules/libhash
index 2b5c35e..0302643 100755
--- a/var/lib/sorcery/modules/libhash
+++ b/var/lib/sorcery/modules/libhash
@@ -57,7 +57,7 @@ function hash_build_variable_name() {
local ___TABLE="$1"
local ___FIELD="$2"

-# debug "libhash" "hash_build_variable_name() -
TABLE=$___TABLE:FIELD=$___FIELD"
+# $STD_SORCERY_DEBUG "TABLE=$___TABLE:FIELD=$___FIELD"

___TABLE=${___TABLE//\+/_P_}
___TABLE=${___TABLE//\-/_M_}
@@ -99,7 +99,7 @@ function hash_unbuild_field_name() {
___FIELD=${___FIELD%_*}
# `echo "$1" | sed -n "s/^$2\(.*\)_$/\1/p"`

-# debug "libhash" "hash_unbuild_field_name() -
TABLE=$___TABLE:FIELD=$___FIELD"
+# $STD_SORCERY_DEBUG "TABLE=$___TABLE:FIELD=$___FIELD"

___FIELD=${___FIELD//_P_/\+}
___FIELD=${___FIELD//_M_/\-}
@@ -125,7 +125,7 @@ function hash_put() {
local VARIABLE_NAME
hash_build_variable_name "$1" "$2" VARIABLE_NAME
eval "${VARIABLE_NAME}=\"${3}\""
- debug "libhash" "hash_put() - VARIABLE_NAME=$VARIABLE_NAME, data=$3"
+ $STD_SORCERY_DEBUG "VARIABLE_NAME=$VARIABLE_NAME, data=$3"
}


diff --git a/var/lib/sorcery/modules/liblock b/var/lib/sorcery/modules/liblock
index 82ff964..d9a07b6 100755
--- a/var/lib/sorcery/modules/liblock
+++ b/var/lib/sorcery/modules/liblock
@@ -52,7 +52,7 @@ lock_resources()
while ! trylock_resources "$@";
do
local SLEEP=$(( ${RANDOM} % ${MAX_SLEEP} ))
- debug "lock_resources" "process $$ is sleeping ${SLEEP} seconds"
+ $STD_SORCERY_DEBUG "process $$ is sleeping ${SLEEP} seconds"
sleep "${SLEEP}"
done
}
@@ -77,7 +77,7 @@ trylock_resources()
# we replace / with ^
lockfile="${LOCK_DIR}/${lockfile//\//^}"

- debug "trylock_resources" "lockfile=${lockfile}"
+ $STD_SORCERY_DEBUG "lockfile=${lockfile}"

mkdir -p "${LOCK_DIR}"

@@ -165,7 +165,7 @@ clean_resources()
if [ -d "${LOCK_DIR}" ]; then
find "${LOCK_DIR}" -maxdepth 2 -mindepth 2 -name $$ | \
while read file; do
- debug "clean_resources" "removing forgotten lock ${file}"
+ $STD_SORCERY_DEBUG "removing forgotten lock ${file}"
rm -f "${file}" 2>/dev/null &&
rmdir `dirname "${file}"` 2>/dev/null
done
@@ -189,7 +189,7 @@ global_clean_resources()
while read file; do
# check if the process still exist (we use procfs mounted on /proc)
if [ ! -d "${file}" ]; then
- debug "global_clean_resources" "removing stale lock ${file}"
+ $STD_SORCERY_DEBUG "removing stale lock ${file}"
rm -f "${file}" 2>/dev/null &&
rmdir `dirname "${file}"` 2>/dev/null
fi
@@ -212,7 +212,7 @@ global_clean_resources()
#---------------------------------------------------------------------
function lock_file()
{
- debug "liblock" "$FUNCNAME - $*"
+ $STD_SORCERY_DEBUG_HEAD
local FILE
lock_resources $(
for FILE in "$@" ; do
@@ -231,7 +231,7 @@ function lock_file()
#---------------------------------------------------------------------
function unlock_file()
{
- debug "liblock" "$FUNCNAME - $*"
+ $STD_SORCERY_DEBUG
local FILE
unlock_resources $(
for FILE in "$@" ; do
@@ -258,7 +258,7 @@ function unlock_file()
#---------------------------------------------------------------------
function lock_start_transaction()
{
- debug "liblock" "$FUNCNAME - $*"
+ $STD_SORCERY_DEBUG_HEAD
local i TRANSNAME NUMTRANS RET=""

if lock_file "$@" ; then
@@ -301,7 +301,7 @@ function lock_start_transaction()
#---------------------------------------------------------------------
function lock_commit_transaction()
{
- debug "liblock" "$FUNCNAME - $*"
+ $STD_SORCERY_DEBUG_HEAD
local TMP_FILE unlockList=""

lock_file $LOCK_TRANSACTIONS
@@ -346,7 +346,7 @@ function lock_commit_transaction()
#---------------------------------------------------------------------
function lock_kill_transaction()
{
- debug "liblock" "$FUNCNAME - $*"
+ $STD_SORCERY_DEBUG_HEAD
local TMP_FILE

lock_file $LOCK_TRANSACTIONS
@@ -483,7 +483,7 @@ function counter_clean() {
#---------------------------------------------------------------------
SYNCHRONIZE='
__llSYNCH_LINE=$LINENO
- debug "liblock" "+++ in synch code"
+ $STD_SORCERY_DEBUG "+++ in synch code"
lock_resources "lockfunction" "${FUNCNAME}/${__llSYNCH_LINE}"'

#---------------------------------------------------------------------
@@ -493,7 +493,7 @@ SYNCHRONIZE='
##
#---------------------------------------------------------------------
UNSYNCHRONIZE='
- debug "liblock" "+++ in unsynch code"
+ $STD_SORCERY_DEBUG "+++ in unsynch code"
unlock_resources "lockfunction" "${FUNCNAME}/${__llSYNCH_LINE}"
unset __llSYNCH_LINE'

diff --git a/var/lib/sorcery/modules/libmisc b/var/lib/sorcery/modules/libmisc
index a43f9c0..89a07b5 100755
--- a/var/lib/sorcery/modules/libmisc
+++ b/var/lib/sorcery/modules/libmisc
@@ -101,7 +101,7 @@ function isalpha() {
#---------------------------------------------------------------------
function real_query() { (

- debug "libmisc" "Running query() with the following arguments: '$1' and
'$2'"
+ $STD_SORCERY_DEBUG_HEAD

while true ; do

@@ -137,8 +137,7 @@ function real_query() { (
##
#---------------------------------------------------------------------
function real_query_string () {
-
- debug "libmisc" "Running question() with the following arguments: '$1'
and '$2'"
+ $STD_SORCERY_DEBUG_HEAD

local RESPONSE=""
local RETURN=0
@@ -184,34 +183,6 @@ function real_message() {
}

#---------------------------------------------------------------------
-## @param type
-## @param message
-##
-## Enters a debug message if the type of debug message != 'no'
-##
-## The 'type' is usually the name of the file the debug statement
-## comes from. i.e. DEBUG_liblock, DEBUG_libsorcery, DEBUG_cast etc.
-##
-#---------------------------------------------------------------------
-function debug() {
-
- [[ $DEBUG ]] || return 0
-
- local debugVar="DEBUG_${1}"
- local i
- if [[ ${!debugVar} != "no" ]] ; then
- echo -n "$1($$): " >>$DEBUG
- shift
- for i in "$@" ; do
- echo -n " \"$i\"" >>$DEBUG
- done
- echo >>$DEBUG
- fi
-
- true
-}
-
-#---------------------------------------------------------------------
## @Stdout progress spinner
## Displays progress spinner like the one in fsck.
##
@@ -236,7 +207,7 @@ function progress_spinner() {
##</pre>
#---------------------------------------------------------------------
function progress_bar() {
-debug "libmisc" "progress_bar - $*"
+ $STD_SORCERY_DEBUG_HEAD
local percent i len num_dash

if [[ $1 == -dot ]] ; then
@@ -329,9 +300,9 @@ function sound() {
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"
+ $STD_SORCERY_DEBUG "Playing $SOUND_FILE"
else
- debug "libmisc" "Error playing $SOUND_FILE: no such file"
+ $STD_SORCERY_DEBUG "Error playing $SOUND_FILE: no such file"
fi
;;
esac
@@ -444,7 +415,7 @@ function get_dirnames() {
#----------------------------------------------------------------------
function iterate()
{ # $1=callback+args, $2=separator, $3=(opt)string
-# debug "libmisc" "iterate - $@"
+# $STD_SORCERY_DEBUG_HEAD

[ $# -lt 2 ] && return 2

@@ -468,11 +439,11 @@ function iterate()
eval "$func \"$token\""
[[ $BREAK ]] && break
done
-# debug "leftover token: $token"
+# $STD_SORCERY_DEBUG "leftover token: $token"
fi

returnValue=$?
- [[ $BREAK ]] && debug "libmisc" "iterate - I was BREAKed."
+ [[ $BREAK ]] && $STD_SORCERY_DEBUG "iterate - I was BREAKed."
unset BREAK
return $returnValue
}
@@ -1078,7 +1049,7 @@ function remove_files_and_dirs() {
## @param name of the script needing the tmp dir
#---------------------------------------------------------------------
function mk_tmp_dirs() {
- debug "$FUNCNAME" "Making tmp dirs for $$"
+ $STD_SORCERY_DEBUG_HEAD
local SCRIPT_NAME=$1 STATS tmp
SCRIPT_NAME=${SCRIPT_NAME:-misc}

@@ -1232,7 +1203,8 @@ function is_sorcery_var() {
CAST_PASS download_log IW_LOG OPTS SOLO QUIET INSTALL_QUEUE \
OVERRIDE_CFLAGS OVERRIDE_CXXFLAGS OVERRIDE_LDFLAGS NO_OPTIMIZATION_FLAGS \
DOT_PROGRESS VOYEUR_OVERRIDE RECONFIGURE RECAST_DOWN COMPILE RECAST_UP \
- FORCE_DOWNLOAD SOURCE_CACHE SILENT FIX DEBUG SEPARATE BASE_URL \
+ FORCE_DOWNLOAD SOURCE_CACHE SILENT FIX SORCERY_DEBUG
STD_SORCERY_DEBUG_HEAD \
+ STD_SORCERY_DEBUG SEPARATE BASE_URL \
CAST_HASH BACK_CAST_HASH CANNOT_CAST_HASH uncommitted_hash NEW_DEPENDS \
spell_depends DEPENDS_CONFIG UP_DEPENDS SPELL_CONFIG GRIMOIRE_DIR \
SCRIPT_DIRECTORY SECTION_DIRECTORY GRIMOIRE SPELL_DIRECTORY SECTION \
@@ -1282,7 +1254,7 @@ function complain_sorcery_var() {
#-------------------------------------------------------------------
function set_architecture() {

- $STD_DEBUG
+ $STD_SORCERY_DEBUG_HEAD
local specdir
local i j
unset SPECFILE
@@ -1296,7 +1268,7 @@ function set_architecture() {
[[ $CROSS_INSTALL == on ]] &&
[[ $TARGET ]]
then
- debug "libmisc" "set_architecture: using cross-install's target arch"
+ $STD_SORCERY_DEBUG "using cross-install's target arch"
arch=${arch:-$TARGET}
fi

@@ -1323,7 +1295,7 @@ function set_architecture() {
message "${PROBLEM_COLOR}Cannot find arch spec for $arch!"
return 1
fi
- debug "libmisc" "set_architecture: SPECFILE=$SPECFILE"
+ $STD_SORCERY_DEBUG "SPECFILE=$SPECFILE"

# turn the path into an array, but remove $specdir from the start first
unset SMGL_COMPAT_ARCHS
@@ -1348,11 +1320,11 @@ function set_architecture() {
## to override a bunch of functions which have already been defined.
#---------------------------------------------------------------------
function define_functions() {
+ $STD_SORCERY_DEBUG_HEAD
local funcName
local funcContent="$1"
shift
for funcName in $* ; do
- debug "libmisc" "define_functions - redefining $funcName"
eval "function $funcName () { \
$funcContent \
}"
@@ -1471,14 +1443,6 @@ function envar_prepend_path()
fi
}

-
-# Standard debug line:
-# file "function@line" "all" "args"
-STD_DEBUG='eval local _stddbg_file=${BASH_SOURCE[0]} ;
- _stddbg_file=${_stddbg_file##*/};
- debug "${_stddbg_file}" "${FUNCNAME[0]}@$LINENO" "$@"'
-
-
#---------------------------------------------------------------------
## @License
##
diff --git a/var/lib/sorcery/modules/libresurrect
b/var/lib/sorcery/modules/libresurrect
index b74a6d1..0d4cf43 100755
--- a/var/lib/sorcery/modules/libresurrect
+++ b/var/lib/sorcery/modules/libresurrect
@@ -16,7 +16,7 @@
## test -f $INSTALL_CACHE/$SPELL-$VERSION-$HOST.tar.bz2
#---------------------------------------------------------------------
function can_resurrect() {
- debug "libresurrect" "can_resurrect - $*"
+ $STD_SORCERY_DEBUG_HEAD
local SPELL=$1
local VERSION=$2

@@ -24,7 +24,7 @@ function can_resurrect() {
local file=$INSTALL_CACHE/$SPELL-$VERSION-$HOST.tar$EXTENSION &&
test -f $file &&
echo $file &&
- debug "libresurrect" "I am able to resurrect." &&
+ $STD_SORCERY_DEBUG "I am able to resurrect." &&
return 0
}

@@ -69,7 +69,7 @@ function can_resurrect() {
# FIXME: some of the informative message calls might work better as debug
messages
#------------------------------------------------------------------------
function resurrect() { (
- debug "libresurrect" "resurrect - $*"
+ $STD_SORCERY_DEBUG_HEAD
local SPELL=$1
local VERSION=$2

@@ -79,7 +79,7 @@ function resurrect() { (
}

if [[ ! $VERSION ]] ; then
- debug libresurrect "No spell version passed in"
+ $STD_SORCERY_DEBUG "No spell version passed in"
return 1
fi

@@ -104,7 +104,7 @@ function resurrect() { (

mkdir -p $BUILD_DIRECTORY &&
mk_source_dir $RESURRECT_DIR || {
- debug "libresurrect" "Failed to make $RESURRECT_DIR"
+ $STD_SORCERY_DEBUG "Failed to make $RESURRECT_DIR"
resurrect_fail
return 1
}
@@ -192,7 +192,7 @@ function resurrect() { (
tablet_find_resurrect_dir $SPELL OLD_TABLET_DIR
local TMP_VERSION=$VERSION
if [[ $OLD_TABLET_DIR ]] && test -d $OLD_TABLET_DIR ; then
- debug "libresurrect" "loading tablet at $OLD_TABLET_DIR"
+ $STD_SORCERY_DEBUG "loading tablet at $OLD_TABLET_DIR"
tablet_set_spell $SPELL $OLD_TABLET_DIR || {
message "something is wrong with $OLD_TABLET_DIR"
returrect_fail
@@ -203,7 +203,7 @@ function resurrect() { (
tablet_get_section_filter "$OLD_TABLET_DIR" configs
GRIMOIRE_CONFIG_FILTER
else
unset $OLD_TABLET_DIR
- debug "libresurrect" "no tablet"
+ $STD_SORCERY_DEBUG "no tablet"
codex_set_current_spell_by_name $SPELL
SPELL_CONFIG_FILTER=$SCRIPT_DIRECTORY/configs
SECTION_CONFIG_FILTER=$SECTION_DIRECTORY/configs
@@ -310,7 +310,7 @@ function resurrect_sub() {
# 10) if theres a PRE_RESURRECT run it or fail/rollback
if test -x $SCRIPT_DIRECTORY/PRE_RESURRECT ; then
. $SCRIPT_DIRECTORY/PRE_RESURRECT || {
- debug "libresurrect" "PRE_RESURRECT failed"
+ $STD_SORCERY_DEBUG "PRE_RESURRECT failed"
resurrect_fail 1
return 1
}
@@ -332,7 +332,7 @@ function resurrect_sub() {
test -h ".$line" && echo .$line ||
test -d ".$line" || echo .$line
done | sort | tar -cT - | tar -xvf - -C ${INSTALL_ROOT:-/} || {
- debug "libresurrect" "Failed to install regular files"
+ $STD_SORCERY_DEBUG "Failed to install regular files"
resurrect_fail 1
return 1
}
@@ -344,7 +344,7 @@ function resurrect_sub() {

local res_fail=0 BREAK
function resurrect_install_conf_sub() {
- debug libresurrect "resurrect_install_conf_sub -- $@"
+ $STD_SORCERY_DEBUG "resurrect_install_conf_sub -- $@"
test -d ".$1" ||
internal_install_config_file ".$1" "${INSTALL_ROOT}${1}" $savetime \
"$OLD_MD5_LOG" || {
@@ -355,7 +355,7 @@ function resurrect_sub() {
iterate resurrect_install_conf_sub $'\n' "$(<$NEW_DATA_F_C)"

[[ $res_fail == 0 ]] || {
- debug "libresurrect" "Failed to install config files"
+ $STD_SORCERY_DEBUG "Failed to install config files"
resurrect_fail 1
return 1
}
@@ -442,7 +442,7 @@ function internal_install_config_file()
local savetime=$3
local md5_log=$4

- debug libresurrect "$FUNCNAME -- $@"
+ $STD_SORCERY_DEBUG_HEAD
# if its a symlink, just copy, someday maybe we should figure
# out where it points to and so something, but thats too annoying
if test -h "$from" ; then
@@ -589,7 +589,7 @@ function resurrect_success() {
ln $COMPILE_LOG -sf $new_tablet/logs/compile
find $new_tablet > $TMP_INSTALL_LOG_STATE # relative to STATE_ROOT
else
- debug "libresurrect" "WARNING: unable to make tablet for $SPELL, oh
well"
+ $STD_SORCERY_DEBUG "WARNING: unable to make tablet for $SPELL, oh well"
fi
fi

diff --git a/var/lib/sorcery/modules/libscreen
b/var/lib/sorcery/modules/libscreen
index db635e5..516d375 100755
--- a/var/lib/sorcery/modules/libscreen
+++ b/var/lib/sorcery/modules/libscreen
@@ -19,7 +19,7 @@ function screen_quick_intro() {
## arguments.
#-----
function screen_start() {
- $STD_DEBUG
+ $STD_SORCERY_DEBUG_HEAD
local name="$1"
local screen
shift
@@ -38,7 +38,7 @@ function screen_start() {
## The .!!| args to exec were determined by trial and error. ::: didn't work.
#-----
function screen_command() {
- $STD_DEBUG
+ $STD_SORCERY_DEBUG_HEAD
local name="$1"
shift
screen -x "$name" -X exec '.!!|' echo "$@"
@@ -62,7 +62,7 @@ function screen_command() {
## They are actualy window numbers in disguise
#-----
function screen_new_window() {
- $STD_DEBUG
+ $STD_SORCERY_DEBUG_HEAD
local screen_name="$1"
local win_num="$2"
local win_name="$3"
@@ -80,7 +80,7 @@ function screen_new_window() {
## Default escape code is ^A.
#-----
function screen_attach() {
- $STD_DEBUG
+ $STD_SORCERY_DEBUG_HEAD
screen -r "$1" $SCREEN_KEY &
}

@@ -89,7 +89,7 @@ function screen_attach() {
## Detaches the named screen session from the tty.
#-----
function screen_detach() {
- $STD_DEBUG
+ $STD_SORCERY_DEBUG_HEAD
screen -x "$1" -X detach
}

@@ -100,7 +100,7 @@ function screen_detach() {
## closed
#-----
function screen_kill_window() {
- $STD_DEBUG
+ $STD_SORCERY_DEBUG_HEAD
screen -x "$1" -p "$2" -X kill
sleep $SCREEN_ANTI_RACE_SLEEP
screen_notify "$1" "$2 ended"
@@ -114,7 +114,7 @@ function screen_kill_window() {
## Give an existing window a new name
#-----
function screen_name_window() {
- $STD_DEBUG
+ $STD_SORCERY_DEBUG_HEAD
screen -x "$1" -p "$2" -X title "$3"
sleep $SCREEN_ANTI_RACE_SLEEP
}
@@ -125,7 +125,7 @@ function screen_name_window() {
## There are race conditions aplenty if you're not careful
#-----
function screen_name_curr_window() {
- $STD_DEBUG
+ $STD_SORCERY_DEBUG_HEAD
screen -x "$1" -X title "$2"
sleep $SCREEN_ANTI_RACE_SLEEP
}
@@ -136,7 +136,7 @@ function screen_name_curr_window() {
## Notify the user of something happening using the status bar
#-----
function screen_notify() {
- $STD_DEBUG
+ $STD_SORCERY_DEBUG_HEAD
screen -x "$1" -X echo "$@"
sleep $SCREEN_ANTI_RACE_SLEEP
}
@@ -148,7 +148,7 @@ function screen_notify() {
## in the window.
#-----
function screen_monitor_window() {
- $STD_DEBUG
+ $STD_SORCERY_DEBUG_HEAD
screen -x "$1" -p "$2" -X monitor on
sleep $SCREEN_ANTI_RACE_SLEEP
}
@@ -159,7 +159,7 @@ function screen_monitor_window() {
## Stops a window from being monitored
#-----
function screen_unmonitor_window() {
- $STD_DEBUG
+ $STD_SORCERY_DEBUG_HEAD
screen -x "$1" -p "$2" -X monitor off
sleep $SCREEN_ANTI_RACE_SLEEP
}
@@ -170,7 +170,7 @@ function screen_unmonitor_window() {
## Changes the window the user sees
#-----
function screen_switch_window() {
- $STD_DEBUG
+ $STD_SORCERY_DEBUG_HEAD
screen -x "$1" -X select "$2"
sleep $SCREEN_ANTI_RACE_SLEEP
}
@@ -180,7 +180,7 @@ function screen_switch_window() {
## Ends the screen session. Should end all processes running in the screen.
#-----
function screen_quit() {
- $STD_DEBUG
+ $STD_SORCERY_DEBUG_HEAD
screen -x "$1" -X quit
}

@@ -192,7 +192,7 @@ function screen_quit() {
## If something is already at that number, it swaps them
#-----
function screen_move_window() {
- $STD_DEBUG
+ $STD_SORCERY_DEBUG_HEAD
screen -x "$1" -p "$2" -X number "$3"
sleep $SCREEN_ANTI_RACE_SLEEP
}
@@ -203,7 +203,7 @@ function screen_move_window() {
## Sets the time screen shows messages for
#-----
function screen_set_msgwait() {
- $STD_DEBUG
+ $STD_SORCERY_DEBUG_HEAD
screen -x "$1" -X msgwait $2
sleep $SCREEN_ANTI_RACE_SLEEP
}
diff --git a/var/lib/sorcery/modules/libsorcery
b/var/lib/sorcery/modules/libsorcery
index b37ddb4..f218ebe 100755
--- a/var/lib/sorcery/modules/libsorcery
+++ b/var/lib/sorcery/modules/libsorcery
@@ -22,7 +22,7 @@ function update_sorcery_scripts() {

local BRANCH=$1

- debug "libsorcery" "update_sorcery_scripts() (sorcery-$BRANCH)"
+ $STD_SORCERY_DEBUG "sorcery-$BRANCH"

{
#This section is to make sure that all sorcery dependencies are cast
@@ -182,7 +182,7 @@ function report() {

if [ "$VIEW_REPORTS" == "on" ]; then

- debug "libsorcery" "Prompting to view $2 for $SPELL"
+ $STD_SORCERY_DEBUG "Prompting to view $2 for $SPELL"

VIEW_PROMPT="View $2 for
${SPELL_COLOR}${SPELL}-${VERSION_COLOR}${VERSION}${DEFAULT_COLOR}?"
sound REPORT
@@ -190,7 +190,7 @@ function report() {
fi

if [ "$MAIL_REPORTS" == "on" ]; then
- debug "libsorcery" "Mailing report ($2) for $SPELL to $SORCERER"
+ $STD_SORCERY_DEBUG "Mailing report ($2) for $SPELL to $SORCERER"
date -u |
mail -s "Sorcery Report : $HOSTNAME : $2 for $SPELL-$VERSION" \
-a $1 $SORCERER 2>/dev/null
@@ -212,7 +212,7 @@ function guess_filename() {

FILENAME=$1

- debug "libsorcery" "Running guess_filename() on $FILENAME"
+ $STD_SORCERY_DEBUG "FILENAME = $FILENAME"

BASENAME=`echo $FILENAME |
sed "s/\.tar\.gz$//" |
@@ -250,7 +250,7 @@ function save_libraries() {
then return
fi

- debug "libsorcery" "Running save_libraries()"
+ $STD_SORCERY_DEBUG_HEAD

OLD_LIBS=$SOURCE_DIRECTORY/old.libraries
mkdir -p $OLD_LIBS
@@ -308,7 +308,7 @@ function save_binaries() {
then return
fi

- debug "libsorcery" "Running save_binaries()"
+ $STD_SORCERY_DEBUG_HEAD

OLD_BINS=$SOURCE_DIRECTORY/old.binaries
mkdir -p $OLD_BINS
@@ -371,7 +371,7 @@ function release_saved_libraries() {
#---------------------------------------------------------------------
function spell_recover() {

- debug "libsorcery" "Running spell_recover()"
+ $STD_SORCERY_DEBUG_HEAD

message "${MESSAGE_COLOR}Aborting dispel of ${SPELL_COLOR}${SPELL}" \
"${MESSAGE_COLOR} and recovering${DEFAULT_COLOR}"
@@ -415,7 +415,7 @@ function spell_recover() {
#---------------------------------------------------------------------
function find_section() {

- debug "libsorcery" "Running find_section() on $1"
+ $STD_SORCERY_DEBUG_HEAD

codex_get_spell_section_name $1

@@ -594,13 +594,13 @@ function filter_generic() {
local grimoire_filter section_filter spell_filter spell_dir
if [[ $spell_from == "codex" ]]
then
- debug libsorcery "filter_generic codex at : $SCRIPT_DIRECTORY "
+ $STD_SORCERY_DEBUG "filter_generic codex at : $SCRIPT_DIRECTORY "
grimoire_filter=$GRIMOIRE/$filter_name
section_filter=$SECTION_DIRECTORY/$filter_name
spell_filter=$SCRIPT_DIRECTORY/$filter_name
else
if tablet_find_spell_dir $SPELL spell_dir &>/dev/null; then
- debug libsorcery "filter_generic tablet at : $spell_dir "
+ $STD_SORCERY_DEBUG "filter_generic tablet at : $spell_dir "
tablet_get_spell_filter "$spell_dir" "$filter_name" spell_filter
&>/dev/null
tablet_get_section_filter "$spell_dir" "$filter_name" section_filter
&>/dev/null
tablet_get_grimoire_filter "$spell_dir" "$filter_name" grimoire_filter
&>/dev/null
@@ -757,7 +757,7 @@ function push_remove_queue() {
##
#---------------------------------------------------------------------
function optimize() {
- debug "libsorcery" "In optimize()"
+ $STD_SORCERY_DEBUG_HEAD

unset CFLAGS CXXFLAGS LDFLAGS CPPFLAGS
unset COMBRELOC FAST PRELINK RISKY SMALL SPEEDY STRIP TINY
@@ -771,12 +771,12 @@ function optimize() {
export CPPFLAGS="$OVERRIDE_CPPFLAGS"
else
set_architecture
- debug "ARCHITECTURE='${ARCHITECTURE}'"
- debug "libsorcery" "TARGET='${TARGET}'"
- debug "libsorcery" "OPTIMIZATIONS='${OPTIMIZATIONS}'"
+ $STD_SORCERY_DEBUG "ARCHITECTURE='${ARCHITECTURE}'"
+ $STD_SORCERY_DEBUG "TARGET='${TARGET}'"
+ $STD_SORCERY_DEBUG "OPTIMIZATIONS='${OPTIMIZATIONS}'"
BUILD=${HOST}

- debug "libsorcery" "BUILD is $BUILD, HOST is $HOST"
+ $STD_SORCERY_DEBUG "BUILD is $BUILD, HOST is $HOST"

CFLAGS="$CFLAGS -pipe"
for PARAM in $OPTIMIZATIONS; do
@@ -1176,7 +1176,7 @@ function clean_logs() {

message "${CHECK_COLOR}Cleaning log files... ${DEFAULT_COLOR} "

- debug "libsorcery" "Running clean_logs()"
+ $STD_SORCERY_DEBUG_HEAD

LOGS=`log_list`

@@ -1230,7 +1230,7 @@ function activity_log() { (
##
#---------------------------------------------------------------------
function run_details() {
- debug "libsorcery" "starting run_details for $SPELL"
+ $STD_SORCERY_DEBUG "SPELL = $SPELL"
if ! codex_set_current_spell_by_name $SPELL; then
local GRIMOIRES=`codex_get_all_grimoires`
message "${PROBLEM_COLOR}Unable to find spell" \
@@ -1279,7 +1279,7 @@ function unset_details() {
#---------------------------------------------------------------------
function boost() {

- debug "libsorcery" "Running boost() on $SPELL THIS IS DEPRECIATED"
+ $STD_SORCERY_DEBUG "Running boost() on $SPELL THIS IS DEPRECIATED"
echo "Running boost() on $SPELL THIS IS DEPRECIATED, please contact the
spell's maintainer and ask them to remove this call"
true
}
@@ -1394,7 +1394,7 @@ function generate_keep_list() {
#---------------------------------------------------------------------
function prune() {

- debug "libsorcery" "Running prune()"
+ $STD_SORCERY_DEBUG_HEAD
local NO_KEEP
local NUM_NO_KEEP=0

diff --git a/var/lib/sorcery/modules/libstate
b/var/lib/sorcery/modules/libstate
index 0fb6af7..92bc2f0 100755
--- a/var/lib/sorcery/modules/libstate
+++ b/var/lib/sorcery/modules/libstate
@@ -25,7 +25,7 @@
#---------------------------------------------------------------------
function add_depends()
{ # $1=depends file $2=spell, $3=depends, $4=on/off, $5=optional/required,
$6=on arg, $7=off arg
- debug "libstate" "add_depends() - $*"
+ $STD_SORCERY_DEBUG_HEAD

#already here for some reason
search_depends_status_exact "$@" >/dev/null && return 0
@@ -76,7 +76,7 @@ function search_depends_status_exact()

local a1 a2 a3 a4 a5 a6
a1=`esc_str "$1"` ; a2=`esc_str "$2"` ; a3=`esc_str "$3"` ; a4=`esc_str
"$4"`; a5=`esc_str "$5"`; a6=`esc_str "$6"`
- debug "libstate" "search_depends_status_exact: [$a1:$a2:$a3:$a4:$a5:$a6]"
+ $STD_SORCERY_DEBUG "search_depends_status_exact: [$a1:$a2:$a3:$a4:$a5:$a6]"
grep "^$a1:$a2:$a3:$a4:$a5:$a6$" $depends_status

}
@@ -164,7 +164,7 @@ function get_depends_options()
}

local START="$(esc_str $1)"
- debug "libstate" "get_depends_options() - START=$START"
+ $STD_SORCERY_DEBUG "get_depends_options() - START=$START"
awk -F ':' -v start=$START "{ if (\$1 == start) if (\$3 == \"on\") OPTS =
OPTS \" \" \$5; else OPTS = OPTS \" \" \$6; } END { print OPTS; }"
$depends_status 2> /dev/null
}

@@ -366,7 +366,7 @@ function remove_sub_depends() {
##
#---------------------------------------------------------------------
function add_default_depends() {
- debug "libstate" "add_default_depends() - $*"
+ $STD_SORCERY_DEBUG_HEAD

#already here
search_default_depends "$@" >/dev/null && return 0
@@ -443,7 +443,7 @@ function search_default_depends() {
a1=`esc_str "$1"` ; a2=`esc_str "$2"` ; a3=`esc_str "$3"`
a3=${a3:-.*}

- debug "libstate" "search_default_depends: [$a1:$a2:$a3]"
+ $STD_SORCERY_DEBUG "search_default_depends: [$a1:$a2:$a3]"
grep "^$a1:$a2:$a3$" $default_depends
}

@@ -459,7 +459,7 @@ function search_default_depends() {
##
#---------------------------------------------------------------------
function add_default_provider() {
- debug "libstate" "add_default_depends() - $*"
+ $STD_SORCERY_DEBUG_HEAD

#already here
search_default_provider "$@" >/dev/null && return 0
@@ -711,7 +711,7 @@ function remove_spell_status()
##
#---------------------------------------------------------------------
function remove_spell() {
- debug "libsorcery" "Running remove_spell() on $1"
+ $STD_SORCERY_DEBUG "Running remove_spell() on $1"
remove_spell_status $1
if [ -n "$EXILE" ]; then
add_spell_status $1 "exiled" "0.0"
@@ -848,7 +848,7 @@ function get_all_spells_with_status () {
##
#---------------------------------------------------------------------
function modify_local_config() {
- debug "libstate" "modify_local_config() - $*"
+ $STD_SORCERY_DEBUG_HEAD
modify_config $LOCAL_CONFIG "$@"
}

@@ -866,12 +866,12 @@ function modify_local_config() {
#---------------------------------------------------------------------
function modify_config() {

- debug "libstate" "modify_config() - $*"
+ $STD_SORCERY_DEBUG_HEAD
local FILE=$1
shift;

if ! [[ $1 ]]; then
- debug "libstate" "modify_config() - Warning: No name given for config
option."
+ $STD_SORCERY_DEBUG "Warning: No name given for config option."
return 1
fi

@@ -908,7 +908,7 @@ function modify_config() {
TEMP="$TEMP "
done

- debug "libstate" "modify_config() - entering new value $VARIABLE
$seperator $@ into $tFILE"
+ $STD_SORCERY_DEBUG "entering new value $VARIABLE $seperator $@ into $tFILE"
# put new value and justification in
echo "${TEMP}${1}${separator}\"$2\"" >> $tFILE

@@ -928,12 +928,12 @@ function modify_config() {
#---------------------------------------------------------------------
function remove_config() {

- debug "libstate" "remove_config() - $*"
+ $STD_SORCERY_DEBUG_HEAD
local FILE=$1
shift;

if ! [[ $1 ]]; then
- debug "libstate" "remove_config() - Warning: No name given for config
option."
+ $STD_SORCERY_DEBUG "Warning: No name given for config option."
return 1
fi

diff --git a/var/lib/sorcery/modules/libsummon
b/var/lib/sorcery/modules/libsummon
index 0ba7356..bfaa8c9 100755
--- a/var/lib/sorcery/modules/libsummon
+++ b/var/lib/sorcery/modules/libsummon
@@ -33,7 +33,7 @@ function summon_spell() {
if [ -n "${SPELL}" ] && lock_resources "summon" "${SPELL}"; then
#local dl_dir=/tmp/sorcery/summon/${SPELL:-none}
local dl_dir=$TMP_DIR/${SPELL:-none}
- debug "libsummon" "dl_dir is $dl_dir"
+ $STD_SORCERY_DEBUG "dl_dir is $dl_dir"
mkdir -p $dl_dir && pushd $dl_dir &>/dev/null &&

# run in a subshell rather than try to unset_details
@@ -397,7 +397,7 @@ function unpack_for_update() {
if test -f $SOURCE_CACHE/$target && ! list_find "$hints" no_update; then
unpack_file_simple $target || return 1
if ! test -d "$_new_target" ; then
- debug "libsummon" "unpacked $target but to somewhere strange"
+ $STD_SORCERY_DEBUG "unpacked $target but to somewhere strange"
fi
fi
else
diff --git a/var/lib/sorcery/modules/libtablet
b/var/lib/sorcery/modules/libtablet
index 1caa2b5..1e09f58 100755
--- a/var/lib/sorcery/modules/libtablet
+++ b/var/lib/sorcery/modules/libtablet
@@ -687,7 +687,7 @@ function tablet_check_repair_file() {
message "$tablet_file\nwith repair file \n$repair_file"
cp $repair_file $tablet_file
else
- debug libtablet "Tablet Repair: not replacing $tablet_file with
$repair_file ($repair, $codex_md5, $tablet_md5)"
+ $STD_SORCERY_DEBUG "Tablet Repair: not replacing $tablet_file with
$repair_file ($repair, $codex_md5, $tablet_md5)"
fi
}

diff --git a/var/lib/sorcery/modules/libtrack
b/var/lib/sorcery/modules/libtrack
index c6e2169..b433edb 100755
--- a/var/lib/sorcery/modules/libtrack
+++ b/var/lib/sorcery/modules/libtrack
@@ -175,7 +175,7 @@ function parse_iw() {
##
#---------------------------------------------------------------------
function create_install_log() {
- debug "libtrack" "$FUNCNAME on $SPELL"
+ $STD_SORCERY_DEBUG "SPELL = $SPELL"
local INPUT=$1
local OUTPUT=$2

@@ -209,14 +209,14 @@ function create_install_log() {
function create_md5list() {
local INPUT=$1
local OUTPUT=$2
- debug "libtrack" "$FUNCNAME on $SPELL"
+ $STD_SORCERY_DEBUG "SPELL = $SPELL"

[[ $__MODIFIED_FILES ]] || export
__MODIFIED_FILES="$TMP_DIR/modified_files"
touch $__MODIFIED_FILES
filter "$__MODIFIED_FILES" < $INPUT | while read LINE ; do
- debug "libtrack" "Checking file $LINE"
+ $STD_SORCERY_DEBUG "Checking file $LINE"
if [ -f "$LINE" ] ; then
- debug "libtrack" "Running md5 on $LINE"
+ $STD_SORCERY_DEBUG "Running md5 on $LINE"
md5sum "$LINE"
fi
done 2>/dev/null > $OUTPUT
@@ -280,12 +280,12 @@ function check_if_modified() {
#---------------------------------------------------------------------
function create_cache_archive() {

- debug "libtrack" "$FUNCNAME on $SPELL"
+ $STD_SORCERY_DEBUG "SPELL = $SPELL"
if [ "$ARCHIVE" == "off" ]; then
- debug "libtrack" "$FUNCNAME - ARCHIVE=$ARCHIVE, aborting archival."
+ $STD_SORCERY_DEBUG "ARCHIVE=$ARCHIVE, aborting archival."
return
fi
- debug "libtrack" "$FUNCNAME - ARCHIVE=$ARCHIVE, archiving."
+ $STD_SORCERY_DEBUG "ARCHIVE=$ARCHIVE, archiving."
local input=$1
local CACHE=$2
local CACHE_COMP=$3
@@ -506,7 +506,7 @@ function make_safe_dir() { (
RANDOM=$(date "+%N")
TMP_SSF=$TMP_DIR/$RANDOM
sleep .1
- debug "libtrack" "safe dir collision on $TMP_SSF"
+ $STD_SORCERY_DEBUG "safe dir collision on $TMP_SSF"
done
echo $TMP_SSF
return 0
diff --git a/var/lib/sorcery/modules/libtriggers
b/var/lib/sorcery/modules/libtriggers
index 50a3c73..d133c97 100755
--- a/var/lib/sorcery/modules/libtriggers
+++ b/var/lib/sorcery/modules/libtriggers
@@ -16,7 +16,7 @@
## executable, runs it.
#---------------------------------------------------------------------
function run_triggers() {
- debug "libtriggers" "Starting run_triggers() on $SPELL"
+ $STD_SORCERY_DEBUG "SPELL = $SPELL"

run_spell_file TRIGGERS triggers

@@ -31,7 +31,7 @@ function run_triggers() {
#---------------------------------------------------------------------
function remove_triggers ()
{
- debug "libtriggers" "remove_triggers - $*"
+ $STD_SORCERY_DEBUG_HEAD

[ -f $TRIGGER_LIST ] || return 0
tTRIGGER_LIST=`lock_start_transaction $TRIGGER_LIST`
@@ -54,7 +54,7 @@ function remove_triggers ()
#---------------------------------------------------------------------
function trigger ()
{
- debug "libtriggers" "trigger - $*"
+ $STD_SORCERY_DEBUG_HEAD

local spell TRIGGER action
action=$1
@@ -101,7 +101,7 @@ function get_run_script_triggers() {
function set_trigger ()
{ #1==trigger to set, $2==spell that triggers it, $3=action,
$4==(optional)spell this is for

- debug "libtriggers" "set_trigger - $*"
+ $STD_SORCERY_DEBUG_HEAD

local str spell
[[ $4 ]] || [[ $SPELL ]] || return 1
diff --git a/var/lib/sorcery/modules/libunpack
b/var/lib/sorcery/modules/libunpack
index 4202ee7..db9815f 100755
--- a/var/lib/sorcery/modules/libunpack
+++ b/var/lib/sorcery/modules/libunpack
@@ -120,7 +120,7 @@
##
#---------------------------------------------------------------------
function real_unpack_file() {
- debug "libgrimoire" "real_unpack_file - $*"
+ $STD_SORCERY_DEBUG_HEAD

local FILENUM="$1"
local SVAR="SOURCE${FILENUM}"
@@ -128,13 +128,13 @@ function real_unpack_file() {
real_verify_file "$@"
rc=$?
case "$rc" in
- 200) debug "libunpack" "unable to verify $SVAR ${!SVAR}" ;;
+ 200) $STD_SORCERY_DEBUG "unable to verify $SVAR ${!SVAR}" ;;
1) return 1 ;; # verification failed
0) uncompress_unpack ${!SVAR}; return $? ;;
esac

if false; then # <------ here's the switch to disable oldworld -------
- debug "libgrimoire" "falling back to missing verification"
+ $STD_SORCERY_DEBUG "falling back to missing verification"
unpack_missing "${!SVAR}"
rc="$?"
case "$rc" in
@@ -142,7 +142,7 @@ function real_unpack_file() {
*) return "$rc" ;;
esac
else
- debug "libgrimoire" "falling back to regular MD5[]"
+ $STD_SORCERY_DEBUG "falling back to regular MD5[]"
local MD5NUM="$([ -z "$FILENUM" ] && echo 0 || echo "$(($FILENUM - 1))")"
real_unpack "${!SVAR}" "${MD5[$MD5NUM]}"
fi
@@ -157,14 +157,14 @@ function real_unpack_file() {
## system.
#---------------------------------------------------------------------
function real_verify_file() {
- debug "libunpack" "real_verify_file - $*"
+ $STD_SORCERY_DEBUG_HEAD

local FILENUM="$1"
local SVAR="SOURCE${FILENUM}"

local crypto_func
for crypto_func in GPG HASH IGNORE; do
- debug "libgrimoire" "checking $crypto_func verification"
+ $STD_SORCERY_DEBUG "checking $crypto_func verification"

local AVAR="SOURCE${FILENUM}_${crypto_func}"
[[ -n ${!AVAR} ]] || continue
@@ -175,7 +175,7 @@ function real_verify_file() {
rc="$?"

case "$rc" in
- 200) debug "libgrimoire" "unable to verify $AVAR with $crypto_func" ;;
+ 200) $STD_SORCERY_DEBUG "unable to verify $AVAR with $crypto_func" ;;
*) return $rc ;;
esac

@@ -195,7 +195,7 @@ function real_verify_file() {
##
#---------------------------------------------------------------------
function uncompress_core() {
- debug "libgrimoire" "uncompress_core - $*"
+ $STD_SORCERY_DEBUG_HEAD

case "$2" in
bzip2) bzip2 -cdf "$1" ;;
@@ -221,7 +221,7 @@ function uncompress_core() {
##
#---------------------------------------------------------------------
function unpack_core() {
- debug "libgrimoire" "unpack_core - $*"
+ $STD_SORCERY_DEBUG_HEAD

case "$2" in
bzip2|gzip|compress*|tar)
@@ -253,7 +253,7 @@ function real_guess_compressor() {
local COMPRESSOR="$(echo "$OUTPUT" | cut -d ' ' -f1)"
[ "$COMPRESSOR" = "GNU" -o "$COMPRESSOR" = "POSIX" ] &&
COMPRESSOR="$(echo "$OUTPUT" | cut -d ' ' -f2)"
- debug "libgrimoire" "guess_compressor() - guessed $1 compressor
<$COMPRESSOR>"
+ $STD_SORCERY_DEBUG "guess_compressor() - guessed $1 compressor
<$COMPRESSOR>"
echo "$COMPRESSOR"
}

@@ -276,7 +276,7 @@ function real_uncompress() { uncompress_
##
#---------------------------------------------------------------------
function unpack_spell_required() {
- debug "libgrimoire" "Running unpack_spell_required -- $1"
+ $STD_SORCERY_DEBUG "Running unpack_spell_required -- $1"

local x
if ! spell_ok "$1" && ! smgl_which $2 x &> /dev/null; then
@@ -372,7 +372,7 @@ function is_allowed_hash() {
##
#---------------------------------------------------------------------
function unpack_gpg() {
- debug "libgrimoire" "Running unpack_gpg -- $*"
+ $STD_SORCERY_DEBUG_HEAD

local FILENAME="$( guess_filename "$SOURCE_CACHE/$1" )"
local PFNAME="$( echo "$2" | cut -d: -f1 )"
@@ -430,7 +430,7 @@ function unpack_gpg() {
##
#---------------------------------------------------------------------
function unpack_hash() {
- debug "libgrimoire" "Running unpack_hash() on $1"
+ $STD_SORCERY_DEBUG "Running unpack_hash() on $1"

local FILENAME="$( guess_filename "$SOURCE_CACHE/$1" )"
local ALGORITHM="$( echo "$2" | cut -d: -f1 )"
@@ -536,7 +536,7 @@ function unpack_file_user_query() {
##
#---------------------------------------------------------------------
function unpack_ignore() {
- debug "libgrimoire" "Running unpack_ignore() on $1"
+ $STD_SORCERY_DEBUG "Running unpack_ignore() on $1"

REASON="$2"

@@ -570,7 +570,7 @@ ask_risky|ask_ignore) query "Abort?" "n
##
#---------------------------------------------------------------------
function unpack_missing() {
- debug "libgrimoire" "Running unpack_missing() on $1"
+ $STD_SORCERY_DEBUG "Running unpack_missing() on $1"

message "${PROBLEM_COLOR}Missing check for source file $1!${DEFAULT_COLOR}"

@@ -598,7 +598,7 @@ function unpack_missing() {
##
#---------------------------------------------------------------------
function uncompress_unpack() {
- debug "libgrimoire" "Running uncompress_unpack() on $1"
+ $STD_SORCERY_DEBUG "Running uncompress_unpack() on $1"

FILENAME="$( guess_filename "$SOURCE_CACHE/$1" )" &&
COMPRESSOR="$( guess_compressor "$FILENAME" )"
@@ -636,7 +636,7 @@ function real_unpack_file_simple() { unc
##
#---------------------------------------------------------------------
function locate_spell_file() {
- debug "libgrimoire" "Running locate_spell_file() $2 on $1"
+ $STD_SORCERY_DEBUG "Running locate_spell_file() $2 on $1"

# checks in any case
[ -f "$SPELL_DIRECTORY/$1" ] && echo "$SPELL_DIRECTORY/$1" && return 0
@@ -670,7 +670,7 @@ function locate_spell_file() {
##
#---------------------------------------------------------------------
function real_unpack() {
- debug "libgrimoire" "Running unpack -- $*"
+ $STD_SORCERY_DEBUG_HEAD

message "${MESSAGE_COLOR}Unpacking source file ${SPELL_COLOR}${1}" \
"${DEFAULT_COLOR}${MESSAGE_COLOR}for spell${SPELL_COLOR}" \
@@ -759,7 +759,7 @@ ask_risky|ask_ignore) query "Abort?" "n
##
#---------------------------------------------------------------------
function uncompress_md5() {
- debug "libgrimoire" "uncompress_md5 - $*"
+ $STD_SORCERY_DEBUG_HEAD

# This is here so Duff's super debugging info doesn't screw the next step
up
set +x
@@ -792,29 +792,29 @@ function uncompress_md5() {
##
#---------------------------------------------------------------------
function md5_tar_check() {
- debug "libgrimoire" "md5_tar_check() - Checking MD5 sum"
+ $STD_SORCERY_DEBUG_HEAD

local md5

#Do the md5
md5="$(md5sum /dev/stdin | awk '{print $1}')"
- debug "libgrimoire" "md5_tar_check() - MD5 of tarball is $md5."
- debug "libgrimoire" "md5_tar_check() - argument received is $1."
+ $STD_SORCERY_DEBUG "MD5 of tarball is $md5."
+ $STD_SORCERY_DEBUG "argument received is $1."

#See if they match
if [[ $1 == $md5 ]] ; then
- debug "libgrimoire" "md5_tar_check() - MD5 Sum Success ( $1 == $md5 )"
+ $STD_SORCERY_DEBUG "MD5 Sum Success ( $1 == $md5 )"
return 0
fi

#See of we need to md5sum it at all
if [[ ${MD5SUM_DL:-on} == off ]] || ! [[ $1 ]] ; then
- debug "libgrimoire" "md5_tar_check() - Skipping check"
+ $STD_SORCERY_DEBUG "Skipping check"
return 0
fi

#If we get here, the md5's don't match, but should.
- debug "libgrimoire" "md5_tar_check() - bad md5"
+ $STD_SORCERY_DEBUG "bad md5"
return 1

}
diff --git a/var/lib/sorcery/modules/liburl b/var/lib/sorcery/modules/liburl
index bda5293..4538968 100755
--- a/var/lib/sorcery/modules/liburl
+++ b/var/lib/sorcery/modules/liburl
@@ -111,7 +111,7 @@ function url_download_expand_sort() {

local url expanded_urls sorted_urls

- debug "liburl" "$FUNCNAME -- $@"
+ $STD_SORCERY_DEBUG_HEAD
# you can't expect me to download something without urls...
[ -z "$url_list" ] && return 255

@@ -127,7 +127,7 @@ function url_download_expand_sort() {
# limit the number of expanded urls, only the linux kernel reaches this
# limit and doing netselect on that many urls is absurd
expanded_urls=$(echo "$expanded_urls"|head -n 50)
- debug "liburl" "expanded urls $expanded_urls"
+ $STD_SORCERY_DEBUG "expanded urls $expanded_urls"
# sort urls
url_sort_urls sorted_urls "$expanded_urls"
if ! [[ "$sorted_urls" ]] ; then
@@ -136,7 +136,7 @@ function url_download_expand_sort() {
fi
# shorten the list to a manageable amount
sorted_urls=$(echo "$sorted_urls"|head -n 10)
- debug "liburl" "sorted urls $sorted_urls"
+ $STD_SORCERY_DEBUG "sorted urls $sorted_urls"
url_download "$1" "$sorted_urls" "$3" "$4" "$5"
}

@@ -168,7 +168,7 @@ function url_download() {

local url

- debug "liburl" "$FUNCNAME -- $@"
+ $STD_SORCERY_DEBUG_HEAD

# you can't expect me to download something without urls...
[ -z "$url_list" ] && return 255
@@ -203,7 +203,7 @@ function url_download() {
"$hints" "$udl_target" "$udl_type"
rc=$?
if [[ $rc == 0 ]] ; then
- debug "liburl" "url_download -- downloaded $url $udl_r_target
$udl_r_type"
+ $STD_SORCERY_DEBUG "downloaded $url $udl_r_target $udl_r_type"
return 0
fi
done
@@ -283,7 +283,7 @@ function url_rank() {
local finalList url_speed
local tmp_url tmp_prefix tmp_hostname tmp_list

- debug "liburl" "unsorted list: $*"
+ $STD_SORCERY_DEBUG "unsorted list: $*"

urlList="$@"

@@ -305,7 +305,7 @@ function url_rank() {

for tmp_prefix in $(hash_get_table_fields url_div_hash) ; do
tmp_list=$(hash_get url_div_hash $tmp_prefix)
- debug liburl "urls are $tmp_list"
+ $STD_SORCERY_DEBUG "urls are $tmp_list"
# the awk command turns netselect output like this:
# 69 url1
# 234 url2
@@ -323,11 +323,11 @@ function url_rank() {
# expand back in sorted order

sortedList=$(echo ${url_speed[@]})
- debug "liburl" "Ordered list pre-sanity check is $sortedList"
+ $STD_SORCERY_DEBUG "Ordered list pre-sanity check is $sortedList"

# if all sites are ICMP Unreachable, return the unsorted list instead of
null.
if [[ -z "$sortedList" ]] ; then
- debug "liburl" "Failed to expand list"
+ $STD_SORCERY_DEBUG "Failed to expand list"
echo "$urlList"
return
fi
@@ -341,10 +341,10 @@ function url_rank() {

# just in case something failed along the way just return what we had
if [[ -z "$sortedList" ]] ; then
- debug "liburl" "Ordering failed somewhere, giving back original input"
+ $STD_SORCERY_DEBUG "Ordering failed somewhere, giving back original
input"
echo "$urlList"
else
- debug "liburl" "Ordered URLs: $sortedList"
+ $STD_SORCERY_DEBUG "Ordered URLs: $sortedList"
echo "$sortedList"
fi
}




Archive powered by MHonArc 2.6.24.

Top of Page