- 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() {
# 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
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\""
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."
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() {
# Lock made in prepare_install
@@ -160,7 +160,7 @@ function run_post_build() {
#---------------------------------------------------------------------
function run_post_install() {
@@ -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() {
@@ -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() {
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() { (
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"
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 @@
#---------------------------------------------------------------------
@@ -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 "$@"
}
@@ -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 "$@"
}
@@ -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 "$@"
}
@@ -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 "$@"
}
@@ -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 "$@"
}
@@ -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 "$@"
}
@@ -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 "$@"
}
@@ -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 "$@"
}
@@ -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() {
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() {
}
@@ -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"
}
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() {
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
@@ -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")
# 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() {
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}
@@ -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() {
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
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}
- $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() {
{
#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() {
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
@@ -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
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() {
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
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
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
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
# 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"
}
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
}
[SM-Commit] GIT changes to master sorcery by Paul Mahon (2efaed3a62852e43099c26b6a1cf6df7cd9d6f65),
Paul Mahon, 01/13/2007