Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master sorcery by Ismael Luceno (a59d4780d6b3c02fc558d2c947f59433680473e1)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Ismael Luceno <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master sorcery by Ismael Luceno (a59d4780d6b3c02fc558d2c947f59433680473e1)
  • Date: Wed, 6 Feb 2019 21:50:05 +0000

GIT changes to master sorcery by Ismael Luceno <ismael AT sourcemage.org>:

build | 2
etc/sorcery/hooks/mail.hook | 6
etc/sorcery/hooks/sound.hook | 8 -
etc/sorcery/hooks/xterm_title.hook | 30 ++--
install | 4
usr/sbin/alter | 28 ++--
usr/sbin/cabal | 44 +++---
usr/sbin/cast | 34 ++---
usr/sbin/cleanse | 34 ++---
usr/sbin/confmeld | 32 ++--
usr/sbin/delve | 38 ++---
usr/sbin/dispel | 26 ++--
usr/sbin/gaze | 114 ++++++++---------
usr/sbin/resurrect | 12 -
usr/sbin/scribbler | 10 -
usr/sbin/scribe | 44 +++---
usr/sbin/sorcery | 32 ++--
usr/sbin/summon | 4
var/lib/sorcery/modules/build_api/api1 | 16 +-
var/lib/sorcery/modules/build_api/api2 | 30 ++--
var/lib/sorcery/modules/build_api/common | 14 +-
var/lib/sorcery/modules/dl_handlers/dl_aria2 | 8 -
var/lib/sorcery/modules/dl_handlers/dl_axel | 6
var/lib/sorcery/modules/dl_handlers/dl_bzr | 2
var/lib/sorcery/modules/dl_handlers/dl_curl | 6
var/lib/sorcery/modules/dl_handlers/dl_cvs | 2
var/lib/sorcery/modules/dl_handlers/dl_dir | 2
var/lib/sorcery/modules/dl_handlers/dl_file | 2
var/lib/sorcery/modules/dl_handlers/dl_git | 2
var/lib/sorcery/modules/dl_handlers/dl_hg | 2
var/lib/sorcery/modules/dl_handlers/dl_rsync | 4
var/lib/sorcery/modules/dl_handlers/dl_svn | 2
var/lib/sorcery/modules/dl_handlers/dl_tla | 2
var/lib/sorcery/modules/dl_handlers/dl_wget | 6
var/lib/sorcery/modules/libapi | 136
++++++++++-----------
var/lib/sorcery/modules/libcast | 46 +++----
var/lib/sorcery/modules/libcodex | 114 ++++++++---------
var/lib/sorcery/modules/libcrossinstall | 12 -
var/lib/sorcery/modules/libdepends | 94 +++++++-------
var/lib/sorcery/modules/libdepengine | 22 +--
var/lib/sorcery/modules/libdispel | 32 ++--
var/lib/sorcery/modules/libdownload | 10 -
var/lib/sorcery/modules/libgcc | 10 -
var/lib/sorcery/modules/libgpg | 26 ++--
var/lib/sorcery/modules/libgrimoire | 27 +---
var/lib/sorcery/modules/libhash | 26 ++--
var/lib/sorcery/modules/libinitd | 36 ++---
var/lib/sorcery/modules/liblock | 20 +--
var/lib/sorcery/modules/libmedia | 8 -
var/lib/sorcery/modules/libmisc | 134
++++++++++----------
var/lib/sorcery/modules/libqueue | 32 ++--
var/lib/sorcery/modules/libresurrect | 16 +-
var/lib/sorcery/modules/libscreen | 32 ++--
var/lib/sorcery/modules/libsecurity | 8 -
var/lib/sorcery/modules/libsorcery | 93 +++++++-------
var/lib/sorcery/modules/libspell | 4
var/lib/sorcery/modules/libstage | 26 ++--
var/lib/sorcery/modules/libstate | 92 +++++++-------
var/lib/sorcery/modules/libsummon | 24 +--
var/lib/sorcery/modules/libtablet | 92 +++++++-------
var/lib/sorcery/modules/libtime | 20 +--
var/lib/sorcery/modules/libtrack | 54 ++++----
var/lib/sorcery/modules/libtriggers | 22 +--
var/lib/sorcery/modules/libunpack | 38 ++---
var/lib/sorcery/modules/liburl | 32 ++--
var/lib/sorcery/modules/url_handlers/url_bzr | 10 -
var/lib/sorcery/modules/url_handlers/url_cvs | 8 -
var/lib/sorcery/modules/url_handlers/url_default | 14 +-
var/lib/sorcery/modules/url_handlers/url_dir | 2
var/lib/sorcery/modules/url_handlers/url_file | 2
var/lib/sorcery/modules/url_handlers/url_git | 10 -
var/lib/sorcery/modules/url_handlers/url_git_http | 10 -
var/lib/sorcery/modules/url_handlers/url_git_local | 8 -
var/lib/sorcery/modules/url_handlers/url_hg_http | 10 -
var/lib/sorcery/modules/url_handlers/url_http | 28 ++--
var/lib/sorcery/modules/url_handlers/url_rsync | 6
var/lib/sorcery/modules/url_handlers/url_smgl_tla | 10 -
var/lib/sorcery/modules/url_handlers/url_svn | 8 -
var/lib/sorcery/modules/url_handlers/url_svn_http | 10 -
var/lib/sorcery/modules/url_handlers/url_svn_https | 10 -
var/lib/sorcery/modules/url_handlers/url_svn_ssh | 10 -
81 files changed, 1050 insertions(+), 1052 deletions(-)

New commits:
commit a59d4780d6b3c02fc558d2c947f59433680473e1
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

libdepends: Remove pattern local variable in __comp_depends_aux

commit ecc4e42bf2d04ba0d462ab03cfa29e90b108f0be
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

libgrimoire: Simplify real_confilcts

commit 3aa09767c4a244018af08fc50a7ff475ab04a48a
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

libcodex: Simplify codex_create_cache

commit b37fbb3511a6c4d407bd6ab37714b62ab8520941
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

dl_aria2: s/\$funcname/$FUNCNAME/

commit e562f7cdaaafd692ef85b9b7e8f00248ddc8f586
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

Make function definitions ksh-compatible

commit 95a86ceae5179bfa2080a59154a4e64181837a67
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

libcodex: Improve codex_does_service_exist

Implement with a single awk instance instead of multiple grep.

commit b87e689bc00ea9ae2e19efee5a3bf10f4edcf433
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

cast, lib*: Remove use of character classes

diff --git a/build b/build
index c5a5ef9..104c14b 100755
--- a/build
+++ b/build
@@ -1,6 +1,6 @@
#!/bin/bash

-function build__find_non_volatile() {
+build__find_non_volatile() {
find "$@" -follow -not -type d -and -not -path '*CVS*' -and -not -name
'.#*' -and -not -name '*~' -and -not -path '*.svn*' -and -not -path
'*.arch-id*' -and -not -path '*{arch}*' -and -not -path '*.bzr*' -and -not
-path '*.git*'
}

diff --git a/etc/sorcery/hooks/mail.hook b/etc/sorcery/hooks/mail.hook
index 3cadd63..96cf23b 100755
--- a/etc/sorcery/hooks/mail.hook
+++ b/etc/sorcery/hooks/mail.hook
@@ -7,7 +7,7 @@

[[ -x /usr/bin/mail && $MAIL_REPORTS == on ]] || return 0

-function mail_cast_final_hook() {
+mail_cast_final_hook() {
{
echo "---Success---"
cat $SUCCESS_LIST | column
@@ -24,11 +24,11 @@ function mail_cast_final_hook() {
} | mail -s "Final report" $SORCERER
}

-function mail_post_FAILURE_hook() {
+mail_post_FAILURE_hook() {
date -u | mail -s "Compile log" -a $C_LOG $SORCERER 2>/dev/null
}

-function mail_post_SUCCESS_hook() {
+mail_post_SUCCESS_hook() {
date -u | mail -s "Compile log" -a $C_LOG $SORCERER 2>/dev/null
date -u | mail -s "Install log" -a $INST_LOG $SORCERER 2>/dev/null
}
diff --git a/etc/sorcery/hooks/sound.hook b/etc/sorcery/hooks/sound.hook
index cb30236..0359b81 100755
--- a/etc/sorcery/hooks/sound.hook
+++ b/etc/sorcery/hooks/sound.hook
@@ -15,7 +15,7 @@
##
## Needs sox
#---------------------------------------------------------------------
-function sound() {
+sound() {
local sound_file
case $SOUND in
on) sound_file=$SOUND_DIRECTORY/$SOUND_THEME/$1
@@ -30,15 +30,15 @@ function sound() {

}

-function sound_REPORT_hook() {
+sound_REPORT_hook() {
sound REPORT
}

-function sound_post_FAILURE_hook() {
+sound_post_FAILURE_hook() {
sound FAILURE
}

-function sound_post_SUCCESS_hook() {
+sound_post_SUCCESS_hook() {
sound SUCCESS
}

diff --git a/etc/sorcery/hooks/xterm_title.hook
b/etc/sorcery/hooks/xterm_title.hook
index 1713b6c..ded7b7b 100755
--- a/etc/sorcery/hooks/xterm_title.hook
+++ b/etc/sorcery/hooks/xterm_title.hook
@@ -6,15 +6,15 @@

[[ $SET_TERM_TITLE != "on" ]] && return 0

-function xterm_title_cast_initialize_hook() {
+xterm_title_cast_initialize_hook() {
set_term_title "cast started"
}

-function xterm_title_cast_start_spell_hook() {
+xterm_title_cast_start_spell_hook() {
set_term_title "[$SPELL]: casting"
}

-function xterm_title_cast_final_hook() {
+xterm_title_cast_final_hook() {
if [[ $ANTE_RC == 0 ]]; then
set_term_title "cast finished succesfully"
else
@@ -22,19 +22,19 @@ function xterm_title_cast_final_hook() {
fi
}

-function xterm_title_pre_SUCCESS_hook() {
+xterm_title_pre_SUCCESS_hook() {
set_term_title "[$SPELL]: success!"
}

-function xterm_title_pre_FAILURE_hook() {
+xterm_title_pre_FAILURE_hook() {
set_term_title "[$SPELL]: failure!"
}

-function xterm_title_pre_BUILD_hook() {
+xterm_title_pre_BUILD_hook() {
set_term_title "[$SPELL]: building"
}

-function xterm_title_pre_DOWNLOAD_hook() {
+xterm_title_pre_DOWNLOAD_hook() {
# summon and cast are run in parallel, so try to avoid conflicts
# let cast have precedence
if test -t 1; then
@@ -42,7 +42,7 @@ function xterm_title_pre_DOWNLOAD_hook() {
fi
}

-function xterm_title_pre_INSTALL_hook() {
+xterm_title_pre_INSTALL_hook() {
if [[ $STAGED_INSTALL != on ]]; then
set_term_title "[$SPELL]: installing"
else
@@ -50,31 +50,31 @@ function xterm_title_pre_INSTALL_hook() {
fi
}

-function xterm_title_pre_INSTALL_EXTRAS_hook() {
+xterm_title_pre_INSTALL_EXTRAS_hook() {
set_term_title "[$SPELL]: installing extras"
}

-function xterm_title_pre_PRE_BUILD_hook() {
+xterm_title_pre_PRE_BUILD_hook() {
set_term_title "[$SPELL]: unpacking"
}

-function xterm_title_pre_dispel_hook() {
+xterm_title_pre_dispel_hook() {
set_term_title "[$SPELL]: dispelling"
}

-function xterm_title_pre_PRE_RESURRECT_hook() {
+xterm_title_pre_PRE_RESURRECT_hook() {
set_term_title "[$SPELL]: resurrecting"
}

-function xterm_title_pre_TRANSFER_hook() {
+xterm_title_pre_TRANSFER_hook() {
set_term_title "[$SPELL]: transfering to system"
}

-function xterm_title_pre_TRIGGERS_hook() {
+xterm_title_pre_TRIGGERS_hook() {
set_term_title "[$SPELL]: checking triggers"
}

-function xterm_title_pre_UP_TRIGGERS_hook() {
+xterm_title_pre_UP_TRIGGERS_hook() {
set_term_title "[$SPELL]: checking reverse triggers"
}

diff --git a/install b/install
index 9f9e2e2..76354e2 100755
--- a/install
+++ b/install
@@ -5,12 +5,12 @@
#
# For unknown reasons `$filter=...; find . $filter` doesn't work, so this
function
# encapsulates the filters necessary to strip CVS files and EMACS temporary
files
-function install__find_non_volatile() {
+install__find_non_volatile() {
find "$@" \( -name CVS -o -name .svn -o -name .arch-id \) -prune -o \
\! -name '.#*' \! -name '*~' \
\! -type d
}
-function install__find_for_log() {
+install__find_for_log() {
install__find_non_volatile | sed 's:^:/:'
}

diff --git a/usr/sbin/alter b/usr/sbin/alter
index abd39f2..f15f1ba 100755
--- a/usr/sbin/alter
+++ b/usr/sbin/alter
@@ -7,7 +7,7 @@
# alter handles post-spell spell handling #
############################################################

-function alter_alter() {
+alter_alter() {

if [ -z "$1" ]; then
cat <<EOF > /dev/stderr && return 1
@@ -83,7 +83,7 @@ EOF

}

-function alter_md5_mend() {
+alter_md5_mend() {

SINGLE= #grab a single conflict only instead of all conflicts
STORE_BASE=${STORE_BASE:=/var/log/sorcery/tmp} # */tmp are often small
@@ -189,7 +189,7 @@ function alter_md5_mend() {

}

-function alter_gather_md5s() {
+alter_gather_md5s() {

[ -n "$MASTER_MD5S" ] && return 0

@@ -212,7 +212,7 @@ function alter_gather_md5s() {

}

-function alter_md5mend() {
+alter_md5mend() {

[ -z "$1" ] && echo "Please provide spells to mend as arguments" >
/dev/stderr && return 1

@@ -225,7 +225,7 @@ function alter_md5mend() {

}

-function alter_gather_bins() {
+alter_gather_bins() {

if [ ! -f "/etc/prelink.conf" ]; then
message "${MESSAGE_COLOR}Gathering binary directories for altering (this
could take a long while)...${DEFAULT_COLOR}"
@@ -241,7 +241,7 @@ function alter_gather_bins() {

}

-function alter_pre_link() {
+alter_pre_link() {

ARGS="$@"

@@ -259,7 +259,7 @@ function alter_pre_link() {

}

-function alter_prelink {
+alter_prelink() {

if gaze -q installed prelink | grep -q 'not installed'; then
cast prelink || (
@@ -277,7 +277,7 @@ function alter_prelink {

}

-function alter_strip_all_do() {
+alter_strip_all_do() {

ARGS="$@"

@@ -312,7 +312,7 @@ function alter_strip_all_do() {

}

-function alter_strip_do() {
+alter_strip_do() {

SPELL="$1"; shift
ARGS="$@"
@@ -354,7 +354,7 @@ function alter_strip_do() {

}

-function alter_strip_all {
+alter_strip_all() {

if [ -z "$1" ]; then
alter_strip_all_do
@@ -365,7 +365,7 @@ function alter_strip_all {

}

-function alter_strip {
+alter_strip() {

if [ -z "$1" ]; then
alter_strip_do
@@ -376,7 +376,7 @@ function alter_strip {

}

-function alter_about() {
+alter_about() {

cat <<EOF | less && exit 0
alter: about: alter is a utility to modify and add to spells' installs.
@@ -512,7 +512,7 @@ EOF

}

-function main() {
+main() {

[ -z "$1" ] && cat <<EOF > /dev/stderr && exit 1
alter: usage:
@@ -551,7 +551,7 @@ EOF

}

-function verify_parameters()
+verify_parameters()
{
while [[ $# -gt 0 ]]; do
case "$1" in
diff --git a/usr/sbin/cabal b/usr/sbin/cabal
index 0e6973b..13f5908 100755
--- a/usr/sbin/cabal
+++ b/usr/sbin/cabal
@@ -13,7 +13,7 @@
## @Stdout The names of the machines in the cabal
## @Globals CABAL_NAMES CABAL
#------------------
-function read_cabal_names() {
+read_cabal_names() {

mkdir -p $CABAL_DIRECTORY

@@ -29,7 +29,7 @@ function read_cabal_names() {
## Overwrite the cabal name file with new member names
## @Globals CABAL_NAMES MAX_CABALS
#--------------------
-function write_cabal_names() {
+write_cabal_names() {

rm -f $CABAL_NAMES
for (( COUNT=0; COUNT != ${#CABALS[@]}; COUNT++ )); do
@@ -44,7 +44,7 @@ function write_cabal_names() {
## @Stdout Names of each cabal member
## @NOTE MAX_CABAL can be eliminated
#---------------------
-function print_cabal_names() {
+print_cabal_names() {

eval ${DIALOG} '--textbox ${CABAL_NAMES} 0 0'

@@ -59,7 +59,7 @@ eval ${DIALOG} '--textbox ${CABAL_NAMES} 0 0'
## @Stdout <number>\n<cabal name or "Undefined"> for all cabal members
## @NOTE Dito about MAX_CABALS
#---------------------
-function print_cabal_numbers_names() {
+print_cabal_numbers_names() {

for (( COUNT = 0; COUNT != MAX_CABALS; COUNT++ )); do
echo "$COUNT"
@@ -76,7 +76,7 @@ function print_cabal_numbers_names() {
## @Stdout dialog output
## @Stderr Cabal member selection
#-----------------------
-function select_cabal() {
+select_cabal() {

eval $DIALOG '--title "Cabal Selection Menu" \
--ok-label "Select" \
@@ -91,7 +91,7 @@ function select_cabal() {
#----------------------
## Edit the file about selected members
#----------------------
-function edit_cabals() {
+edit_cabals() {

while SELECTED=`select_cabal`
do edit_file "$CABAL_DIRECTORY/$SELECTED"
@@ -102,7 +102,7 @@ function edit_cabals() {
#---------------------
## Show contents of a member's info file
#---------------------
-function show_cabals() {
+show_cabals() {

while SELECTED=`select_cabal`
do show_file "$CABAL_DIRECTORY/$SELECTED"
@@ -113,7 +113,7 @@ function show_cabals() {
#--------------------
## Generate SSH key for a cabal member
#--------------------
-function generate_cabal_key() {
+generate_cabal_key() {

while SELECTED=`select_cabal`
do
@@ -131,7 +131,7 @@ function generate_cabal_key() {
}


-function all_cabal_keys() {
+all_cabal_keys() {

for KEY in `ls $CABAL_KEYS/* |
grep -v "\.pub"`
@@ -142,7 +142,7 @@ function all_cabal_keys() {
}


-function distribute_cabal_key() {
+distribute_cabal_key() {

while SELECTED=`select_cabal`
do
@@ -172,7 +172,7 @@ function distribute_cabal_key() {
}


-function revoke_cabal_key() {
+revoke_cabal_key() {

while SELECTED=`select_cabal`
do
@@ -224,7 +224,7 @@ name_cabals() {
}


-function set_max_cabals() {
+set_max_cabals() {

PROMPT="Please enter the maximum number of cabals"

@@ -240,7 +240,7 @@ function set_max_cabals() {
}


-function cabal_name_menu() {
+cabal_name_menu() {

while

@@ -270,7 +270,7 @@ function cabal_name_menu() {
}


-function cabal_key_menu() {
+cabal_key_menu() {

while

@@ -304,7 +304,7 @@ enable root login without password prompts"
}


-function cabal_content_menu() {
+cabal_content_menu() {

while

@@ -334,7 +334,7 @@ function cabal_content_menu() {
}


-function select_order() {
+select_order() {

eval $DIALOG '--title "Order Selection Menu" \
--menu "" 0 0 0 \
@@ -344,7 +344,7 @@ function select_order() {
}


-function cabal_admin_menu() {
+cabal_admin_menu() {

while

@@ -381,7 +381,7 @@ function cabal_admin_menu() {
}


-function cabal_copy() {
+cabal_copy() {

SOURCE_MESSAGE='"Please enter source files and directories."'
DEST_MESSAGE='"Please enter destination directory."'
@@ -418,7 +418,7 @@ function cabal_copy() {
}


-function cabal_execute() {
+cabal_execute() {

COMMAND_MESSAGE="Please enter command to be execute remotely on cabal."

@@ -456,7 +456,7 @@ function cabal_execute() {
}


-function cabal_output() {
+cabal_output() {

if [ -d $CABAL_OUTPUT ]; then
for FILE in `ls $CABAL_OUTPUT`; do
@@ -469,7 +469,7 @@ function cabal_output() {
}


-function cabal_enchantment_menu() {
+cabal_enchantment_menu() {

while

@@ -504,7 +504,7 @@ copies"
}


-function cabal_menu() {
+cabal_menu() {

while

diff --git a/usr/sbin/cast b/usr/sbin/cast
index f71b244..c562257 100755
--- a/usr/sbin/cast
+++ b/usr/sbin/cast
@@ -10,7 +10,7 @@
#-----
## Help... hmm... I wonder what it does...
#-----
-function help() {
+help() {

cat << EOF

@@ -89,7 +89,7 @@ EOF
## @Globals INSTALL_QUEUE
##
#---------------------------------------------------------------------
-function process_parameters() {
+process_parameters() {

local n
while [ -n "$1" ]; do
@@ -140,7 +140,7 @@ function process_parameters() {
## Goes through arguments and prints spells or parameters that are no
## switches rather.
#---------------------------------------------------------------------
-function strip_parameters() {
+strip_parameters() {
local x n

while [ -n "$1" ]; do
@@ -188,7 +188,7 @@ function strip_parameters() {
## Look for optional parameter and use default otherwise
## specify via upvar how much to shift parameters
#---------------------------------------------------------------------
-function get_option() {
+get_option() {
local param=$1
local default=$2
local answer=$3
@@ -208,7 +208,7 @@ function get_option() {
## have been taken care of and we are allowed to cast this.
## @Globals SPELL
#---------------------------------------------------------------------
-function cast_spell() { (
+cast_spell() { (

debug "cast" "Casting spell [$SPELL]"
run_hook cast_start_spell
@@ -304,7 +304,7 @@ function cast_spell() { (
## Do dependency resolution. Takes the spells in the $SPELLS variable
## and resolves them. A superset list is created called $SPELLS_TO_CAST
#---------------------------------------------------------------------
-function pass_one() {
+pass_one() {
# This pass does configuration and dependency identification.
debug "cast" "Starting pass_one()"

@@ -375,7 +375,8 @@ function pass_one() {
message "${MESSAGE_COLOR}None of the spells have dependencies" \
"to cast:${DEFAULT_COLOR}"
message "---------------------------"
- message "${PROBLEM_COLOR}${parents}" | tr '[:blank:]' '\n' | sort |
column
+ message "${PROBLEM_COLOR}$(sort <<< "${parents//[\t ]/
+}" | column)"
message "${DEFAULT_COLOR}"
exit 1
fi
@@ -406,7 +407,7 @@ function pass_one() {
## Depending on SEPARATE it starts pass three in the background
## or not.
#---------------------------------------------------------------------
-function pass_two() {
+pass_two() {
# This pass downloads required sources.
# And starts the make process
debug "cast" "Starting pass_two()"
@@ -417,7 +418,8 @@ function pass_two() {

message "${MESSAGE_COLOR}Spells are to be cast:${DEFAULT_COLOR}"
message "---------------------------"
- message "${SPELL_COLOR}${SPELLS_TO_CAST}" | tr '[:blank:]' '\n' | column
+ message "${SPELL_COLOR}$(sort <<< "${SPELLS_TO_CAST//[\t ]/
+}"|column)"
message "${DEFAULT_COLOR}"

if ! query "Do you want to cast these spells?" "y" ; then
@@ -499,7 +501,7 @@ function pass_two() {
## (Is being called by make)
## If in screen mode it also execs a tail to the summon window
#---------------------------------------------------------------------
-function pass_three() {
+pass_three() {
debug "cast" "pass_three - $*"
unset CAST_PASS
trap "exit 1" INT TERM
@@ -568,7 +570,7 @@ function pass_three() {
## If resurrect or cast_spell returned 0 it calls trigger "cast"
## (Is being called by make)
#---------------------------------------------------------------------
-function pass_four() {
+pass_four() {

debug "cast" "pass_four - $*"
local do_resurrect=no
@@ -618,7 +620,7 @@ function pass_four() {
## CHECK_TRIGGERS_FAILURE
## Does report generation.
#---------------------------------------------------------------------
-function pass_five() {
+pass_five() {

debug "cast" "Function : pass_five"
local rc=0
@@ -774,7 +776,7 @@ function pass_five() {
##
## Starts the passes and sets CAST_PASS accordingly.
#---------------------------------------------------------------------
-function pass_zero() {
+pass_zero() {

debug "cast" "Starting pass_zero()"
debug "pass_zero" "Starting passes 1,2,3,4 with : '$*'"
@@ -793,7 +795,7 @@ function pass_zero() {
## That function is being called when the process receives
## SIGINT. It then calls cleanup.
#---------------------------------------------------------------------
-function int_trap()
+int_trap()
{
message "${PROBLEM_COLOR}SIGINT${DEFAULT_COLOR}"
message "Cleaning up as well as I can..."
@@ -809,7 +811,7 @@ function int_trap()
#---------------------------------------------------------------------
## Used for cleaning up. Deleting some files and $TMP_DIR.
#---------------------------------------------------------------------
-function cast_cleanup() {
+cast_cleanup() {
$STD_DEBUG
cleanup_tmp_dir $TMP_DIR
rmdir $CAST_BACKUPDIR 2>/dev/null
@@ -825,7 +827,7 @@ function cast_cleanup() {
## which are then being reported. Then the passes are being started
## according to CAST_PASS
#---------------------------------------------------------------------
-function main() {
+main() {
debug "cast" "main() - $*"
local T_SPELLS
process_parameters "$@"
diff --git a/usr/sbin/cleanse b/usr/sbin/cleanse
index c81f29e..b9aa23d 100755
--- a/usr/sbin/cleanse
+++ b/usr/sbin/cleanse
@@ -34,7 +34,7 @@
## @param A switch that was not understood (optional)
## @Stdout Usage statement
#--------------------
-function usage()
+usage()
{
local s="cleanse"
cat << EOF
@@ -93,7 +93,7 @@ EOF
## @Args --nofix Same as --fix, but won't recast.
## @Args --nofix_quick Same as --nofix, but doesn't check dependent
spells
#---------------------
-function args()
+args()
{
local rc
let rc=0
@@ -167,7 +167,7 @@ function args()
return ${rc:-0}
}

-function verify_parameters()
+verify_parameters()
{
while [[ $# -gt 0 ]]; do
case $1 in
@@ -191,7 +191,7 @@ function verify_parameters()
## @Stdout Misc output and questions
## @Stdin Answers to questions
#-------------------
-function delint()
+delint()
{
message "Delinting..."
local cond='$3=="on"'
@@ -266,7 +266,7 @@ function delint()
message "Delint done."
}

-function generic_remove_duplicate() {
+generic_remove_duplicate() {
local LINE
local tmp=$TMP_DIR/delint.$2.dup
message "Pass $3 (duplicate $2 entries)"
@@ -280,7 +280,7 @@ function generic_remove_duplicate() {
done
}

-function generic_remove_stale() {
+generic_remove_stale() {
message "Pass $3 (stale $2 entries)"
local tmp=$TMP_DIR/delint.$2.stale
local t
@@ -313,7 +313,7 @@ function generic_remove_stale() {
## @Stdout questions about what to do about problems
## @Stdin responses to queries
#---------------------
-function prune_depends()
+prune_depends()
{
message "Pruning..."
local action=""
@@ -452,7 +452,7 @@ function prune_depends()
## Find packages entries that are corrupted, or non-existant
## @Stdout Misc status output
#----------------------
-function packages()
+packages()
{
local spell t LINE
message "Fixing packages..."
@@ -513,7 +513,7 @@ function packages()
## @Returns May return non zero if there was a problem.
##
#-----------------------------
-function cleanse_fix()
+cleanse_fix()
{

local FIX=$1
@@ -620,7 +620,7 @@ function cleanse_fix()
return 0
}

-function cleanse_fix_depends() {
+cleanse_fix_depends() {
local SPELL=$1
# run the makefile to get the proper order
local FIX_ORDER=$($REAL_MAKE -s -f $MAKEFILE $1 2>/dev/null| grep -v
"^$SPELL\$")
@@ -654,7 +654,7 @@ function cleanse_fix_depends() {
## @return 0 if spell is fixed 1 if not
##
#----------------------------
-function cleanse_fix_spell() {
+cleanse_fix_spell() {
local SPELL=$1
if spell_held $SPELL ; then
HOPELESS="${HOPELESS}${SPELL}"$'\n'
@@ -683,7 +683,7 @@ function cleanse_fix_spell() {
## @return Should return 0 if all the checks completed
##
#--------------------------
-function cleanse_fix_run_checks() {
+cleanse_fix_run_checks() {
local SPELL=$1
if [ $# -eq 1 ] ;then
set_term_title "Checking $SPELL"
@@ -715,7 +715,7 @@ function cleanse_fix_run_checks() {
## @return 1 At least one file was found missing
##
#-----------------------
-function cleanse_fix_find_check() {
+cleanse_fix_find_check() {
if [ "$FIND_CHECK" == "off" ] ; then
return 0
fi
@@ -774,7 +774,7 @@ function cleanse_fix_find_check() {
## they dont know where they are
##
#-----------------------
-function cleanse_fix_init_ldd_check() {
+cleanse_fix_init_ldd_check() {
if [ "$LDD_CHECK" == "off" ] ; then
return 0
fi
@@ -800,7 +800,7 @@ function cleanse_fix_init_ldd_check() {
## @return 1 At least one library isnt happy
##
#-----------------------
-function cleanse_fix_ldd_check() { (
+cleanse_fix_ldd_check() { (
if [ "$LDD_CHECK" == "off" ] ; then
return 0
fi
@@ -872,7 +872,7 @@ function cleanse_fix_ldd_check() { (
## @return 1 At least one symlink doesnt have its target
##
#-----------------------
-function cleanse_fix_sym_check() {
+cleanse_fix_sym_check() {
if [ "$SYM_CHECK" == "off" ] ; then
return 0
fi
@@ -931,7 +931,7 @@ function cleanse_fix_sym_check() {
## @return 1 At least one md5sum is wrong
##
#-----------------------
-function cleanse_fix_md5sum_check() {
+cleanse_fix_md5sum_check() {

if [ "$MD5SUM_CHECK" == "off" ] ; then
return 0
diff --git a/usr/sbin/confmeld b/usr/sbin/confmeld
index a939178..309e7f3 100755
--- a/usr/sbin/confmeld
+++ b/usr/sbin/confmeld
@@ -8,7 +8,7 @@
#-----
## Help... hmm... I wonder what it does...
#-----
-function help()
+help()
{
cat << EOF
Melds the staged config files from $CONFIG_STAGE_DIRECTORY
@@ -46,7 +46,7 @@ EOF
##
## @stdout a list of all configs in the config stage root
#--------------------------------------------------------------------
-function all_config_files()
+all_config_files()
{
find $CONFIG_STAGE_DIRECTORY -type f
}
@@ -56,7 +56,7 @@ function all_config_files()
##
## @stdout a list of all uniq configs in the stage directory
#--------------------------------------------------------------------
-function all_uniq_config_files()
+all_uniq_config_files()
{
all_config_files |
sed "s#^$CONFIG_STAGE_DIRECTORY/[^/]*/[^/]*##" |
@@ -68,7 +68,7 @@ function all_uniq_config_files()
##
## @stdout list of spells that have staged configs
#--------------------------------------------------------------------
-function all_spells_with_staged_configs()
+all_spells_with_staged_configs()
{
all_config_files |
sed "s#$CONFIG_STAGE_DIRECTORY/*##g" |
@@ -78,7 +78,7 @@ function all_spells_with_staged_configs()
#-----
## override column so that we can pass -q to not columnate. Adapted from gaze
#-----
-function maybe_column() {
+maybe_column() {
if [[ $USE_COLUMN == no ]]; then
cat
else
@@ -91,7 +91,7 @@ function maybe_column() {
##
## @stdout list of spells that have staged configs
#--------------------------------------------------------------------
-function list_spells_with_staged_configs()
+list_spells_with_staged_configs()
{
local spells=$(all_spells_with_staged_configs)

@@ -108,7 +108,7 @@ function list_spells_with_staged_configs()
##
## @stdout list of staged configs
#--------------------------------------------------------------------
-function list_staged_configs()
+list_staged_configs()
{
local configs=$(all_uniq_config_files)

@@ -125,7 +125,7 @@ function list_staged_configs()
##
## @stdout list of spells and their staged configs
#--------------------------------------------------------------------
-function list_all()
+list_all()
{
local spell config
for spell in $(all_spells_with_staged_configs); do
@@ -146,7 +146,7 @@ function list_all()
## @param upvar for spell success time
## @param upvar for actual path to file
#--------------------------------------------------------------------
-function parse_stage_config_path()
+parse_stage_config_path()
{
local file=$1
local __tmp __spell __sdate __path
@@ -164,7 +164,7 @@ function parse_stage_config_path()
##
## @param action
#--------------------------------------------------------------------
-function override_changed_config_menu()
+override_changed_config_menu()
{

case $1 in
@@ -183,7 +183,7 @@ function override_changed_config_menu()
## Final check for removing empty spell directories, so the stage dir
## is left clean
#--------------------------------------------------------------------
-function final_cleanup()
+final_cleanup()
{
find "$CONFIG_STAGE_DIRECTORY" -mindepth 1 -maxdepth 2 \
-type d -exec rmdir {} + 2>/dev/null
@@ -194,7 +194,7 @@ function final_cleanup()
##
## @param config
#--------------------------------------------------------------------
-function merge_single_file()
+merge_single_file()
{
local file=$1 spell sdate target nice_date

@@ -221,7 +221,7 @@ function merge_single_file()
## @param spell/config
## @param ...
#--------------------------------------------------------------------
-function confmeld_partial()
+confmeld_partial()
{
local thing config configs rc=0

@@ -250,7 +250,7 @@ function confmeld_partial()
#--------------------------------------------------------------------
## merge all the staged configs
#--------------------------------------------------------------------
-function confmeld_all()
+confmeld_all()
{
local spell

@@ -262,7 +262,7 @@ function confmeld_all()
final_cleanup
}

-function process_parameters()
+process_parameters()
{
local subroutine arguments
local mode=$1
@@ -297,7 +297,7 @@ function process_parameters()
## If there's no arguments get all the config files and start installing
## them to the system using install_config_file
#--------------------------------------------------------------------
-function main()
+main()
{
local target spell sdate
local last_spell=""
diff --git a/usr/sbin/delve b/usr/sbin/delve
index 87a45b4..7ecbc80 100755
--- a/usr/sbin/delve
+++ b/usr/sbin/delve
@@ -9,7 +9,7 @@
## @Author Andrew Stitt
#---------------------------------------------------------------------

-function help() {
+help() {

cat << EOF
Delve allows the running of single spell files in the build/install phase
@@ -78,7 +78,7 @@ EOF
## Loads OPTS and all the other log files to provide the appropriate
## environment for spell files
#---------------------------------------------------------------------------
-function delve_log_helper() {
+delve_log_helper() {

if ! [[ "$__DELVE_IN_CAST" ]] ; then
# must declare OPTS before sourcing config
@@ -118,7 +118,7 @@ function delve_log_helper() {
## if the BUILD_API number is not found in the parameter list complain
## and return 1
#---------------------------------------------------------------------------
-function delve_is_valid_step() {
+delve_is_valid_step() {
local STEP=$1
local found
shift
@@ -135,19 +135,19 @@ function delve_is_valid_step() {
return 0
}

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

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

-function delve_build() {
+delve_build() {
debug "delve" "Running $FUNCNAME"
delve_is_valid_step BUILD 1 2 || return 1
delve_log_helper
@@ -158,7 +158,7 @@ function delve_build() {
> >(tee -a $C_LOG > $VOYEUR_STDOUT)
}

-function delve_pre_install() {
+delve_pre_install() {
debug "delve" "Running $FUNCNAME"
delve_is_valid_step PRE_INSTALL 2 || return 1
delve_log_helper
@@ -169,7 +169,7 @@ function delve_pre_install() {
> >(tee -a $C_LOG > $VOYEUR_STDOUT)
}

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

delve_is_valid_step INSTALL 2 || return 1
@@ -205,7 +205,7 @@ function delve_install() {
return $rc
}

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

delve_is_valid_step INSTALL_EXTRAS 2 || return 1
@@ -240,7 +240,7 @@ function delve_install_extras() {
return $rc
}

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

delve_is_valid_step POST_BUILD 1 || return 1
@@ -257,7 +257,7 @@ function delve_post_build() {
> >(tee -a $C_LOG > $VOYEUR_STDOUT)
}

-function delve_post_install() {
+delve_post_install() {
debug "delve" "Running $FUNCNAME"
delve_is_valid_step POST_INSTALL 1 2 || return 1
delve_log_helper
@@ -268,7 +268,7 @@ function delve_post_install() {
> >(tee -a $C_LOG > $VOYEUR_STDOUT)
}

-function delve_transfer() {
+delve_transfer() {
debug "delve" "Running $FUNCNAME"
delve_is_valid_step TRANSFER 2 || return 1
delve_log_helper
@@ -279,7 +279,7 @@ function delve_transfer() {
> >(tee -a $C_LOG > $VOYEUR_STDOUT)
}

-function delve_final() {
+delve_final() {
debug "delve" "Running $FUNCNAME"
delve_is_valid_step FINAL 2 || return 1
delve_log_helper
@@ -293,13 +293,13 @@ function delve_final() {

}

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

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

-function delve_spell_failure() {
+delve_spell_failure() {
debug "delve" "Running $FUNCNAME"
FAILED_LIST=/dev/null
delve_log_helper
@@ -320,7 +320,7 @@ function delve_spell_failure() {
## @global BUILD_API
## fill in the states from begin to end from the given BUILD_API
#---------------------------------------------------------------------------
-function delve_make_continuation() {
+delve_make_continuation() {
local begin=$1
local end=$2
local API1="start PRE_BUILD config_loc BUILD POST_BUILD POST_INSTALL
TRIGGERS end"
@@ -362,7 +362,7 @@ function delve_make_continuation() {
#---------------------------------------------------------------------------
## fills in STATES, continue_start, continue_end, and FORCE as applicable
#---------------------------------------------------------------------------
-function process_parameters() {
+process_parameters() {
for param in $@ ; do
case $param in
-f|--force) FORCE=on ;;
@@ -398,7 +398,7 @@ function process_parameters() {
## This is obviously the main function of delve, it loads the spell
## figures out what states to run and then loops through them.
#---------------------------------------------------------------------------
-function main() {
+main() {

local STATES STATE
local FORCE ALL SPELL
diff --git a/usr/sbin/dispel b/usr/sbin/dispel
index f34e895..67e57c0 100755
--- a/usr/sbin/dispel
+++ b/usr/sbin/dispel
@@ -80,7 +80,7 @@ EOF
## @param Spell
## @param Previous version
#-----
-function downgrade() {
+downgrade() {
if [ "$SUSTAIN" = off ]; then
resurrect --nosustain $1 -v "$2"
else
@@ -93,7 +93,7 @@ function downgrade() {
## Parse the dispel script's parameters
## @Args Parameters
#-----
-function process_parameters() {
+process_parameters() {
while [ -n "$1" ]; do
case "$1" in
[!-]*) ;;
@@ -155,7 +155,7 @@ function process_parameters() {
done
}

-function validate_param() {
+validate_param() {
case "$1" in
ask-yes|ask-no|ignore|always) eval "$2=\"$1\"" ;;
*) message "\"$1\" is not a valid option, use ask-yes, ask-no," \
@@ -169,7 +169,7 @@ function validate_param() {
## This is a silly way to do it
## @Args Parameters
#-----
-function strip_parameters() {
+strip_parameters() {
while ! [ $# = 0 ]; do
case "$1" in
[!-]*) echo -n "$1 " ;;
@@ -187,7 +187,7 @@ function strip_parameters() {
#---------------------------------------------------------------------
## Display what dependencies were removed
#---------------------------------------------------------------------
-function dispel_parents_list_borkers() {
+dispel_parents_list_borkers() {
local parent=$1
local optional_borkers=$2
local runtime_borkers=$3
@@ -221,7 +221,7 @@ function dispel_parents_list_borkers() {
## Frontend to do common things for dispelling (keep a note of what
## has already been dispelled.
#---------------------------------------------------------------------
-function dispel_spell_wrapper() {
+dispel_spell_wrapper() {
dispel_spell $1 &&
hash_put ALL_DISPELS $1 yes
}
@@ -234,7 +234,7 @@ function dispel_spell_wrapper() {
## list of spells removed.
## The caller is expected to call this in a loop until nothing is returned.
#---------------------------------------------------------------------
-function dispel_children() {
+dispel_children() {
local spells=$1

local our_children
@@ -308,7 +308,7 @@ function dispel_children() {
## @param Question to ask the user
## @param quad-option (always, ask-yes, ask-no, ignore)
#---------------------------------------------------------------------
-function dispel_child_query() {
+dispel_child_query() {
local SPELL=$1
local MESSAGE=$2
local QUERY=$3
@@ -341,7 +341,7 @@ function dispel_child_query() {
## @param Question to ask the user
## @param quad-option (always, ask-yes, ask-no, ignore)
#---------------------------------------------------------------------
-function dispel_parent_query() {
+dispel_parent_query() {
local QUERY=$1
local DEFAULT=$2
local query_default
@@ -369,7 +369,7 @@ function dispel_parent_query() {
## dis-associate with all its children (fix upward dep tree)
## remove spell from the downward tree
#---------------------------------------------------------------------
-function remove_from_dep_trees() {
+remove_from_dep_trees() {
debug dispel "$FUNCNAME $@"
local spell=$1
local down_dep_hash=$2
@@ -396,7 +396,7 @@ function remove_from_dep_trees() {
## where a spell is removed and spells that depend on it are broken. For
## example xorg borks blackbox.
#---------------------------------------------------------------------
-function get_borked_parents() {
+get_borked_parents() {
local spell=$1
local up_dep_hash=$2
local parent parents
@@ -416,7 +416,7 @@ function get_borked_parents() {
##
## @param List of spells to remove on this iteration.
#---------------------------------------------------------------------
-function dispel_depends_engine() {
+dispel_depends_engine() {

local CURR_SPELLS SPELL
for SPELL in $1; do
@@ -561,7 +561,7 @@ function dispel_depends_engine() {
## Main loop for dispel
## @Args Parameters
#---------------------------------------------------------------------
-function main() {
+main() {

process_parameters "$@"
# handle downgrading specially, since we also want to pass some of the
flags
diff --git a/usr/sbin/gaze b/usr/sbin/gaze
index 8a30633..f1c11a3 100755
--- a/usr/sbin/gaze
+++ b/usr/sbin/gaze
@@ -8,7 +8,7 @@
#---------------------------------------------------------------------


-function help() {
+help() {
cat << EOF

Invoke gaze with desired command followed by arguments.
@@ -146,7 +146,7 @@ EOF
#-----
## override column so that we can pass -q to not columnate.
#-----
-function maybe_column() {
+maybe_column() {
if [ -n "$GAZE_VERBOSE" ]; then
cat
else
@@ -160,7 +160,7 @@ function maybe_column() {
## is quite handy.
## @param snapshot file
#-----
-function import_snapshot_old() {
+import_snapshot_old() {
message "${PROBLEM_COLOR}This behaviour is deprecated and can be removed
at any time!$DEFAULT_COLOR"

SNAPSHOT=$1
@@ -202,7 +202,7 @@ function import_snapshot_old() {
#-----
## Construct and echo a filename to save a snapshot in.
#-----
-function mk_snapshot_filename() {
+mk_snapshot_filename() {
echo "snapshot-$HOSTNAME-$(date -u +%Y%m%d).tar$EXTENSION"
}

@@ -211,7 +211,7 @@ function mk_snapshot_filename() {
## See <@function import_snapshot>
## @param snapshot file
#-----
-function export_snapshot() {
+export_snapshot() {
local snapshot=$1

if [[ $UID != 0 ]]; then
@@ -244,7 +244,7 @@ function export_snapshot() {
## install queue.
## @param snapshot file
#-----
-function import_snapshot() {
+import_snapshot() {
if [[ $UID != 0 ]]; then
error_message "${PROBLEM_COLOR}gaze import needs to be run as root,
aborting...$DEFAULT_COLOR"
exit 1
@@ -291,7 +291,7 @@ function import_snapshot() {
## Is this used anywhere?
## @param File with list of files the sum
#-----
-function checksum() {
+checksum() {
for FILE in `cat $1 | files`; do
sum -s $FILE
done
@@ -302,7 +302,7 @@ function checksum() {
## Is this used anywhere?
## @param File with list of files the sum
#-----
-function md5sum_files() {
+md5sum_files() {
for FILE in `cat $1 | files`; do
md5sum "$FILE"
done
@@ -312,7 +312,7 @@ function md5sum_files() {
## Find all files on the system not installed by a spell
## This can be quite time consuming.
#-----
-function alien() {
+alien() {

if ! [ "$GAZE_VERBOSE" = false ]; then
message "In a few minutes I will print files found on this disk"
@@ -348,7 +348,7 @@ function alien() {
## @param Grimoire name
## @Stdout catalog
#-----
-function gaze_catalog() {
+gaze_catalog() {

local grimoire
{
@@ -396,7 +396,7 @@ function gaze_catalog() {
## @param Grimoire
## @Stdout HTML Catalog
#-----
-function gaze_catalog_html() {
+gaze_catalog_html() {

local grimoire COLS=4

@@ -575,7 +575,7 @@ function gaze_catalog_html() {
## @param File to display
## @param Message to display if file doesn't exist
#-----
-function display() {
+display() {
local file=$(FUZZ=on guess_filename "$1")
show_file "$file" no "$2"
}
@@ -584,7 +584,7 @@ function display() {
## List spells created more recently than the given date
## @param Date
#-----
-function newer() {
+newer() {

local DATE=$1
local COMPUTE
@@ -629,7 +629,7 @@ function newer() {
## List spells created less recently than the given date
## @param Date
#-----
-function older() {
+older() {

DATE=$1
if [ -n "$DATE" ]; then
@@ -658,7 +658,7 @@ function older() {
## @param Search string
## @Stdout grep results
#-----
-function show_from() {
+show_from() {
local mode=str string

case "$1" in -regex) mode=${1#-}; shift ;; esac
@@ -713,7 +713,7 @@ function show_from() {
## @param Component
## @param Spell
#-----
-function show_spell_component() {
+show_spell_component() {

local COMPONENT=$1
local SPELL_NAME=$2
@@ -737,7 +737,7 @@ function show_spell_component() {
## @param (optional) Type pf search (-name or -short)
## @param words to search for
#-----------------------------------------------------------------------
-function gaze_search() {
+gaze_search() {
case $1 in

-name) shift; real_name_search "$@" ;;
@@ -755,7 +755,7 @@ function gaze_search() {
## @Args Patterns
##
#-----------------------------------------------------------------------
-function real_name_search() {
+real_name_search() {
local pattern

for pattern in "$@"; do
@@ -787,7 +787,7 @@ function real_name_search() {
## @Args Patterns
##
#-----------------------------------------------------------------------
-function real_short_search() {
+real_short_search() {
local pattern

for pattern in "$@"; do
@@ -836,7 +836,7 @@ function real_short_search() {
## @Args Patterns
##
#-----------------------------------------------------------------------
-function real_long_search() {
+real_long_search() {
local pattern

for pattern in "$@"; do
@@ -910,7 +910,7 @@ local spell
## Watches a specific exhibisionist
## @param PID of exhibitionist
#-----
-function specific_voyeur()
+specific_voyeur()
{
if ! [ -d "/tmp/liblock-0/cast.$1" ]
then
@@ -925,7 +925,7 @@ function specific_voyeur()
## Watches the first exhibisionist found
## @param PID of exhibitionist
#-----
-function any_voyeur()
+any_voyeur()
{
# We happily assume no spell names contain "cast."
local FILE=`find /tmp/liblock-0 -maxdepth 1 -mindepth 1 -name "cast.*" |
@@ -941,7 +941,7 @@ function any_voyeur()
## Start waiting for an exhibisionist.
## @param (optional) Not sure if this is used... specifies a section or
something
#-----
-function gaze_activate_voyeur() {
+gaze_activate_voyeur() {

if [ -n "$1" ] &&
! find_section $1 > /dev/null
@@ -974,7 +974,7 @@ function gaze_activate_voyeur() {
#-----
## Show spells that have no other spell depending on them
#-----
-function show_orphans() {
+show_orphans() {
local spell each
compute_reverse_installed_depends my_hash all
for each in $(get_all_spells_with_status ok); do
@@ -988,7 +988,7 @@ function show_orphans() {
#-----
## Show spells that have other spell depending on them
#-----
-function show_non_orphans() {
+show_non_orphans() {
local spell each
compute_reverse_installed_depends my_hash all
for each in $(get_all_spells_with_status ok); do
@@ -1007,7 +1007,7 @@ function show_non_orphans() {
## @param Spell
##
#---------------------------------------------------------------------
-function gaze_show_website() {
+gaze_show_website() {

for spell in $@; do
if codex_set_current_spell_by_name $spell; then
@@ -1043,7 +1043,7 @@ function gaze_show_website() {
## @param section
##
#---------------------------------------------------------------------
-function show_maintainer() {
+show_maintainer() {

local section="$1"

@@ -1078,7 +1078,7 @@ function show_maintainer() {
## @param ...
##
#---------------------------------------------------------------------
-function gaze_show_section() {
+gaze_show_section() {

local SECTION_NAME

@@ -1107,7 +1107,7 @@ function gaze_show_section() {
## @param Section
##
#---------------------------------------------------------------------
-function gaze_show_section_version_table() {
+gaze_show_section_version_table() {

local SPELLS=`codex_get_spells_in_section $1`

@@ -1137,7 +1137,7 @@ function gaze_show_section_version_table() {
## @param ...
##
#---------------------------------------------------------------------
-function gaze_show_spell_version_table() {
+gaze_show_spell_version_table() {

(
echo "Grimoire|Section|Spell|Grimoire Version|Installed Version"
@@ -1164,7 +1164,7 @@ function gaze_show_spell_version_table() {
## @param ...
##
#---------------------------------------------------------------------
-function gaze_show_version() {
+gaze_show_version() {

local SPELLS_AND_SECTIONS=$@
local SPELLS=
@@ -1210,7 +1210,7 @@ function gaze_show_version() {
## @param Spell
##
#---------------------------------------------------------------------
-function gaze_show_versions() {
+gaze_show_versions() {
(
echo "Grimoire|Section|Spell|Grimoire Version|Installed Version"
echo "--------|-------|-----|----------------|-----------------"
@@ -1261,7 +1261,7 @@ function gaze_show_versions() {
## @param Spell
##
#---------------------------------------------------------------------
-function gaze_show_patchlevels() {
+gaze_show_patchlevels() {

local SPELL=$1

@@ -1318,7 +1318,7 @@ function gaze_show_patchlevels() {
## @param Section
##
#---------------------------------------------------------------------
-function gaze_show_section_license_table() {
+gaze_show_section_license_table() {

local SPELLS=`codex_get_spells_in_section $1`

@@ -1346,7 +1346,7 @@ function gaze_show_section_license_table() {
## @param ...
##
#---------------------------------------------------------------------
-function gaze_show_spell_license_table() {
+gaze_show_spell_license_table() {

(
echo "Spell|License(s)"
@@ -1371,7 +1371,7 @@ function gaze_show_spell_license_table() {
## @param ...
##
#---------------------------------------------------------------------
-function gaze_show_license_table() {
+gaze_show_license_table() {
(
echo "Abbr|License Full Name|URL"
echo "----|-----------------|---"
@@ -1392,7 +1392,7 @@ function gaze_show_license_table() {
## Shows lising of installed grmoires by grimoire name only.
##
#---------------------------------------------------------------------
-function gaze_show_grimoires() {
+gaze_show_grimoires() {

! [[ $GAZE_VERBOSE == false ]] && echo -n "Installed Grimoires: "
echo $(codex_get_all_grimoires | get_basenames)
@@ -1409,7 +1409,7 @@ function gaze_show_grimoires() {
## @param ...
##
#---------------------------------------------------------------------
-function gaze_show_license() {
+gaze_show_license() {

local SPELLS_AND_SECTIONS_AND_LICENSES=$@
local SPELLS=
@@ -1458,7 +1458,7 @@ function gaze_show_license() {
## @param ...
##
#-----
-function gaze_show_installed() {
+gaze_show_installed() {

local total_rc=0
if [ -z "$1" ]
@@ -1487,7 +1487,7 @@ function gaze_show_installed() {
## @param ...
##
#-----
-function gaze_show_short_description() {
+gaze_show_short_description() {

for spell in $@; do
if codex_find_spell_by_name $spell > /dev/null; then
@@ -1514,7 +1514,7 @@ function gaze_show_short_description() {
## @param ...
##
#-----
-function gaze_show_long_description() {
+gaze_show_long_description() {

for spell in $@; do
if codex_find_spell_by_name $spell > /dev/null; then
@@ -1546,7 +1546,7 @@ function gaze_show_long_description() {
## @param ...
##
#-----
-function gaze_show_where() {
+gaze_show_where() {

local SHOW_PATH
if [[ $1 == "-path" ]]; then
@@ -1579,7 +1579,7 @@ function gaze_show_where() {
## @param The given spell
##
#-----
-function gaze_show_depends() {
+gaze_show_depends() {
local fast all=yes
while true; do
if [[ $1 == --fast ]] ; then
@@ -1612,7 +1612,7 @@ function gaze_show_depends() {
## @param (optional) depth to recurse for
##
#-----
-function gaze_show_dependencies() {
+gaze_show_dependencies() {
local FOUND SPELL NO_OPTIONALS

while true; do
@@ -1668,7 +1668,7 @@ function gaze_show_dependencies() {
sub_depends() {
return 0
}
- repeat () {
+ repeat() {
local CHAR="$1" COUNT="$2"

while (( COUNT-- )); do echo -en "$CHAR"; done
@@ -1685,7 +1685,7 @@ function gaze_show_dependencies() {
# real_config_query_list should set $1 to something reasonable:
real_config_query_list() { eval "$1='$3'"; }

- recurse () {
+ recurse() {
local name=$1 DEPTH=$2 WHAT=$3
local found_before=""

@@ -1695,7 +1695,7 @@ function gaze_show_dependencies() {


[[ $MAX_DEPTH ]] && [[ $DEPTH -ge $MAX_DEPTH ]] && return 1
- grep () {
+ grep() {
local foo
smgl_which grep foo &&
$foo "$@"
@@ -1731,7 +1731,7 @@ function gaze_show_dependencies() {
## Display the size all installed spell use and the largest among them
##
#-----
-function gaze_show_size_all () {
+gaze_show_size_all() {
local each date status version install_log
local current_spell=0 current_size=0 current_info
local max_size=0 max_spell total_size=0 total_files=0
@@ -1776,7 +1776,7 @@ function gaze_show_size_all () {
## @param ...
##
#-----
-function gaze_show_size () {
+gaze_show_size() {
local spell each

if [[ $1 == "-all" ]]; then
@@ -1822,7 +1822,7 @@ function gaze_show_size () {
## log including sorcery state files
##
#---------------------------------------------------------------------
-function gaze_install() {
+gaze_install() {
local SPELL=$1
local VERSION=$2
local TYPE=$3
@@ -1850,7 +1850,7 @@ function gaze_install() {
## used by system_info()
##
#---------------------------------------------------------------------
-function figure_installed()
+figure_installed()
{
local version
version=$(installed_version $1)
@@ -1868,7 +1868,7 @@ function figure_installed()
## @param command (info, depends, sub_depends, spell_config, rsub_depends,
roots, dirs, all)
## @Stdout information of spell from tablet
#---------------------------------------------------------------------
-function gaze_tablet() {
+gaze_tablet() {
local spell=$1
local command=$2
local spell spell_directory spell_depends section_name version
@@ -1969,7 +1969,7 @@ function gaze_tablet() {
## displays various information about a Source Mage system
##
#---------------------------------------------------------------------
-function gaze_system_info()
+gaze_system_info()
{
local base_system
local cur_spell
@@ -2221,7 +2221,7 @@ function gaze_system_info()
## @param describe - how is that staus described in english
##
#---------------------------------------------------------------------
-function gaze_show_spells_by_status () {
+gaze_show_spells_by_status() {
message -n "${MESSAGE_COLOR}The following spells are set to"
message -n "${DEFAULT_COLOR} $2:"
message "${SPELL_COLOR}"
@@ -2239,7 +2239,7 @@ function gaze_show_spells_by_status () {
## @param ...
##
#---------------------------------------------------------------------
-function gaze_time() {
+gaze_time() {

local diff time sum=0 err_sum=() n=0 spell type
if [[ $1 == -* ]]; then
@@ -2293,7 +2293,7 @@ function gaze_time() {
## @param ...
##
#---------------------------------------------------------------------
-function gaze_time_full() {
+gaze_time_full() {
local spell

for spell in "$@"; do
@@ -2315,7 +2315,7 @@ function gaze_time_full() {
## @param type - see gaze_time
##
#---------------------------------------------------------------------
-function gaze_time_system() {
+gaze_time_system() {
local type orphans

while [[ $1 == -* ]]; do
diff --git a/usr/sbin/resurrect b/usr/sbin/resurrect
index 8bddb81..e8fe142 100755
--- a/usr/sbin/resurrect
+++ b/usr/sbin/resurrect
@@ -10,7 +10,7 @@
##
#---------------------------------------------------------------------

-function help() {
+help() {
cat << EOF
Resurrects the spell(s) if there is a cache available.

@@ -47,7 +47,7 @@ EOF
exit 1
}

-function do_resurrect() {
+do_resurrect() {
local spell=$1
local requested_version=$USE_VERSION
local cache
@@ -138,7 +138,7 @@ function do_resurrect() {
## inspecting the cache's contents, the filename cannot be reliably
## used instead.
#---------------------------------------------------------------------
-function direct_resurrect() {
+direct_resurrect() {
local cache=$1
local tmp spell date version
local error_base="${PROBLEM_COLOR}Unable to resurrect $FILE_COLOR$cache"
@@ -205,7 +205,7 @@ function direct_resurrect() {
## Pretty print if the spells can be resurrected or not
## Does all the checks it can do without trying a resurrect
#---------------------------------------------------------------------
-function is_resurrectable() {
+is_resurrectable() {
local spell=$1
local msg_base="$SPELL_COLOR$spell$DEFAULT_COLOR cannot be resurrected
because"

@@ -230,7 +230,7 @@ function is_resurrectable() {
## Make sure the parameters are ok. Used for verification before the
## user is asked for the su password to avoid futile su-ing.
#---------------------------------------------------------------------
-function verify_parameters() {
+verify_parameters() {
while [[ -n $1 ]]; do
if [[ ${1:0:1} == "-" ]]; then
case "$1" in
@@ -249,7 +249,7 @@ function verify_parameters() {
## specified, the -l option is ignored. If -f is specified, -v and -l
## are ignored. If -c is specified, everything else is ignored.
#---------------------------------------------------------------------
-function main() {
+main() {
local arguments resurrectee USE_LATEST USE_VERSION use_from check rc=0

while [[ -n $1 ]]; do
diff --git a/usr/sbin/scribbler b/usr/sbin/scribbler
index b245205..11bfa95 100755
--- a/usr/sbin/scribbler
+++ b/usr/sbin/scribbler
@@ -40,14 +40,14 @@ scribbler add-grimoire to-grimoire
EOF
}

-function scribbler_remove() {
+scribbler_remove() {
rm -rfv $SPELL_DIRECTORY
# remove empty sections
rmdir $(smgl_dirname $SPELL_DIRECTORY)
scribe reindex $3
}

-function scribbler_add_grimoire() {
+scribbler_add_grimoire() {
local grimoire=$1

TO_GRIMOIRE_DIRECTORY=$(codex_canonicalize_grimoire_name $grimoire) &&
@@ -57,7 +57,7 @@ function scribbler_add_grimoire() {
scribe localize $TO_GRIMOIRE_DIRECTORY
}

-function scribbler_add() {
+scribbler_add() {
## Set and validate (and possibly create) the to-grimoire name
if ! TO_GRIMOIRE_DIRECTORY=$(codex_find_grimoire $4) ; then
message "${PROBLEM_COLOR}The grimoire you specified" \
@@ -111,7 +111,7 @@ function scribbler_add() {
}


-function validate_and_parse_args() {
+validate_and_parse_args() {
## This script needed some sanity checking...
if [ "${1}" == "" ]; then
usage
@@ -163,7 +163,7 @@ function validate_and_parse_args() {
fi
}

-function main() {
+main() {
mk_tmp_dirs scribbler

## Get to the root of the issue
diff --git a/usr/sbin/scribe b/usr/sbin/scribe
index 7e98bfd..7ac2289 100755
--- a/usr/sbin/scribe
+++ b/usr/sbin/scribe
@@ -17,7 +17,7 @@
## print horribly unhelpful helpscreen
##
#---------------------------------------------------------------------
-function help() {
+help() {
cat << EOF

Scribe is a utility for controlling the grimoires in your codex,
@@ -61,7 +61,7 @@ EOF
#---------------------------------------------------------------------
## Common error messag when downloading a grimoire fails.
#---------------------------------------------------------------------
-function scribe_download_fail_error_msg() {
+scribe_download_fail_error_msg() {
error_message "${PROBLEM_COLOR}Error downloading grimoire..."
error_message "${MESSAGE_COLOR}Grimoire tarballs are located at:" \
"${FILE_COLOR}$CODEX_TARBALL_URL${DEFAULT_COLOR}"
@@ -72,7 +72,7 @@ function scribe_download_fail_error_msg() {
#---------------------------------------------------------------------
## Unpackage a grimoire tarball and make sure it worked
#---------------------------------------------------------------------
-function unpackage_grimoire_tarball() {
+unpackage_grimoire_tarball() {
local tarball=$1
local grimoire=$2
local grim_name=$3
@@ -98,7 +98,7 @@ function unpackage_grimoire_tarball() {
## Given an rsync url, make sure it has a / on the end of it
## so downloading works.
#---------------------------------------------------------------------
-function sanitize_rsync_url() {
+sanitize_rsync_url() {
# add a / to the end, if one isnt there, if the user types
# rsync://sourcemage.org::codex/games instead of
# rsync://sourcemage.org::codex/games/ strange things happen
@@ -112,7 +112,7 @@ function sanitize_rsync_url() {
#---------------------------------------------------------------------
## Validate a grimoire tree using a manifest
#---------------------------------------------------------------------
-function scribe_validate_tree_common() {
+scribe_validate_tree_common() {
local scribe_target=$1
local grim_name=$2
local grimoire=$3
@@ -143,7 +143,7 @@ function scribe_validate_tree_common() {
## scribe_add grimoire [ from location] [grimoire [ from location]] ...
##
#---------------------------------------------------------------------
-function scribe_add() {
+scribe_add() {
$STD_DEBUG
#For each item listed add it
if ! [ -d $CODEX_ROOT ] ; then
@@ -206,7 +206,7 @@ function scribe_add() {
## @param location to download from (optional), if empty use $CODEX_URL
##
#---------------------------------------------------------------------
-function scribe_add_update_worker() {
+scribe_add_update_worker() {
$STD_DEBUG
local grimoire=$1
local from=$2
@@ -352,7 +352,7 @@ function scribe_add_update_worker() {
## @param grimoire names, if none all grimoires
##
#---------------------------------------------------------------------
-function scribe_fix() {
+scribe_fix() {
local grim grimoire grimoires
if [[ $@ ]] ; then
grimoires=$@
@@ -397,7 +397,7 @@ function scribe_fix() {
## @param force, if one fix without prompting the user
##
#---------------------------------------------------------------------
-function scribe_fix_metadata() {
+scribe_fix_metadata() {
local URL grimoire_dir grimoire_name

if ! grimoire_dir=$(codex_find_grimoire $1) ; then
@@ -427,7 +427,7 @@ function scribe_fix_metadata() {
## Display installed grimoires
##
#---------------------------------------------------------------------
-function scribe_index() {
+scribe_index() {
local idx grimoire grimoire_name

echo ""
@@ -458,7 +458,7 @@ function scribe_index() {
## @param Names of grimoires to localize
##
#---------------------------------------------------------------------
-function scribe_localize() {
+scribe_localize() {
local grimoire path
for grimoire in $@; do
scribe_localize_sub yes &&
@@ -476,7 +476,7 @@ function scribe_localize() {
## @param yes/no state of grimoire localization
##
#---------------------------------------------------------------------
-function scribe_localize_sub() {
+scribe_localize_sub() {
path=$(codex_find_grimoire $grimoire)
if [ -z "$path" ]; then
error_message "${PROBLEM_COLOR}No such grimoire:" \
@@ -495,7 +495,7 @@ function scribe_localize_sub() {
## @param grimoire names, if none all grimoires
##
#---------------------------------------------------------------------
-function scribe_reindex() {
+scribe_reindex() {
local paths=""
local grimoire grimoires grim
if [[ "$@" ]] ; then
@@ -528,7 +528,7 @@ function scribe_reindex() {
## @param grimoire names, if none all grimoires
##
#---------------------------------------------------------------------
-function scribe_reindex_keyword() {
+scribe_reindex_keyword() {
local paths=""
local grimoire grimoires grim
if [[ "$@" ]] ; then
@@ -559,7 +559,7 @@ function scribe_reindex_keyword() {
##
## TODO: merge scribe_reindex_* functions?
#---------------------------------------------------------------------
-function scribe_reindex_version() {
+scribe_reindex_version() {
local paths=""
local grimoire grimoires grim
if [[ $@ ]] ; then
@@ -589,7 +589,7 @@ function scribe_reindex_version() {
## @param grimoires to remove
##
#---------------------------------------------------------------------
-function scribe_remove() {
+scribe_remove() {
#remove all listed grimoires
local grimoire grim
for grim in $@; do
@@ -626,7 +626,7 @@ function scribe_remove() {
## @param grimoire2
##
#---------------------------------------------------------------------
-function scribe_set(){
+scribe_set(){
local grim1=$1 grimoire1
local grim2=$2 grimoire2
local idx1 idx2
@@ -673,7 +673,7 @@ function scribe_set(){
## @param grimoire2
##
#---------------------------------------------------------------------
-function scribe_swap() {
+scribe_swap() {
local grim1=$1 grimoire1
local grim2=$2 grimoire2
local idx1 idx2
@@ -702,7 +702,7 @@ function scribe_swap() {
## @param grimoire names, if none all grimoires
##
#---------------------------------------------------------------------
-function scribe_update() {
+scribe_update() {
local grimoires grimoire grim from rc
rc=0
if [[ $@ ]] ; then
@@ -782,7 +782,7 @@ function scribe_update() {
## @param Names of grimoires to unlocalize
##
#---------------------------------------------------------------------
-function scribe_unlocalize() {
+scribe_unlocalize() {
local grimoire path
for grimoire in $@; do
scribe_localize_sub $grimiore no &&
@@ -799,7 +799,7 @@ function scribe_unlocalize() {
## @param command line args
##
#---------------------------------------------------------------------
-function find_function() {
+find_function() {
case $1 in
a|ad|add) FUNCTION="add" ;;
f|fi|fix) FUNCTION="fix" ;;
@@ -822,7 +822,7 @@ function find_function() {
##
## start the ride.
#---------------------------------------------------------------------
-function main() {
+main() {
#move to the tmp folder in case we create junk
cd /tmp

diff --git a/usr/sbin/sorcery b/usr/sbin/sorcery
index f7dbde5..a902fa6 100755
--- a/usr/sbin/sorcery
+++ b/usr/sbin/sorcery
@@ -385,7 +385,7 @@ EOF

}

-function make_restore_script() {
+make_restore_script() {
# note the lines:
#SORCERY_SPOOL=${SOURCE_CACHE}
#SORCERY_BRANCH=${SORCERY_BRANCH}
@@ -429,7 +429,7 @@ EOF
}


-update_sorcery () {
+update_sorcery() {

make_restore_script

@@ -450,12 +450,12 @@ update_sorcery () {
}


-update_queue () {
+update_queue() {
update_install_queue
list_install_queue
}

-update_security_queue () {
+update_security_queue() {
update_security_install_queue
list_install_queue
}
@@ -910,7 +910,7 @@ I off . . . . . - . - . . - . . . - .

}

-function gpg_download_menu() {
+gpg_download_menu() {
local CHECK CHECKS
local INT_TITLE="GnuPG Signature Checking Selection Menu"
local INT_HELP="Enable/Disable GnuPG signature checking here"
@@ -942,7 +942,7 @@ function gpg_download_menu() {
fi
}

-function vrf_select_hashes() {
+vrf_select_hashes() {
local DIALOG_TITLE="Select the source hashes you would like to use"
local DIALOG_HELP="Select the source hashes you would like to consider
valid hashes"
local DEFAULT_LIST=$(gpg_get_hashes)
@@ -1025,7 +1025,7 @@ function vrf_select_hashes() {
return 0
}

-function vrf_select_level() {
+vrf_select_level() {
local DIALOG_TITLE="Source Verification Level Checking"
local DIALOG_HELP="Select the minimum level for source verification"
local DIALOG_LIST=""
@@ -1148,7 +1148,7 @@ that should receive reports from this box." \

}

-function service_defaults() {
+service_defaults() {
local INSTALL_INIT_HELP="Install init.d scripts by default?"
local ENABLE_INIT_HELP="If an init.d script is being installed, also
enable it by default?"
local INSTALL_XINETD_HELP="Install xinetd scripts by default?"
@@ -1198,7 +1198,7 @@ function service_defaults() {
fi
}

-function parallel_compilation_menu() {
+parallel_compilation_menu() {
local RESULTS KEY rc
local TITLE="Parallel/Distributed Compilation Options Menu"
local HELP="Number of make jobs is\n((length of
DISTCC_HOSTS)*JOBS_PER_HOST+EXTRA_JOBS)\nIf distcc is disabled by a spell,
then the number of make jobs is EXTRA_JOBS, it is recommended that you dont
set it to zero. If the number of jobs totals to zero make will run an
unlimited number of jobs."
@@ -1478,7 +1478,7 @@ sorcery_devel_settings() {

}

-function set_dl_handler() {
+set_dl_handler() {
local W_HELP="Use wget to download from urls using the http/ftp/https
protocols"
local A_HELP="Use aria2 to download from urls using the http/ftp/https
protocols"
local C_HELP="Use cURL to download from urls using the http/ftp/https
protocols"
@@ -1798,7 +1798,7 @@ main_menu() {
##
## cli function
#---------------------------------------------------------------------
-sorcery_hold_spells () {
+sorcery_hold_spells() {
set_held $@
}

@@ -1810,7 +1810,7 @@ sorcery_hold_spells () {
##
## cli function
#---------------------------------------------------------------------
-sorcery_unhold_spells () {
+sorcery_unhold_spells() {
set_unheld $@
}

@@ -1822,7 +1822,7 @@ sorcery_unhold_spells () {
##
## cli function
#---------------------------------------------------------------------
-sorcery_cli_defaults () {
+sorcery_cli_defaults() {
local cmd=$1
shift
case $cmd in
@@ -1840,7 +1840,7 @@ sorcery_cli_defaults () {
##
## cli function
#---------------------------------------------------------------------
-sorcery_add_defaults () {
+sorcery_add_defaults() {
if [ $# -ne 3 ] ; then
message "${PROBLEM_COLOR}Wrong number of arguments.${DEFAULT_COLOR}"
help
@@ -1881,7 +1881,7 @@ sorcery_add_defaults () {
##
## cli function
#---------------------------------------------------------------------
-sorcery_search_defaults () {
+sorcery_search_defaults() {
# it wont hurt to look in both
if [[ -z $1 ]]; then
cat $DEFAULT_DEPENDS $DEFAULT_PROVIDERS 2>/dev/null
@@ -1898,7 +1898,7 @@ sorcery_search_defaults () {
##
## cli function
#---------------------------------------------------------------------
-sorcery_remove_defaults () {
+sorcery_remove_defaults() {
remove_default_depends $DEFAULT_DEPENDS "$@"
remove_default_provider $DEFAULT_PROVIDERS "$@"
}
diff --git a/usr/sbin/summon b/usr/sbin/summon
index 8d57b2c..139df55 100755
--- a/usr/sbin/summon
+++ b/usr/sbin/summon
@@ -132,7 +132,7 @@ strip_parameters() {
## This is mainly for summon, but might be useful for gaze as its
## an information query function.
#---------------------------------------------------------------------
-function summon_print_spells() {
+summon_print_spells() {
local SPELLS="$*"
[ -z "$SPELLS" ] && return 1

@@ -165,7 +165,7 @@ function summon_print_spells() {
## Will call summon_spell for each spell found in "$*"
##
#---------------------------------------------------------------------
-function summon_spells() {
+summon_spells() {
local SPELLS="$*"
local SPELL
[ -z "$SPELLS" ] && return 1
diff --git a/var/lib/sorcery/modules/build_api/api1
b/var/lib/sorcery/modules/build_api/api1
index c181415..88630eb 100755
--- a/var/lib/sorcery/modules/build_api/api1
+++ b/var/lib/sorcery/modules/build_api/api1
@@ -22,7 +22,7 @@
## This runs through the phase 4 pipeline of building and installing
## a spell for BUILD_API 1.
#---------------------------------------------------------------------
-function run_build_spell() {
+run_build_spell() {
debug "build_api1" "run_build_spell"
C_LOG=$TMP_DIR/$SPELL.compile.log
C_FIFO=/dev/stdout
@@ -80,7 +80,7 @@ function run_build_spell() {
## source directories. If a PRE_BUILD file exists in SCRIPT_DIRECTORY
## and is executable it is run in preference to the default_pre_build.
#---------------------------------------------------------------------
-function run_pre_build() {
+run_pre_build() {

debug "build_api1" "run_pre_build()"
message "${MESSAGE_COLOR}Building" \
@@ -100,7 +100,7 @@ function run_pre_build() {
## settings that need to be on, eventually gets around to running
## BUILD or default_build, then does other things it shouldn't do.
#---------------------------------------------------------------------
-function run_build() {
+run_build() {

debug "build_api1" "Starting run_build()"

@@ -142,7 +142,7 @@ function run_build() {
## executable, runs it. This file is run after BUILD and before
## POST_INSTALL. Its purpose is to bookend BUILD and shutoff installwatch.
#---------------------------------------------------------------------
-function run_post_build() {
+run_post_build() {

debug "build_api1" "Starting run_post_build()"
run_spell_file POST_BUILD post_build
@@ -158,7 +158,7 @@ function run_post_build() {
## executable, runs it. This file is used for extra files that need
## to be installed, but not tracked by installwatch.
#---------------------------------------------------------------------
-function run_post_install() {
+run_post_install() {

debug "build_api1" "Starting run_post_install()"
run_spell_file INSTALL install
@@ -170,7 +170,7 @@ function run_post_install() {
## Creates the source directory and unpacks the source package into it.
## Used if no PRE_BUILD script is found for a spell.
#---------------------------------------------------------------------
-function real_default_sorcery_pre_build() {
+real_default_sorcery_pre_build() {

debug "build_api1" "Starting real_default_sorcery_pre_build() -
SOURCE=$SOURCE SOURCE_DIRECTORY=$SOURCE_DIRECTORY"
mk_source_dir $SOURCE_DIRECTORY &&
@@ -197,7 +197,7 @@ function real_default_sorcery_pre_build() {
## </pre>
##
#---------------------------------------------------------------------
-function real_default_sorcery_build() {
+real_default_sorcery_build() {

debug "build_api1" "Starting real_default_sorcery_build()"
OPTS="$OPTS --build=${BUILD}"
@@ -226,7 +226,7 @@ function real_default_sorcery_build() {
## Used if no POST_BUILD script is found for a spell.
##
#---------------------------------------------------------------------
-function real_default_sorcery_post_build() {
+real_default_sorcery_post_build() {

debug "build_api1" "Starting real_default_sorcery_post_build()"

diff --git a/var/lib/sorcery/modules/build_api/api2
b/var/lib/sorcery/modules/build_api/api2
index a5b87a0..732c5e8 100755
--- a/var/lib/sorcery/modules/build_api/api2
+++ b/var/lib/sorcery/modules/build_api/api2
@@ -24,7 +24,7 @@
## This runs through the phase 4 pipeline of building and installing
## a spell for BUILD_API 2.
#---------------------------------------------------------------------
-function run_build_spell() {
+run_build_spell() {
debug "build_api2" "run_build_spell"

local CHROOT_CHECK=""
@@ -125,7 +125,7 @@ function run_build_spell() {
## source directories. If a PRE_BUILD file exists in SCRIPT_DIRECTORY
## and is executable it is run in preference to the default_pre_build.
#---------------------------------------------------------------------
-function run_pre_build() {
+run_pre_build() {

debug "build_api2" "run_pre_build()"
message "${MESSAGE_COLOR}Preparing" \
@@ -145,7 +145,7 @@ function run_pre_build() {
## settings that need to be on, eventually gets around to running
## BUILD or default_build.
#---------------------------------------------------------------------
-function run_build() {
+run_build() {

debug "build_api2" "Starting run_compile()"

@@ -184,7 +184,7 @@ function run_build() {
## Turns all the various logs back on that were turned off from after
## run_build finished, then runs PRE_INSTALL or default_pre_install
#---------------------------------------------------------------------
-function run_pre_install() {
+run_pre_install() {
debug "build_api2" "Starting run_pre_install()"

if [ -f $S_PWD ] ; then
@@ -210,7 +210,7 @@ function run_pre_install() {
## around an execed bash shell, this is needed for installwatch to
## stage root properly
#---------------------------------------------------------------------
-function run_install() {
+run_install() {
debug "build_api2" "Starting run_install()"

if [[ $STAGED_INSTALL == on ]]; then
@@ -240,7 +240,7 @@ function run_install() {
fi
}

-function run_install_extras() {
+run_install_extras() {

debug "build_api2" "Starting run_install_extras()"
run_spell_file INSTALL_EXTRAS install_extras
@@ -255,7 +255,7 @@ function run_install_extras() {
## around an execed bash shell, this is needed for installwatch to
## stage root properly
#---------------------------------------------------------------------
-function run_post_install() {
+run_post_install() {
debug "build_api2" "Starting run_post_install()"
persistent_load &&
if [[ $STAGED_INSTALL != off ]]
@@ -272,7 +272,7 @@ function run_post_install() {
## Checks against STAGED_INSTALL and installs the staged spell
## accordingly
#--------------------------------------------------------------------
-function run_transfer() {
+run_transfer() {
if [[ "$STAGED_INSTALL" != "off" ]]
then
message "${MESSAGE_COLOR}Installing" \
@@ -287,7 +287,7 @@ function run_transfer() {
## executable, runs it. This file is used for extra files that need
## to be installed, but not tracked by installwatch.
#---------------------------------------------------------------------
-function run_final() {
+run_final() {

debug "build_api2" "Starting run_final()"
run_spell_file FINAL final
@@ -299,7 +299,7 @@ function run_final() {
## Used if no PRE_BUILD script is found for a spell.
##
#---------------------------------------------------------------------
-function real_default_sorcery_pre_build() {
+real_default_sorcery_pre_build() {

debug "libgrimoire" "default_pre_build() - SOURCE=$SOURCE
SOURCE_DIRECTORY=$SOURCE_DIRECTORY"
mk_source_dir $SOURCE_DIRECTORY &&
@@ -322,7 +322,7 @@ function real_default_sorcery_pre_build() {
## </pre>
##
#---------------------------------------------------------------------
-function real_default_sorcery_build() {
+real_default_sorcery_build() {
debug "build_api2" "real_default_sorcery_build"

OPTS="$OPTS --build=${BUILD}"
@@ -350,7 +350,7 @@ function real_default_sorcery_build() {
## </pre>
##
#---------------------------------------------------------------------
-function real_default_sorcery_pre_install() {
+real_default_sorcery_pre_install() {
debug "build_api2" "Starting real_default_sorcery_pre_install"
prepare_install >&3
}
@@ -364,7 +364,7 @@ function real_default_sorcery_pre_install() {
## </pre>
##
#---------------------------------------------------------------------
-function real_default_sorcery_install() {
+real_default_sorcery_install() {
debug "build_api2" "Starting real_default_sorcery_install"
make install
}
@@ -377,7 +377,7 @@ function real_default_sorcery_install() {
##
## This is identical to api1's post_build
#---------------------------------------------------------------------
-function real_default_sorcery_install_extras() {
+real_default_sorcery_install_extras() {

debug "build_api2" "Starting real_default_sorcery_install_extras"
install_xinetd
@@ -392,7 +392,7 @@ function real_default_sorcery_install_extras() {

}

-function real_default_sorcery_transfer() {
+real_default_sorcery_transfer() {

debug "build_api2" "Starting real_default_sorcery_transfer"
transfer_staged_spell
diff --git a/var/lib/sorcery/modules/build_api/common
b/var/lib/sorcery/modules/build_api/common
index 49b3b17..035e388 100755
--- a/var/lib/sorcery/modules/build_api/common
+++ b/var/lib/sorcery/modules/build_api/common
@@ -20,7 +20,7 @@
## pokes around for a configure or src/configure and if it exists
## asks the user if they want to edit the custom options
#---------------------------------------------------------------------
-function run_config_loc () {
+run_config_loc () {
debug "build_api_common" "Starting run_config_loc() on $SPELL"
pushd . > /dev/null # may have been somewhere else
run_hook config_loc pre
@@ -85,7 +85,7 @@ function run_config_loc () {
## If the spell is not installed (or held) the spell is not dispelled.
##
#---------------------------------------------------------------------
-function real_prepare_install() { (
+real_prepare_install() { (

debug "libgrimoire" "Running prepare_install() on $SPELL"

@@ -114,7 +114,7 @@ save_bin_lib_paths
## dispelled
##
#--------------------------------------------------------------------
-function save_bin_lib_paths()
+save_bin_lib_paths()
{
# TODO this is a dirty hack we need to remove it
if test -d "$SOURCE_DIRECTORY/old.binaries" ; then
@@ -136,7 +136,7 @@ function save_bin_lib_paths()
## them as part of the spell
##
#---------------------------------------------------------------------
-function real_gather_docs() { (
+real_gather_docs() { (

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

@@ -176,7 +176,7 @@ function real_gather_docs() { (
## Copies pam configuration files to /etc/pam.d/
##
#---------------------------------------------------------------------
-function install_pam_confs() {
+install_pam_confs() {

debug "libgrimoire" "Running install_pam_confs() on $SPELL"

@@ -199,7 +199,7 @@ function install_pam_confs() {
## Stuff that should be done if run_build_spell succeeds
## This is intended to be overridable at some point
#---------------------------------------------------------------------
-function run_spell_success() {
+run_spell_success() {
debug "build_api_common" "cast of $SPELL-$VERSION was successful"

local INST_LOG="$INSTALL_LOGS/$SPELL-$VERSION"
@@ -372,7 +372,7 @@ function run_spell_success() {
## Stuff that should be done if run_build_spell fails
## This is intended to be overridable at some point
#---------------------------------------------------------------------
-function run_spell_failure() {
+run_spell_failure() {
debug "build_api_common" "cast of $SPELL-$VERSION failed"
local rc=$1

diff --git a/var/lib/sorcery/modules/dl_handlers/dl_aria2
b/var/lib/sorcery/modules/dl_handlers/dl_aria2
index 66d0c7b..f8ba703 100755
--- a/var/lib/sorcery/modules/dl_handlers/dl_aria2
+++ b/var/lib/sorcery/modules/dl_handlers/dl_aria2
@@ -20,7 +20,7 @@
##
#---------------------------------------------------------------------

-function dl_aria2_get() {
+dl_aria2_get() {
debug libdownload "$FUNCNAME -- $@"
dl_command_check aria2c || return 254

@@ -53,11 +53,11 @@ function dl_aria2_get() {
# Private Function. Calls aria2c to download the url.
#
#---------------------------------------------------------------------
-function dl_aria2_call_aria2() {
+dl_aria2_call_aria2() {
local FILE=$1
local URL_LIST=$2

- debug 'dl_aria2' "$funcname -- $@"
+ debug 'dl_aria2' "$FUNCNAME -- $*"

rm -f $FILE
aria2c $ARIA2_OPTIONS -o "$FILE" $URL_LIST 2>&1 &&
@@ -75,7 +75,7 @@ function dl_aria2_call_aria2() {
# Private Function. Sets aria2 options
#
#---------------------------------------------------------------------
-function dl_aria2_set_options() {
+dl_aria2_set_options() {
local URL_LIST=$1
local hints="$2"

diff --git a/var/lib/sorcery/modules/dl_handlers/dl_axel
b/var/lib/sorcery/modules/dl_handlers/dl_axel
index 633c41c..1a2a7ca 100755
--- a/var/lib/sorcery/modules/dl_handlers/dl_axel
+++ b/var/lib/sorcery/modules/dl_handlers/dl_axel
@@ -20,7 +20,7 @@
##
#---------------------------------------------------------------------

-function dl_axel_get() {
+dl_axel_get() {
debug libdownload "$FUNCNAME -- $@"
dl_command_check axel || return 254

@@ -53,7 +53,7 @@ function dl_axel_get() {
# Private Function. Calls axel to download the url.
#
#---------------------------------------------------------------------
-function dl_axel_call_axel() {
+dl_axel_call_axel() {
debug 'dl_axel' "$funcname -- $@"
local FILE=$1
shift
@@ -68,7 +68,7 @@ function dl_axel_call_axel() {
# Private Function. Sets axel options
#
#---------------------------------------------------------------------
-function dl_axel_set_options() {
+dl_axel_set_options() {
if [[ "$DOWNLOAD_RATE" ]]; then
RATE="-s $DOWNLOAD_RATE"
fi
diff --git a/var/lib/sorcery/modules/dl_handlers/dl_bzr
b/var/lib/sorcery/modules/dl_handlers/dl_bzr
index 2939763..cae29d8 100755
--- a/var/lib/sorcery/modules/dl_handlers/dl_bzr
+++ b/var/lib/sorcery/modules/dl_handlers/dl_bzr
@@ -20,7 +20,7 @@
## This handler only supports tree downloads.
##
#---------------------------------------------------------------------
-function dl_bzr_get () {
+dl_bzr_get() {
dl_command_check bzr || return 254

local target=$1
diff --git a/var/lib/sorcery/modules/dl_handlers/dl_curl
b/var/lib/sorcery/modules/dl_handlers/dl_curl
index 209976e..b6cd717 100755
--- a/var/lib/sorcery/modules/dl_handlers/dl_curl
+++ b/var/lib/sorcery/modules/dl_handlers/dl_curl
@@ -20,7 +20,7 @@
##
#---------------------------------------------------------------------

-function dl_curl_get() {
+dl_curl_get() {
debug libdownload "$FUNCNAME -- $@"
dl_command_check curl || return 254

@@ -56,7 +56,7 @@ function dl_curl_get() {
## Private Function. Call curls to download the url.
##
#---------------------------------------------------------------------
-function dl_curl_call_curl() {
+dl_curl_call_curl() {
local FILE=$1
local URL=$2

@@ -78,7 +78,7 @@ function dl_curl_call_curl() {
## Private Function. Sets curl options
##
#---------------------------------------------------------------------
-function dl_curl_set_options() {
+dl_curl_set_options() {
local URL=$1
local hints="$2"

diff --git a/var/lib/sorcery/modules/dl_handlers/dl_cvs
b/var/lib/sorcery/modules/dl_handlers/dl_cvs
index f191a99..be7131c 100755
--- a/var/lib/sorcery/modules/dl_handlers/dl_cvs
+++ b/var/lib/sorcery/modules/dl_handlers/dl_cvs
@@ -40,7 +40,7 @@
## No hints are defined currently.
##
#---------------------------------------------------------------------
-function dl_cvs_get() {
+dl_cvs_get() {
dl_command_check cvs || return 254

local target=$1
diff --git a/var/lib/sorcery/modules/dl_handlers/dl_dir
b/var/lib/sorcery/modules/dl_handlers/dl_dir
index 1b1fbc3..c9258f2 100755
--- a/var/lib/sorcery/modules/dl_handlers/dl_dir
+++ b/var/lib/sorcery/modules/dl_handlers/dl_dir
@@ -42,7 +42,7 @@
## Copies the specified dir url.
##
#---------------------------------------------------------------------
-function url_dir_get() {
+url_dir_get() {

local target=$1
local url_list=$2
diff --git a/var/lib/sorcery/modules/dl_handlers/dl_file
b/var/lib/sorcery/modules/dl_handlers/dl_file
index 35b4a06..3ca9ba3 100755
--- a/var/lib/sorcery/modules/dl_handlers/dl_file
+++ b/var/lib/sorcery/modules/dl_handlers/dl_file
@@ -20,7 +20,7 @@
## Copies the specified file url.
##
#---------------------------------------------------------------------
-function dl_file_get() {
+dl_file_get() {

local target=$1
local url_list=$2
diff --git a/var/lib/sorcery/modules/dl_handlers/dl_git
b/var/lib/sorcery/modules/dl_handlers/dl_git
index 7c3a7ff..3370894 100755
--- a/var/lib/sorcery/modules/dl_handlers/dl_git
+++ b/var/lib/sorcery/modules/dl_handlers/dl_git
@@ -20,7 +20,7 @@
## This handler only supports tree downloads.
##
#---------------------------------------------------------------------
-function dl_git_get () {
+dl_git_get() {
dl_command_check git || return 254

local target=$1
diff --git a/var/lib/sorcery/modules/dl_handlers/dl_hg
b/var/lib/sorcery/modules/dl_handlers/dl_hg
index 68e3616..5e1e271 100755
--- a/var/lib/sorcery/modules/dl_handlers/dl_hg
+++ b/var/lib/sorcery/modules/dl_handlers/dl_hg
@@ -19,7 +19,7 @@
## This handler only supports tree downloads.
##
#---------------------------------------------------------------------
-function dl_hg_get () {
+dl_hg_get() {
dl_command_check hg || return 254

local target=$1
diff --git a/var/lib/sorcery/modules/dl_handlers/dl_rsync
b/var/lib/sorcery/modules/dl_handlers/dl_rsync
index 8120d63..db1213c 100755
--- a/var/lib/sorcery/modules/dl_handlers/dl_rsync
+++ b/var/lib/sorcery/modules/dl_handlers/dl_rsync
@@ -51,7 +51,7 @@
## This handler supports both files and trees.
##
#---------------------------------------------------------------------
-function dl_rsync_get() {
+dl_rsync_get() {
dl_command_check rsync || return 254

local target=$1
@@ -86,7 +86,7 @@ function dl_rsync_get() {
## Private function. Calls rsync and beautifies output
##
#---------------------------------------------------------------------
-function dl_rsync_run_rsync() {
+dl_rsync_run_rsync() {
local target=$1
local url=$2
local dl_target=$3
diff --git a/var/lib/sorcery/modules/dl_handlers/dl_svn
b/var/lib/sorcery/modules/dl_handlers/dl_svn
index 818bf0e..ac8b061 100755
--- a/var/lib/sorcery/modules/dl_handlers/dl_svn
+++ b/var/lib/sorcery/modules/dl_handlers/dl_svn
@@ -20,7 +20,7 @@
## This handler only supports tree downloads.
##
#---------------------------------------------------------------------
-function dl_svn_get () {
+dl_svn_get() {
dl_command_check svn || return 254

local target=$1
diff --git a/var/lib/sorcery/modules/dl_handlers/dl_tla
b/var/lib/sorcery/modules/dl_handlers/dl_tla
index 716d2e3..7986f43 100755
--- a/var/lib/sorcery/modules/dl_handlers/dl_tla
+++ b/var/lib/sorcery/modules/dl_handlers/dl_tla
@@ -20,7 +20,7 @@
## This handler only supports tree downloads.
##
#
-----------------------------------------------------------------------------
-function dl_tla_get() {
+dl_tla_get() {
dl_command_check tla || return 254

local target=$1
diff --git a/var/lib/sorcery/modules/dl_handlers/dl_wget
b/var/lib/sorcery/modules/dl_handlers/dl_wget
index 4f5998c..85a7c06 100755
--- a/var/lib/sorcery/modules/dl_handlers/dl_wget
+++ b/var/lib/sorcery/modules/dl_handlers/dl_wget
@@ -20,7 +20,7 @@
##
#---------------------------------------------------------------------

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

@@ -56,7 +56,7 @@ function dl_wget_get() {
## Private Function. Call wgets to download the url.
##
#---------------------------------------------------------------------
-function dl_wget_call_wget() {
+dl_wget_call_wget() {
local FILE=$1
local URL=$2

@@ -78,7 +78,7 @@ function dl_wget_call_wget() {
## Private Function. Sets wget options
##
#---------------------------------------------------------------------
-function dl_wget_set_options() {
+dl_wget_set_options() {
local URL=$1
local hints="$2"

diff --git a/var/lib/sorcery/modules/libapi b/var/lib/sorcery/modules/libapi
index 5457089..9804d5f 100755
--- a/var/lib/sorcery/modules/libapi
+++ b/var/lib/sorcery/modules/libapi
@@ -143,7 +143,7 @@
## FORCE_DOWNLOAD. Calls download_src if the file must be downloaded.
##
#---------------------------------------------------------------------
-function acquire_src() {
+acquire_src() {
debug "libapi" "$FUNCNAME - $*"
real_acquire_src "$@"
}
@@ -168,7 +168,7 @@ function acquire_src() {
## </pre>
##
#---------------------------------------------------------------------
-function config_query () {
+config_query () {
debug "libapi" "config_query - $*"
real_config_query "$@"
}
@@ -190,7 +190,7 @@ function config_query () {
## </pre>
##
#---------------------------------------------------------------------
-function config_query_list () {
+config_query_list () {
debug "libapi" "config_query_list - $*"
real_config_query_list "$@"
}
@@ -231,7 +231,7 @@ function config_query_list () {
## </pre>
##
#---------------------------------------------------------------------
-function config_query_option () {
+config_query_option () {
debug "libapi" "config_query_option - $*"
real_config_query_option "$@"
}
@@ -253,7 +253,7 @@ function config_query_option () {
## </pre>
##
#---------------------------------------------------------------------
-function config_query_string () {
+config_query_string () {
debug "libapi" "config_query_string - $*"
real_config_query_string "$@"
}
@@ -267,7 +267,7 @@ function config_query_string () {
## If the default answer is anything other than 'y' then 'n' is assumed.
## returns the given spellname if it is installed
#---------------------------------------------------------------------
-function conflicts () {
+conflicts () {
debug "libapi" "conflicts - $*"
real_conflicts "$@"
}
@@ -299,7 +299,7 @@ function conflicts () {
## </pre>
##
#---------------------------------------------------------------------
-function default_sorcery_build () {
+default_sorcery_build () {
debug "libapi" "default_sorcery_build - $*"
real_default_sorcery_build "$@"
}
@@ -311,7 +311,7 @@ function default_sorcery_build () {
## Default download code, downloads each SOURCE[[:digit:]]*
##
#---------------------------------------------------------------------
-function default_sorcery_download() {
+default_sorcery_download() {
debug "libapi" "$FUNCNAME - $*"
real_default_sorcery_download "$@"
}
@@ -327,7 +327,7 @@ function default_sorcery_download() {
## </pre>
##
#---------------------------------------------------------------------
-function default_sorcery_install () {
+default_sorcery_install () {
debug "libapi" "default_sorcery_install - $*"
real_default_sorcery_install "$@"
}
@@ -338,7 +338,7 @@ function default_sorcery_install () {
## Only defined for BUILD_API==2
## Installs configuration files and documentation.
#---------------------------------------------------------------------
-function default_sorcery_install_extras () {
+default_sorcery_install_extras () {
debug "libapi" "default_sorcery_install_extras - $*"
real_default_sorcery_install_extras "$@"
}
@@ -352,7 +352,7 @@ function default_sorcery_install_extras () {
## equivalent to default_sorcery_post_install in BUILD_API==2
##
#---------------------------------------------------------------------
-function default_sorcery_post_build () {
+default_sorcery_post_build () {
debug "libapi" "default_sorcery_post_build - $*"
real_default_sorcery_post_build "$@"
}
@@ -364,7 +364,7 @@ function default_sorcery_post_build () {
## Puts the spell at the root of the stage root so manipulation of the
## installed files can happen
#---------------------------------------------------------------------
-function default_sorcery_post_install () {
+default_sorcery_post_install () {
debug "libapi" "default_sorcery_post_install - $*"
real_default_sorcery_post_install "$@"
}
@@ -376,7 +376,7 @@ function default_sorcery_post_install () {
## Transfers the files from the stage area to the system. Default is
## transfer_staged_spell
#---------------------------------------------------------------------
-function default_sorcery_transfer () {
+default_sorcery_transfer () {
debug "libapi" "default_sorcery_transfer - $*"
real_default_sorcery_transfer "$@"
}
@@ -387,7 +387,7 @@ function default_sorcery_transfer () {
## Creates the source directory and unpacks the source package into it.
## Used if no PRE_BUILD script is found for a spell.
#---------------------------------------------------------------------
-function default_sorcery_pre_build () {
+default_sorcery_pre_build () {
debug "libapi" "default_sorcery_pre_build - $*"
real_default_sorcery_pre_build "$@"
}
@@ -403,7 +403,7 @@ function default_sorcery_pre_build () {
## </pre>
##
#---------------------------------------------------------------------
-function default_sorcery_pre_install () {
+default_sorcery_pre_install () {
debug "libapi" "default_sorcery_pre_install - $*"
real_default_sorcery_pre_install "$@"
}
@@ -417,7 +417,7 @@ function default_sorcery_pre_install () {
## @See <@function var.lib.sorcery.modules.libdepends.html,real_depends> for
more details.
## Denotes that a spell requires another spell to work.
#---------------------------------------------------------------------
-function depends () {
+depends () {
debug "libapi" "depends - $*"
real_depends "$@"
}
@@ -427,7 +427,7 @@ function depends () {
## @See <@function
var.lib.sorcery.modules.libtrack.html,real_devoke_installwatch> for more
details.
## Stops using installwatch
#---------------------------------------------------------------------
-function devoke_installwatch () {
+devoke_installwatch () {
debug "libapi" "devoke_installwatch - $*"
real_devoke_installwatch "$@"
}
@@ -437,7 +437,7 @@ function devoke_installwatch () {
## @See <@function
var.lib.sorcery.modules.libtrack.html,real_devoke_stage_root> for more
details.
## Stops using stage root
#---------------------------------------------------------------------
-function devoke_stage_root () {
+devoke_stage_root () {
debug "libapi" "devoke_stage_root - $*"
real_devoke_stage_root "$@"
}
@@ -453,7 +453,7 @@ function devoke_stage_root () {
## downloaded as usual.
##
#---------------------------------------------------------------------
-function download_src() {
+download_src() {
debug "libapi" "$FUNCNAME - $*"
real_download_src "$@"
}
@@ -475,7 +475,7 @@ function download_src() {
## fi
## </pre>
#---------------------------------------------------------------------
-function force_depends() {
+force_depends() {
debug "libapi" "$FUNCNAME - $*"
real_force_depends "$@"
}
@@ -486,7 +486,7 @@ function force_depends() {
## Gathers all documentation files from source archive and installs
## them as part of the spell
#---------------------------------------------------------------------
-function gather_docs() {
+gather_docs() {
debug "libapi" "gather_docs - $*"
real_gather_docs "$@"
}
@@ -501,7 +501,7 @@ function gather_docs() {
## A prefix may be given and it will be prepended to each result value.
##
#---------------------------------------------------------------------
-function get_source_nums() {
+get_source_nums() {
debug "libapi" "$FUNCNAME - $*"
real_get_source_nums "$@"
}
@@ -519,7 +519,7 @@ function get_source_nums() {
## @return 0 if a provider could be found 1 if not
## @stdout the provider name(s)
#---------------------------------------------------------------------
-function get_spell_provider() {
+get_spell_provider() {
debug "libapi" "get_spell_provider - $*"
real_get_spell_provider "$@"
}
@@ -534,7 +534,7 @@ function get_spell_provider() {
## Return value is always success due to `file' workings
##
#---------------------------------------------------------------------
-function guess_compressor () {
+guess_compressor () {
debug "libapi" "guess_compressor - $*"
real_guess_compressor "$@"
}
@@ -556,7 +556,7 @@ function guess_compressor () {
## choice 2 is currently the default, someday there will be a menu to
## choose what the default will be
#------------------------------------------------------------------------
-function handle_changed_config() {
+handle_changed_config() {
debug "libapi" "handle_changed_config - $*"
real_handle_changed_config "$@"
}
@@ -569,7 +569,7 @@ function handle_changed_config() {
## Returns whether or not a given dependency is enabled
##
#---------------------------------------------------------------------
-function is_depends_enabled() {
+is_depends_enabled() {
debug "libapi" "is_depends_enabled - $*"
real_is_depends_enabled "$@"
}
@@ -581,7 +581,7 @@ function is_depends_enabled() {
## Returns the current version of the given spell
##
#---------------------------------------------------------------------
-function installed_version () {
+installed_version () {
debug "libapi" "installed_version - $*"
real_installed_version "$@"
}
@@ -595,7 +595,7 @@ function installed_version () {
## @See <@function
var.lib.sorcery.modules.libresurrect.html,real_install_config_file> for more
details.
## Returns the current version of the given spell
#------------------------------------------------------------------------
-function install_config_file() {
+install_config_file() {
debug "libapi" "install_config_file - $*"
real_install_config_file "$@"
}
@@ -605,7 +605,7 @@ function install_config_file() {
## @See <@function
var.lib.sorcery.modules.libtrack.html,real_invoke_installwatch> for more
details.
## Starts using installwatch
#---------------------------------------------------------------------
-function invoke_installwatch () {
+invoke_installwatch () {
debug "libapi" "invoke_installwatch - $*"
real_invoke_installwatch "$@"
}
@@ -615,7 +615,7 @@ function invoke_installwatch () {
## @See <@function
var.lib.sorcery.modules.libtrack.html,real_invoke_stage_root> for more
details.
## Starts using stage root
#---------------------------------------------------------------------
-function invoke_stage_root () {
+invoke_stage_root () {
debug "libapi" "invoke_stage_root - $*"
real_invoke_stage_root "$@"
}
@@ -634,7 +634,7 @@ function invoke_stage_root () {
## </pre>
##
#---------------------------------------------------------------------
-function list_remove () {
+list_remove () {
debug "libapi" "list_remove - $*"
real_list_remove "$@"
}
@@ -654,7 +654,7 @@ function list_remove () {
## </pre>
##
#---------------------------------------------------------------------
-function list_add () {
+list_add () {
debug "libapi" "list_add - $*"
real_list_add "$@"
}
@@ -682,7 +682,7 @@ function list_add () {
## </pre>
##
#---------------------------------------------------------------------
-function list_find () {
+list_find () {
debug "libapi" "list_find - $*"
real_list_find "$@"
}
@@ -695,7 +695,7 @@ function list_find () {
## echo's the given arguments if SILENT is not set.
##
#---------------------------------------------------------------------
-function message () {
+message () {
debug "libapi" "message - $*"
real_message "$@"
}
@@ -717,7 +717,7 @@ function message () {
## mk_source_dir /tmp/newdir
## </pre>
#---------------------------------------------------------------------
-function mk_source_dir () {
+mk_source_dir () {
debug "libapi" "mk_source_dir - $*"
real_mk_source_dir "$@"
}
@@ -728,7 +728,7 @@ function mk_source_dir () {
## @param spell file to check for modification
##
#---------------------------------------------------------------------
-function note_config_file() {
+note_config_file() {
debug "libapi" "note_config_file - $*"
real_note_config_file "$@"
}
@@ -742,7 +742,7 @@ function note_config_file() {
## Used by spells to make adding triggerse nice.
##
#---------------------------------------------------------------------
-function on_cast () {
+on_cast () {
debug "libapi" "on_cast - $*"
real_on_cast "$@"
}
@@ -758,7 +758,7 @@ function on_cast () {
## Used by spells to make adding triggers nice.
##
#---------------------------------------------------------------------
-function on_dispel () {
+on_dispel () {
debug "libapi" "on_dispel - $*"
real_on_dispel "$@"
}
@@ -773,7 +773,7 @@ function on_dispel () {
## Used by spells to make adding triggerse nice.
##
#---------------------------------------------------------------------
-function on_pre_cast () {
+on_pre_cast () {
debug "libapi" "on_pre_cast - $*"
real_on_pre_cast "$@"
}
@@ -787,7 +787,7 @@ function on_pre_cast () {
## Used by spells to make adding triggerse nice.
##
#---------------------------------------------------------------------
-function on_pre_dispel () {
+on_pre_dispel () {
debug "libapi" "on_pre_dispel - $*"
real_on_pre_dispel "$@"
}
@@ -802,7 +802,7 @@ function on_pre_dispel () {
## @See <@function
var.lib.sorcery.modules.libdepends.html,real_optional_depends> for more
details.
## Denotes that a spell can use another spell for additional functionality.
#---------------------------------------------------------------------
-function optional_depends () {
+optional_depends () {
debug "libapi" "optional_depends - $*"
real_optional_depends "$@"
}
@@ -818,7 +818,7 @@ function optional_depends () {
## </pre>
##
#---------------------------------------------------------------------
-function persistent_add () {
+persistent_add () {
debug "libapi" "persistent_add - $*"
real_persistent_add "$@"
}
@@ -834,7 +834,7 @@ function persistent_add () {
## </pre>
##
#---------------------------------------------------------------------
-function persistent_clear () {
+persistent_clear () {
debug "libapi" "persistent_clear - $*"
real_persistent_clear "$@"
}
@@ -848,7 +848,7 @@ function persistent_clear () {
## </pre>
##
#---------------------------------------------------------------------
-function persistent_load () {
+persistent_load () {
debug "libapi" "persistent_load - $*"
real_persistent_load "$@"
}
@@ -864,7 +864,7 @@ function persistent_load () {
## </pre>
##
#---------------------------------------------------------------------
-function persistent_remove () {
+persistent_remove () {
debug "libapi" "persistent_remove - $*"
real_persistent_remove "$@"
}
@@ -880,7 +880,7 @@ function persistent_remove () {
## </pre>
##
#---------------------------------------------------------------------
-function persistent_save () {
+persistent_save () {
debug "libapi" "persistent_save - $*"
real_persistent_save "$@"
}
@@ -899,7 +899,7 @@ function persistent_save () {
## 4 if the EXPORTS file doesn't exist
##
#---------------------------------------------------------------------
-function persistent_read () {
+persistent_read () {
debug "libapi" "persistent_read - $*"
real_persistent_read "$@"
}
@@ -913,7 +913,7 @@ function persistent_read () {
## dispelled. Usually called from the BUILD script of a spell.
##
#---------------------------------------------------------------------
-function prepare_install () {
+prepare_install () {
debug "libapi" "prepare_install - $*"
real_prepare_install "$@"
}
@@ -925,7 +925,7 @@ function prepare_install () {
##
## @return 0 if any provider of $1 is installed
#---------------------------------------------------------------------
-function provider_ok() {
+provider_ok() {
debug "libapi" "provider_ok - $*"
real_provider_ok "$@"
}
@@ -939,7 +939,7 @@ function provider_ok() {
## @See <@function
var.lib.sorcery.modules.libgrimoire.html,real_rm_source_dir> for more details.
##
#---------------------------------------------------------------------
-function rm_source_dir() {
+rm_source_dir() {
debug "libapi" "rm_source_dir - $*"
real_rm_source_dir "$@"
}
@@ -959,7 +959,7 @@ function rm_source_dir() {
## applied. Returns true or false based on the answer given.
##
#---------------------------------------------------------------------
-function query () {
+query () {
debug "libapi" "query - $*"
real_query "$@"
}
@@ -980,7 +980,7 @@ function query () {
## </pre>
##
#---------------------------------------------------------------------
-function query_string () {
+query_string () {
debug "libapi" "query_string - $*"
real_query_string "$@"
}
@@ -994,7 +994,7 @@ function query_string () {
## @See <@function var.lib.sorcery.modules.libdepends.html,real_depends> for
more details.
## Denotes that a spell requires another spell to work.
#---------------------------------------------------------------------
-function runtime_depends () {
+runtime_depends () {
debug "libapi" "runtime_depends - $*"
real_runtime_depends "$@"
}
@@ -1014,7 +1014,7 @@ function runtime_depends () {
## files before compiling. See the sed man page for more information.
##
#---------------------------------------------------------------------
-function sedit () {
+sedit () {
debug "libapi" "sedit - $*"
real_sedit "$@"
}
@@ -1028,7 +1028,7 @@ function sedit () {
##
## @stdout recursively prints out the spell that depend on the specified
spell
#---------------------------------------------------------------------
-function show_up_depends() {
+show_up_depends() {
debug "libapi" "spell_ok - $*"
real_show_up_depends "$@"
}
@@ -1040,7 +1040,7 @@ function show_up_depends() {
##
## @return 0 if the given spell's status is "installed"
#---------------------------------------------------------------------
-function spell_installed () {
+spell_installed () {
debug "libapi" "spell_installed - $*"
real_spell_installed "$@"
}
@@ -1052,7 +1052,7 @@ function spell_installed () {
##
## @return 0 if the given spell's status is "held"
#---------------------------------------------------------------------
-function spell_held() {
+spell_held() {
debug "libapi" "spell_held - $*"
real_spell_held "$@"
}
@@ -1064,7 +1064,7 @@ function spell_held() {
##
## @return 0 if the given spell's status is "installed" or "held"
#---------------------------------------------------------------------
-function spell_ok() {
+spell_ok() {
debug "libapi" "spell_ok - $*"
real_spell_ok "$@"
}
@@ -1076,7 +1076,7 @@ function spell_ok() {
##
## @return 0 if the given spell's status is "exiled"
#---------------------------------------------------------------------
-function spell_exiled() {
+spell_exiled() {
debug "libapi" "spell_ok - $*"
real_spell_exiled "$@"
}
@@ -1087,7 +1087,7 @@ function spell_exiled() {
## @param name of sub-depends
## @See <@function var.lib.sorcery.modules.libdepends
#---------------------------------------------------------------------
-function sub_depends() {
+sub_depends() {
debug "libapi" "sub_depends - $*"
real_sub_depends "$@"
}
@@ -1102,7 +1102,7 @@ function sub_depends() {
## @See <@function
var.lib.sorcery.modules.libdepends.html,real_suggest_depends> for more
details.
## Denotes that a spell can use another spell for additional functionality.
#---------------------------------------------------------------------
-function suggest_depends () {
+suggest_depends () {
debug "libapi" "suggest_depends - $*"
real_suggest_depends "$@"
}
@@ -1116,7 +1116,7 @@ function suggest_depends () {
## Note: zip is a special case because it doesn't work with streams.
##
#---------------------------------------------------------------------
-function uncompress () {
+uncompress () {
debug "libapi" "uncompress - $*"
real_uncompress "$@"
}
@@ -1220,7 +1220,7 @@ function uncompress () {
## checks on a single source.
##
#---------------------------------------------------------------------
-function unpack_file () {
+unpack_file () {
debug "libapi" "unpack_file - $*"
real_unpack_file "$@"
}
@@ -1233,7 +1233,7 @@ function unpack_file () {
## Interface to unpack a file without any verification.
##
#---------------------------------------------------------------------
-function unpack_file_simple() {
+unpack_file_simple() {
debug "libapi" "$FUNCNAME - $*"
real_unpack_file_simple "$@"
}
@@ -1248,7 +1248,7 @@ function unpack_file_simple() {
## Only with the "new" SOURCEn_(GPG|HASH|IGNORE) style.
##
#---------------------------------------------------------------------
-function verify_file () {
+verify_file () {
debug "libapi" "verify_file - $*"
real_verify_file "$@"
}
@@ -1278,7 +1278,7 @@ function verify_file () {
## fi
## </pre>
#---------------------------------------------------------------------
-function using_gcc() {
+using_gcc() {
debug "libapi" "$FUNCNAME - $*"
real_using_gcc "$@"
}
@@ -1295,7 +1295,7 @@ function using_gcc() {
## target spell, this lets you specify lots of triggers easily.
##
#---------------------------------------------------------------------
-function up_trigger() {
+up_trigger() {
debug "libapi" "$FUNCNAME - $*"
real_up_trigger "$@"
}
@@ -1309,7 +1309,7 @@ function up_trigger() {
## Useful for spells whose components are not dynamicly linked
## to glibc. Installwatch must be running for this to work.
#---------------------------------------------------------------------
-function track_manual() {
+track_manual() {
debug "libapi" "track_manual - $*"
real_track_manual "$@"
}
diff --git a/var/lib/sorcery/modules/libcast b/var/lib/sorcery/modules/libcast
index 38dd9bf..0bd285c 100755
--- a/var/lib/sorcery/modules/libcast
+++ b/var/lib/sorcery/modules/libcast
@@ -17,7 +17,7 @@
## into the build api that it is specified to use. (ie split BUILD or
## no split BUILD).
#---------------------------------------------------------------------
-function load_build_api() {
+load_build_api() {

debug "libcast" "Starting load_build_api"

@@ -38,7 +38,7 @@ function load_build_api() {
#---------------------------------------------------------------------
## Load the grimoire and section level FUNCTIONS file
#---------------------------------------------------------------------
-function load_functions_file() {
+load_functions_file() {
# the following allows spell writers to override certain functions
# in the build pipeline
USE_FUNCTIONS=${USE_FUNCTIONS:-on}
@@ -58,7 +58,7 @@ function load_functions_file() {
## Spells use this for compatibility checking. It is supposed to be
## lighter-weight than FUNCTIONS.
#---------------------------------------------------------------------
-function load_libcompat() {
+load_libcompat() {
[ -x $GRIMOIRE/libcompat ] && . $GRIMOIRE/libcompat
[ -x $SECTION_DIRECTORY/libcompat ] && . $SECTION_DIRECTORY/libcompat
return 0
@@ -70,7 +70,7 @@ function load_libcompat() {
## CONFIGURE/DEPENDS to PRE_BUILD, BUILD, COMPILE, INSTALL, etc.
## @Globals $SPELL_CONFIG $DEPENDS_CONFIG
#---------------------------------------------------------------------
-function prepare_spell_config() {
+prepare_spell_config() {

SPELL_CONFIG=$DEPENDS_CONFIG/$SPELL
if ! [ -x $SPELL_CONFIG ]; then
@@ -92,7 +92,7 @@ function prepare_spell_config() {
## @return 1 if the user chooses not to dispel the conflicting spell
## @return 1 or if there was a problem parsing the CONFLICTS file
#---------------------------------------------------------------------
-function query_conflicts() {
+query_conflicts() {
debug "build_api_common" "Starting query_conflicts() on $SPELL"
local ignore_conflict=$1
local output=${2:-$CONFLICT_LIST}
@@ -136,7 +136,7 @@ function query_conflicts() {
## @param spell whose conflicts to dispel
## @param file containing the list of conflicts
#---------------------------------------------------------------------
-function dispel_conflicts() {
+dispel_conflicts() {
local spell=$1
local conflict_list=${2:-$CONFLICT_LIST}
local conflict
@@ -162,7 +162,7 @@ function dispel_conflicts() {
## @return 0 if there are no security problem or the user acknowledges them.
## @return 1 if the user decides not to accept the security concerns
#---------------------------------------------------------------------
-function run_security() {
+run_security() {
debug "build_api_common" "Starting run_security() on $SPELL"
local rc=0
if [[ -f $SCRIPT_DIRECTORY/SECURITY ]]; then
@@ -181,7 +181,7 @@ function run_security() {
return $rc
}

-function query_custom_cflags() {
+query_custom_cflags() {
if [[ $PER_SPELL_CFLAGS == on ]]; then
query "Would you like to set custom optimizations for this spell?" n ||
return 0
@@ -234,7 +234,7 @@ function query_custom_cflags() {
## of FOO_ENABLED and FOO_DISABLED should be exactly equivalent to
## FOO_INSTALLED. FOO_ENABLED and FOO_DISABLED have an empty intersection
set.
#---------------------------------------------------------------------
-function query_services() {
+query_services() {
local XINETD_SCRIPTS
local INIT_SCRIPTS
local btmp xtmp itmp
@@ -430,7 +430,7 @@ function query_services() {
## @return nothing of importance, returns through a pointer
## @stdout a menu sans question, the caller needs to present the question
#---------------------------------------------------------------------
-function dual_service_query() {
+dual_service_query() {
local service=$1
local returnvar=$2
local XY=$3
@@ -483,7 +483,7 @@ function dual_service_query() {
## @return true if yes false if no
## @stdout a query supplied by the caller
#---------------------------------------------------------------------
-function service_query() {
+service_query() {
local service=$1
local question=$2
local L1=$3
@@ -516,7 +516,7 @@ function service_query() {
## Internal wrapper around the task of adding a persistent variable
## then storing something in it, or unsetting whatever used to be in it
#---------------------------------------------------------------------
-function service_store() {
+service_store() {
local VARNAME=$1
local list=$2
persistent_add $VARNAME
@@ -531,7 +531,7 @@ function service_store() {
#---------------------------------------------------------------------
## Installs the scripts selected from query_services
#---------------------------------------------------------------------
-function install_xinetd() {
+install_xinetd() {
if [[ $XINETD_INSTALLED ]] ; then
local install_dir=$INSTALL_ROOT/etc/xinetd.d
mkdir -p $install_dir
@@ -565,7 +565,7 @@ function install_xinetd() {
## this includes setting the disabled field appropriately and
## not trampling on pre-existing files by default
#---------------------------------------------------------------------
-function install_xinetd_sub() {
+install_xinetd_sub() {
local file=$1
local bfile
smgl_basename "$1" bfile
@@ -600,7 +600,7 @@ function install_xinetd_sub() {
#---------------------------------------------------------------------
## Handles the logic of enabling or disabling of an xinetd script
#---------------------------------------------------------------------
-function set_xinetd_state() {
+set_xinetd_state() {
local file=$1
local state=$2
if grep -q "\s*disable" $file ; then
@@ -617,7 +617,7 @@ function set_xinetd_state() {
## executable bit if the user specified that the init.d script should be
## started at bootup.
#---------------------------------------------------------------------
-function install_initd() {
+install_initd() {
if [[ $INIT_INSTALLED ]] ; then
local install_dir=$INSTALL_ROOT/etc/init.d
mkdir -p $install_dir
@@ -650,7 +650,7 @@ function install_initd() {
## Gets the cast lock for us and ensures that we've waited for all
## solo/non-solo casts to complete
#---------------------------------------------------------------------
-function acquire_cast_lock() {
+acquire_cast_lock() {
# locking - blocks normal spells if a solo cast is running,
# solo casts if any cast is running
message "${MESSAGE_COLOR}Waiting for any${DEFAULT_COLOR}${FILE_COLOR}" \
@@ -678,7 +678,7 @@ function acquire_cast_lock() {
## Takes the compile log and stuffs it into
## our compile log directory.
#---------------------------------------------------------------------
-function create_compile_log() {
+create_compile_log() {
local tmp_log=$C_LOG.2

message "${MESSAGE_COLOR}Creating compile log" \
@@ -720,7 +720,7 @@ function create_compile_log() {
## Prompts the user to view the compile log
## and deletes the temporary files too
#---------------------------------------------------------------------
-function view_compile_log() {
+view_compile_log() {

debug "libcast" "In view_compile_log, C_LOG=$C_LOG"
report $C_LOG "Compile log"
@@ -731,7 +731,7 @@ function view_compile_log() {
## Pawns the work off to <@function
var.lib.sorcery.modules.libsorcery,report>
## @Globals INST_LOG
#---------------------------------------------------------------------
-function report_install() {
+report_install() {

debug "libcast" "In report_install, INST_LOG=$INST_LOG"
report $INST_LOG "Install log"
@@ -742,7 +742,7 @@ function report_install() {
## @TODO This function is dumb. It should be fixed.
## @param download log file name
#---------------------------------------------------------------------
-function show_download_progress() {
+show_download_progress() {
[[ $SCREEN_NAME ]] && return
local download_log=$1

@@ -767,7 +767,7 @@ function show_download_progress() {
## @TODO fix the old style ad-hoc IPC
## @param Spell to show the download progress for
#---------------------------------------------------------------------
-function show_downloading() {
+show_downloading() {

local SPELL=$1
local download_log=$(get_spell_dl_log $SPELL)
@@ -795,7 +795,7 @@ function show_downloading() {
## @param Spell
## @Stdout file name
#---------------------------------------------------------------------
-function get_spell_dl_log() {
+get_spell_dl_log() {
echo "$TMP_DIR/download.$1"
}

diff --git a/var/lib/sorcery/modules/libcodex
b/var/lib/sorcery/modules/libcodex
index b7b3e1d..07f3b5c 100755
--- a/var/lib/sorcery/modules/libcodex
+++ b/var/lib/sorcery/modules/libcodex
@@ -71,7 +71,7 @@
## CODEX_ROOT is the default grimoire location
## NOTE: one can specify partial paths
#---------------------------------------------------------------------
-function codex_canonicalize_grimoire_name() {
+codex_canonicalize_grimoire_name() {
local grimoire=$1
if [ "${grimoire:0:1}" == "/" ] ; then
# already a full path
@@ -101,7 +101,7 @@ function codex_canonicalize_grimoire_name() {
# do nothing and preserve return code
}

-function codex_is_canonicalized() {
+codex_is_canonicalized() {
if [ ${1:0:1} != "/" ] ; then
message "$1 is not canonicalized!!"
message "If you see this please contact the sorcery team"
@@ -129,7 +129,7 @@ function codex_is_canonicalized() {
## </pre>
##
#---------------------------------------------------------------------
-function codex_find_grimoire() {
+codex_find_grimoire() {
local cfg_lookup=$1
local cfg_grimoire
local use_refs=no
@@ -178,7 +178,7 @@ function codex_find_grimoire() {
## This function does not currently delete duplicate entries.
##
#---------------------------------------------------------------------
-function codex_add_grimoire() {
+codex_add_grimoire() {
local NEW_GRIMOIRE=$1
local POSITION=$2
local OVERWRITE=$3
@@ -255,7 +255,7 @@ function codex_add_grimoire() {
## Removes the specified grimoire from the list of grimoires.
##
#---------------------------------------------------------------------
-function codex_remove_grimoire() {
+codex_remove_grimoire() {
local GRIMOIRE_TO_DELETE="$1"

codex_is_canonicalized $GRIMOIRE_TO_DELETE || return 1
@@ -289,7 +289,7 @@ function codex_remove_grimoire() {
## Then reloads the list
##
#---------------------------------------------------------------------
-function codex_remove_duplicates() {
+codex_remove_duplicates() {

local GRIMOIRES=`codex_get_all_grimoires`
local CURRENT_GRIMOIRE=0
@@ -330,7 +330,7 @@ function codex_remove_duplicates() {
## in the argument list. Grimoire names need not be canonicalized
##
#---------------------------------------------------------------------
-function codex_set_grimoires() {
+codex_set_grimoires() {

local NEW_GRIMOIRE
local GRIMOIRE_COUNT=0
@@ -356,7 +356,7 @@ function codex_set_grimoires() {
## @Stdout all grimoires in the codex.
##
#---------------------------------------------------------------------
-function codex_get_all_grimoires() {
+codex_get_all_grimoires() {
debug "libcodex" "codex_get_all_grimoires()"
echo "${GRIMOIRE_DIR[*]}" | tr '[\t ]' '\n'
return $?
@@ -367,7 +367,7 @@ function codex_get_all_grimoires() {
##
## returns true if the grimoire is set local, false otherwise.
#---------------------------------------------------------------------
-function codex_is_local () {(
+codex_is_local() {(
local g_name=$1 idx

codex_find_grimoire $g_name grimoire idx
@@ -395,7 +395,7 @@ function codex_is_local () {(
## listed.
##
#---------------------------------------------------------------------
-function codex_find_section_by_name() {
+codex_find_section_by_name() {
local SECTION_NAME="$1"
local GRIMOIRE=''

@@ -419,7 +419,7 @@ function codex_find_section_by_name() {
## @Stdout all section names from all grimoires.
##
#---------------------------------------------------------------------
-function codex_get_all_section_names() {
+codex_get_all_section_names() {
codex_get_all_sections | get_basenames
}

@@ -430,7 +430,7 @@ function codex_get_all_section_names() {
## @Stdout all sections from all grimoires or only from the specified
grimoires.
##
#---------------------------------------------------------------------
-function codex_get_all_sections() {
+codex_get_all_sections() {
if [[ $# -gt 0 ]]; then
codex_get_sections $@
else
@@ -445,7 +445,7 @@ function codex_get_all_sections() {
## Relies on a wider-scope function <@function codex_get_sections>.
##
#---------------------------------------------------------------------
-function codex_get_section_names() {
+codex_get_section_names() {
codex_is_canonicalized $1 || return 1
codex_get_sections "$1" | get_basenames
}
@@ -456,7 +456,7 @@ function codex_get_section_names() {
## @Stdout Lists all sections in the specified grimoire directories.
##
#---------------------------------------------------------------------
-function codex_get_sections() {
+codex_get_sections() {
debug "libcodex" "codex_get_sections() - $@"
local GRIMOIRE

@@ -485,7 +485,7 @@ function codex_get_sections() {
## @return 1 otherwise
##
#---------------------------------------------------------------------
-function codex_is_directory_a_spell() {
+codex_is_directory_a_spell() {
[ -x "$1/DETAILS" ]
}

@@ -498,7 +498,7 @@ function codex_is_directory_a_spell() {
## @return 1 othterwise
##
#---------------------------------------------------------------------
-function codex_does_spell_exist() {
+codex_does_spell_exist() {
local i
local retValue=0
[[ "$#" -lt 1 ]] && return 1
@@ -523,7 +523,7 @@ function codex_does_spell_exist() {
## spell. If an invalid spell name is provided, nothing is listed.
##
#---------------------------------------------------------------------
-function codex_find_spell_by_name() {
+codex_find_spell_by_name() {

debug "libcodex" "codex_find_spell_by_name - $*"

@@ -539,7 +539,7 @@ function codex_find_spell_by_name() {
## Nothing is listed if the section doesn't include any spells.
##
#---------------------------------------------------------------------
-function codex_get_spells_in_section() {
+codex_get_spells_in_section() {
debug "libcodex" "codex_get_spells_in_section - $*"
codex_is_canonicalized "$1" || return 1
local section="$(smgl_basename $1)"
@@ -561,7 +561,7 @@ function codex_get_spells_in_section() {
## if the section doesn't include any spells.
##
#---------------------------------------------------------------------
-function codex_get_spell_names() {
+codex_get_spell_names() {
codex_get_spells_in_section "$1" | get_basenames
}

@@ -578,7 +578,7 @@ function codex_get_spell_names() {
## @NOTE are listed.
##
#---------------------------------------------------------------------
-function codex_get_all_spells() {
+codex_get_all_spells() {
local section
for section in `codex_get_all_sections $@`; do
codex_get_spells_in_section $section
@@ -593,7 +593,7 @@ function codex_get_all_spells() {
## there are no spells with the given name.
##
#---------------------------------------------------------------------
-function codex_get_spell_section() {
+codex_get_spell_section() {
codex_find_spell_by_name "$1" | get_dirnames
}

@@ -607,7 +607,7 @@ function codex_get_spell_section() {
## are no spells with the given name, nothing is listed.
##
#---------------------------------------------------------------------
-function codex_get_spell_section_name() {
+codex_get_spell_section_name() {
codex_find_spell_by_name "$1" | get_dirnames | get_basenames
}

@@ -619,7 +619,7 @@ function codex_get_spell_section_name() {
## Unets all these global variables.
##
#---------------------------------------------------------------------
-function codex_clear_current_spell() {
+codex_clear_current_spell() {
unset GRIMOIRE SECTION SECTION_DIRECTORY SPELL \
SPELL_DIRECTORY SCRIPT_DIRECTORY SPELL_DESCRIPTION \
VERSION SHORT UPDATED WEB_SITE ENTERED MAINTAINER \
@@ -637,7 +637,7 @@ function codex_clear_current_spell() {
## Assumes the directory passed in is a valid spell directory.
##
#---------------------------------------------------------------------
-function codex_set_current_spell() {
+codex_set_current_spell() {

debug "libcodex" "runing codex_set_current_spell"

@@ -674,7 +674,7 @@ function codex_set_current_spell() {
## Load just the very basics for a spell, skip build api, libcompat
## and other debug stuff. Intended for use in tight loops.
#---------------------------------------------------------------------
-function codex_set_current_spell_quick() {
+codex_set_current_spell_quick() {
codex_clear_current_spell

codex_get_spell_paths $1
@@ -691,7 +691,7 @@ function codex_set_current_spell_quick() {
## Setup the various spell paths associated with a spell without
## loading it.
#---------------------------------------------------------------------
-function codex_get_spell_paths() {
+codex_get_spell_paths() {
SPELL_DIRECTORY=$1
SCRIPT_DIRECTORY=$1
if test -e $SPELL_DIRECTORY/SCRIBBLED ; then
@@ -722,7 +722,7 @@ function codex_get_spell_paths() {
## @return 1 if the given name is not a spell.
##
#---------------------------------------------------------------------
-function codex_set_current_spell_by_name() {
+codex_set_current_spell_by_name() {
debug "libcodex" "codex_set_current_spell_by_name -- $1"
local SPELL_NAME=`codex_find_spell_by_name "$1"`
debug "libcodex" $SPELL_NAME
@@ -737,7 +737,7 @@ function codex_set_current_spell_by_name() {
## NS-PLUGIN-COMPATIBLE
##
#---------------------------------------------------------------------
-function codex_find_spell_provides() {
+codex_find_spell_provides() {
local spell="$1"
local feature grimoire
local features=$(
@@ -771,7 +771,7 @@ function codex_find_spell_provides() {
## the category in the first grimoire the spell is seen in (because that
## is the only one that will be cast) otherwise it is not listed.
#---------------------------------------------------------------------
-function find_providers() {
+find_providers() {
local feature="$1"
local provider GRIMOIRE spell_path
local providers=$(
@@ -810,7 +810,7 @@ function find_providers() {
## This will return only the first match found.
##
#---------------------------------------------------------------------
-function codex_cache_spell_lookup() {
+codex_cache_spell_lookup() {
local spell="$1"
shift
debug "libcodex" "looking up $spell in the caches of: $*"
@@ -831,7 +831,7 @@ function codex_cache_spell_lookup() {
## If it still doesn't exist, the barf an error
##
#---------------------------------------------------------------------
-function codex_check_cache() {
+codex_check_cache() {
ret=0
while ! [ $# = 0 ]; do
if ! codex_is_canonicalized "$1" || ! [ -x "$1" ]; then
@@ -856,27 +856,28 @@ function codex_check_cache() {
## is asked for.
##
#---------------------------------------------------------------------
-function codex_create_cache() {
-
+codex_create_cache() {
debug "libcodex" "codex_create_cache - $*"
- local list="$*"
- [[ $list ]] || list="${GRIMOIRE_DIR[*]}"
-
- for i in $list ; do
- codex_find_in_grimoire $i "DETAILS" | \
- sed 's@\(.*\)/\([^/]*\)/DETAILS@\2 \1@' | \
- sort > $i/$SPELL_INDEX_FILE
-
- codex_list_provides $i > "$i/$PROVIDE_INDEX_FILE"
+ [ $# = 0 ] && set -- "${GRIMOIRE_DIR[@]}"
+ while [ $# != 0 ]; do
+ codex_find_in_grimoire "$1" "DETAILS" |
+ awk -F/ '{
+ spell = $(NF-1)
+ sub(/[/][^/]+[/][^/]+$/,"")
+ print spell, $0
+}' |
+ sort > "$1/$SPELL_INDEX_FILE"
+
+ codex_list_provides "$1" > "$1/$PROVIDE_INDEX_FILE"
+ shift
done
-
}


#---------------------------------------------------------------------
## Create in-memory spell lookup table for named grimoires.
#---------------------------------------------------------------------
-function codex_create_in_memory_cache() {
+codex_create_in_memory_cache() {
local list
if [[ $1 == -i ]] ; then
list=$SPELL_STATUS
@@ -915,7 +916,7 @@ function codex_create_in_memory_cache() {
#---------------------------------------------------------------------
## Creae in-memory spell lookup table for all known grimoires.
#---------------------------------------------------------------------
-function codex_create_in_memory_cache_all() {
+codex_create_in_memory_cache_all() {
codex_create_in_memory_cache "$@" $(codex_get_all_grimoires)
}

@@ -929,7 +930,7 @@ function codex_create_in_memory_cache_all() {
## Prints every file matching file-name in grimoire
##
#---------------------------------------------------------------------
-function codex_find_in_grimoire () {
+codex_find_in_grimoire() {
find "$1" -follow -maxdepth 3 -mindepth 3 -perm /700 -name "$2"
}

@@ -941,7 +942,7 @@ function codex_find_in_grimoire () {
## shell /home/martin/p4/grimoire/shell-term-fm/sash
##
#---------------------------------------------------------------------
-function codex_list_provides () {
+codex_list_provides() {
grimoire=$1

for file in $(codex_find_in_grimoire $grimoire "PROVIDES"); do
@@ -955,7 +956,7 @@ function codex_list_provides () {
## Creates keyword index
##
#---------------------------------------------------------------------
-function codex_create_keyword_cache () { (
+codex_create_keyword_cache() { (
grimoire=$1

for file in $(codex_find_in_grimoire "$grimoire" "DETAILS"); do
@@ -973,7 +974,7 @@ function codex_create_keyword_cache () { (
## Multiversioned spells will a dummy entry. Persistent
## variables are ignored.
#---------------------------------------------------------------------
-function codex_create_version_cache () {
+codex_create_version_cache() {
xargs < <(codex_find_in_grimoire "$1" DETAILS) \
awk -F"[\"'= ]+" '
function p(v) { return v in f ? f[v] : 0 }
@@ -1003,12 +1004,13 @@ function codex_create_version_cache () {
## @return 1 otherwise
## checks if servicename exists.
#---------------------------------------------------------------------
-function codex_does_service_exist()
+codex_does_service_exist()
{
- local SERVICE="$@"
- for GRIMOIRE in $(codex_get_all_grimoires); do
- grep -qE '^'$SERVICE' ' "$GRIMOIRE/$PROVIDE_INDEX_FILE" && return 0
- done
+ awk -v idx="/$PROVIDE_INDEX_FILE" -v service="$1" '
+ found = $1 == service { exit }
+ END { exit !found }
+ BEGIN { for (i in ARGV) ARGV[i] = ARGV[i] idx }
+ ' $(codex_get_all_grimoires)
}


@@ -1021,7 +1023,7 @@ function codex_does_service_exist()
## CODEX_FOUND_SPELL is set if a spell was found
##
#---------------------------------------------------------------------
-function codex_find_spell_or_section_by_name() {
+codex_find_spell_or_section_by_name() {
local SPELL_OR_SECTION="$1"

CODEX_FOUND_SECTION=""
@@ -1043,7 +1045,7 @@ function codex_find_spell_or_section_by_name() {
## empty string if the directory is not a valid spell.
##
#---------------------------------------------------------------------
-function codex_get_spell_description() {
+codex_get_spell_description() {
local width=$(stty size | cut -d' ' -f2)
codex_is_directory_a_spell "$1" && . "$1/DETAILS" | fmt -w $width -s
}
diff --git a/var/lib/sorcery/modules/libcrossinstall
b/var/lib/sorcery/modules/libcrossinstall
index e184e70..a313500 100755
--- a/var/lib/sorcery/modules/libcrossinstall
+++ b/var/lib/sorcery/modules/libcrossinstall
@@ -14,7 +14,7 @@
## TRACK_ROOT, STATE_ROOT, and someday CODEX_ROOT
##
#---------------------------------------------------------------------
-function install_root_menu() {
+install_root_menu() {

debug "libcrossinstall" "cross_install_menu is being built now..."
local C_HELP="Fill in your own preferred install cache location."
@@ -54,7 +54,7 @@ function install_root_menu() {
## This menu function allows the user to fill in an INSTALL_CACHE location.
##
#---------------------------------------------------------------------
-function set_install_cache_menu() {
+set_install_cache_menu() {

debug "libcrossinstall" "set_install_cache_menu - is starting..."
local PROMPT="Please enter the install cache location where cache tarballs
will be stored"
@@ -74,7 +74,7 @@ function set_install_cache_menu() {
## This menu function allows the user to fill in an INSTALL_ROOT location.
##
#---------------------------------------------------------------------
-function set_install_root_menu() {
+set_install_root_menu() {

debug "libcrossinstall" "set_install_root_menu - is starting..."
local PROMPT="Please enter the install root location where you want file
installed"
@@ -94,7 +94,7 @@ function set_install_root_menu() {
## This menu function allows the user to fill in an STATE_ROOT location.
##
#---------------------------------------------------------------------
-function set_state_root_menu() {
+set_state_root_menu() {

debug "libcrossinstall" "set_state_root_menu - is starting..."
local PROMPT="Please enter location where you want state files to be"
@@ -114,7 +114,7 @@ function set_state_root_menu() {
## This menu function allows the user to fill in an TRACK_ROOT location.
##
#---------------------------------------------------------------------
-function set_track_root_menu() {
+set_track_root_menu() {

debug "libcrossinstall" "set_track_root_menu - is starting..."
local PROMPT="Please enter the location where you want files tracked
relative to"
@@ -134,7 +134,7 @@ function set_track_root_menu() {
## This expects the user to have the sorcery tarball already downloaded
## and in $SOURCE_CACHE.
#------------------------------
-function replicate_sorcery() {
+replicate_sorcery() {
SOURCE=$SOURCE_CACHE/sorcery-$SORCERY_BRANCH.tar.bz2
SOURCE_DIRECTORY=$BUILD_DIRECTORY/sorcery

diff --git a/var/lib/sorcery/modules/libdepends
b/var/lib/sorcery/modules/libdepends
index 53737a5..d31af79 100755
--- a/var/lib/sorcery/modules/libdepends
+++ b/var/lib/sorcery/modules/libdepends
@@ -76,7 +76,7 @@
## @param Spell to prepare
## @Globals SCRIPT_DIRECTORY
#---------------------------------------------------------------------
-function run_prepare()
+run_prepare()
{
local SPELL=$1

@@ -100,7 +100,7 @@ function run_prepare()
## during this phase of things, right now its a placeholder
## @param Spell
#---------------------------------------------------------------------
-function run_other() {
+run_other() {
local SPELL=$1
# ask the questions about xinetd/initd script installation
persistent_load &&
@@ -122,7 +122,7 @@ function run_other() {
## Run the spell's CONFIGURE script if it exists
## @param Spell to configure
#---------------------------------------------------------------------
-function run_configure() {
+run_configure() {
local SPELL=$1
debug "cast" "run_configure() - SCRIPT_DIRECTORY = $SCRIPT_DIRECTORY"

@@ -140,7 +140,7 @@ function run_configure() {
## Run a spell's DEPENDS if it exists
## @param Spell
#---------------------------------------------------------------------
-function run_depends() {
+run_depends() {
local SPELL=$1
debug "cast" "run_depends() - SCRIPT_DIRECTORY = $SCRIPT_DIRECTORY"

@@ -158,7 +158,7 @@ function run_depends() {
## Run a spell's UP_TRIGGERS if it exists
## @param Spell
#---------------------------------------------------------------------
-function run_up_triggers() {
+run_up_triggers() {
local SPELL=$1
debug "cast" "run_up_triggers() - SCRIPT_DIRECTORY = $SCRIPT_DIRECTORY"

@@ -176,7 +176,7 @@ function run_up_triggers() {
## These come from the live sub-depends table and from spells that
## have already been processed
#---------------------------------------------------------------------
-function run_our_sub_depends() {
+run_our_sub_depends() {
$STD_DEBUG
local sub_depends pair
# do all sub-depends on us from live-table first, they get priority
@@ -210,7 +210,7 @@ function run_our_sub_depends() {
#---------------------------------------------------------------------
## run any sub-depends that we requested on behalf of the sub-dependee
#---------------------------------------------------------------------
-function run_other_sub_depends() {
+run_other_sub_depends() {
$STD_DEBUG
local this_spell=$1
local SPELL sub_dependee sub_depends pair
@@ -248,7 +248,7 @@ function run_other_sub_depends() {
## Expects the sub-dependee to be loaded.
## If the spell does not have a SUB_DEPENDS file, it is a failure.
#---------------------------------------------------------------------
-function process_sub_depends() {
+process_sub_depends() {
$STD_DEBUG
local requester=$1
local sub_dependee=$2
@@ -281,19 +281,17 @@ function process_sub_depends() {

######################END CALLS TO OUTSIDE WORLD########################

-function __comp_depends_aux() {
+__comp_depends_aux() {
#$2==hash table to fill
- local pattern="required|optional"
- if [ "$3" ]; then
- pattern="$pattern|runtime|suggest"
- fi
touch "$DEPENDS_STATUS" "$SPELL_STATUS" >/dev/null 2>&1
lock_file "$DEPENDS_STATUS"
lock_file "$SPELL_STATUS"
while read a b; do
hash_put "$2" "$a" "$b"
done < <(
- awk -F: -v reverse="$1" -v pattern="$pattern" -v status="${4:-on}" '
+ awk -F: -v reverse="$1" \
+ -v pattern="required|optional${3:+|runtime|suggest}" \
+ -v status="${4:-on}" '
FNR == 1 { file++ }
file == 1 {
if ($3 == status && $4 ~ pattern) {
@@ -322,7 +320,7 @@ function __comp_depends_aux() {
## Then evaluate the output, thus filling a libhash with dependency info.
## @param Name of hash table to put dependencies
#---------------------------------------------------------------------
-function compute_installed_depends() {
+compute_installed_depends() {
__comp_depends_aux 0 "$@"
}

@@ -333,7 +331,7 @@ function compute_installed_depends() {
## Then evaluate the output, thus filling a libhash with dependency info.
## @param Name of hash table to fill with dependencies
#---------------------------------------------------------------------
-function compute_reverse_installed_depends() {
+compute_reverse_installed_depends() {
__comp_depends_aux 1 "$@"
}

@@ -358,7 +356,7 @@ function compute_reverse_installed_depends() {
## @param Hashtable name for spells with problem in resolution (or something)
## @param Hashtable name for spells which cannot cast
#---------------------------------------------------------------------
-function compute_uninstalled_depends()
+compute_uninstalled_depends()
{

# $1=table to place spells in
@@ -415,7 +413,7 @@ function compute_uninstalled_depends()
## No functions except libdepends functions should use this.
## @param Spell
#---------------------------------------------------------------------
-function private_run_depends()
+private_run_depends()
{
debug "libdepends" "$FUNCNAME - $*"
local SPELL=$1
@@ -500,7 +498,7 @@ function private_run_depends()
## rebuild it.
## @param Spell
#---------------------------------------------------------------------
-function private_should_cast()
+private_should_cast()
{
local each
# order is important here...
@@ -539,7 +537,7 @@ function private_should_cast()
## @param Spell name
## Find all the spells that depend on the spell given as $1
#---------------------------------------------------------------------
-function private_upward_depends() {
+private_upward_depends() {
if [[ "$RECAST_UP" ]] ; then
local tmp
# Note, use the reverse depends tree for this when we get a chance
@@ -581,7 +579,7 @@ private_recast_optionals_sub() {
## dependency disabled, ask if the user wants to recast the spell.
## Also finds disabled features that the current spell is a provider of.
#---------------------------------------------------------------------
-function private_recast_optionals() {
+private_recast_optionals() {
if [[ $RECAST_OPTIONALS ]] && [[ $RECAST_OPTIONALS != ignore ]] ; then
local spell j enabled
let j=${#NEW_UP_DEPENDS[*]}
@@ -635,7 +633,7 @@ function private_recast_optionals() {
##
## Called by real_depends and real_runtime_depends
#---------------------------------------------------------------------
-function real_generic_required_depends()
+real_generic_required_depends()
{
local failure_ok=$1
local article=$2
@@ -755,7 +753,7 @@ function real_generic_required_depends()
## Passthrough to real_generic_required_depends, specifies the
## parts that differ from runtime depends
#---------------------------------------------------------------------
-function real_depends() {
+real_depends() {
real_generic_required_depends "no" "a" "dependency" "required" "$@"
}

@@ -763,7 +761,7 @@ function real_depends() {
## Passthrough to real_generic_required_depends, specifies the
## parts that differ from required depends
#---------------------------------------------------------------------
-function real_runtime_depends() {
+real_runtime_depends() {
real_generic_required_depends "yes" "a" "runtime dependency" "runtime" "$@"
}

@@ -778,7 +776,7 @@ function real_runtime_depends() {
##
## Called by real_depends and real_runtime_depends
#---------------------------------------------------------------------
-function real_generic_optional_depends()
+real_generic_optional_depends()
{
local failure_ok=$1
local article=$2
@@ -903,7 +901,7 @@ function real_generic_optional_depends()
## Passthrough to real_generic_optional_depends, specifies the
## parts that differ from suggest depends
#---------------------------------------------------------------------
-function real_optional_depends() {
+real_optional_depends() {
real_generic_optional_depends "no" "an" "optional dependency" "optional"
"$@"
}

@@ -911,7 +909,7 @@ function real_optional_depends() {
## Passthrough to real_generic_required_depends, specifies the
## parts that differ from optional depends
#---------------------------------------------------------------------
-function real_suggest_depends() {
+real_suggest_depends() {
real_generic_optional_depends "yes" "a" "suggested dependency" "suggest"
"$@"
}

@@ -923,7 +921,7 @@ function real_suggest_depends() {
## @param Enabled options
## @param Description
#---------------------------------------------------------------------
-function work_depends_provider()
+work_depends_provider()
{

debug "libdepends" "$FUNCNAME - $@"
@@ -1019,7 +1017,7 @@ function work_depends_provider()
## @param Spell
## @param enabled options
#---------------------------------------------------------------------
-function work_depends_spell()
+work_depends_spell()
{
debug "libdepends" "$FUNCNAME - $@"

@@ -1051,7 +1049,7 @@ function work_depends_spell()
## @param description
## Handles optional dependency on a provider.
#---------------------------------------------------------------------
-function work_optional_depends_provider()
+work_optional_depends_provider()
{

debug "libdepends" "$FUNCNAME - $@"
@@ -1177,7 +1175,7 @@ function work_optional_depends_provider()
## h/H is pressed. Type of query is chosen in sorcery feature menu.
##
#---------------------------------------------------------------------
-function optional_depends_query() {
+optional_depends_query() {
local _response
local spell_name=$1
local time_to_answer=$PROMPT_DELAY
@@ -1225,7 +1223,7 @@ function optional_depends_query() {
## @param description
## Handles optional dependency on a spell.
#---------------------------------------------------------------------
-function work_optional_depends_spell()
+work_optional_depends_spell()
{

debug "libdepends" "$FUNCNAME - $@"
@@ -1340,7 +1338,7 @@ function work_optional_depends_spell()
## Present a list to the user complete with info about whats installed
## and what isnt and allow a default value to be used
#---------------------------------------------------------------------
-function select_provider()
+select_provider()
{
local returnvar=$1
local default=$2
@@ -1393,7 +1391,7 @@ function select_provider()
## Create a trigger on ourself effecting the target spell,
## shorthand for putting a TRIGGERS file in the target spell.
#---------------------------------------------------------------------
-function real_up_trigger() {
+real_up_trigger() {
message "${SPELL_COLOR}${SPELL}${DEFAULT_COLOR}" \
"${CHECK_COLOR}triggers a${DEFAULT_COLOR}" \
"${SPELL_COLOR}${2}${DEFAULT_COLOR}" \
@@ -1410,7 +1408,7 @@ function real_up_trigger() {
## Register a trigger, when $SPELL is cast, a $ACTION is executed
## on $TARGET
#---------------------------------------------------------------------
-function private_up_trigger() {
+private_up_trigger() {
local SPELL=$1
local TARGET=$2
local ACTION=$3
@@ -1437,7 +1435,7 @@ function private_up_trigger() {
## This queues the sub-depends for later processing, if the sub-dependee
## does not already support the sub-depends.
#---------------------------------------------------------------------
-function real_sub_depends() {
+real_sub_depends() {
$STD_DEBUG
local requester=$SPELL
local sub_dependee=$1
@@ -1504,7 +1502,7 @@ function real_sub_depends() {
## if the spell was already looked at and didnt need processing, then
## it'll get re-processed (assuming the caller also did a depends on it)
#---------------------------------------------------------------------
-function real_force_depends() {
+real_force_depends() {
debug "libdepends" "$FUNCNAME - $SPELL - $@"
local check
hash_get_ref "depends_looked_at" "$1" check
@@ -1523,7 +1521,7 @@ function real_force_depends() {
## @param Spell
## @param on/off
#---------------------------------------------------------------------
-function private_common_depends()
+private_common_depends()
{
debug "libdepends" "$FUNCNAME - $SPELL - $@"
add_depends $spell_depends "$SPELL" "$@"
@@ -1547,7 +1545,7 @@ function private_common_depends()
## Default trigger checking function. Asks user if they want to
## run the trigger.
#---------------------------------------------------------------------
-function real_default_sorcery_trigger_check() {
+real_default_sorcery_trigger_check() {
message "${SPELL_COLOR}${SPELL}${DEFAULT_COLOR}" \
"${CHECK_COLOR}triggers a" \
"${SPELL_COLOR}${ACTION}${DEFAULT_COLOR}" \
@@ -1559,7 +1557,7 @@ function real_default_sorcery_trigger_check() {
#---------------------------------------------------------------------
## Inspects each trigger, asks the user if they want to run it.
#---------------------------------------------------------------------
-function private_add_triggerees() {
+private_add_triggerees() {

# add the spells that we trigger to the $spells list
# having duplicate items is okay
@@ -1600,7 +1598,7 @@ function private_add_triggerees() {
#---------------------------------------------------------------------
## Adds the dependency to the hastable
#---------------------------------------------------------------------
-function private_add_depends()
+private_add_depends()
{
debug "libdepends" "$FUNCNAME: SPELL=$SPELL, NEW_DEPENDS=${NEW_DEPENDS[*]}"
hash_append "$CAST_HASH" "$SPELL" "${NEW_DEPENDS[*]}"
@@ -1636,7 +1634,7 @@ function private_add_depends()
## Determine if spell should be lazily updated, possible asks the user
## what to do.
#---------------------------------------------------------------------
-function want_lazy_update() {
+want_lazy_update() {
if [[ $LAZY_DEPENDS_UPDATES ]] && [[ $LAZY_DEPENDS_UPDATES != ignore ]] ;
then
if does_spell_need_update "$1" ; then
depends_message "$1" "needs updating"
@@ -1652,7 +1650,7 @@ function want_lazy_update() {
return 1
}

-function depends_message() {
+depends_message() {
if [[ $# -ge 2 ]] ; then
message -n "${SPELL_COLOR}${1}${DEFAULT_COLOR}" \
"${CHECK_COLOR}${2}${DEFAULT_COLOR}"
@@ -1672,7 +1670,7 @@ function depends_message() {
## @param Spell name
## Removes a dependency and its dependees from the to_cast list.
#---------------------------------------------------------------------
-function private_remove_dependees()
+private_remove_dependees()
{
local spell=$1
local removed_list dependee dependees
@@ -1730,7 +1728,7 @@ function private_remove_dependees()
## @param Spell name
## Does the actual removal
#---------------------------------------------------------------------
-function private_discard_spell()
+private_discard_spell()
{
local spell=$1
local failed=$2
@@ -1764,7 +1762,7 @@ function private_discard_spell()
## Find all the spells already processed that depend on the spell given as $1
## Unlike private_upward_depends, this one works with the uncommitted info
#---------------------------------------------------------------------
-function uncommitted_upward_depends() {
+uncommitted_upward_depends() {
local _spell=$1
local _upvar=$2
local candidate _dependees _deps
@@ -1787,7 +1785,7 @@ function uncommitted_upward_depends() {
## Sets a spell's aux. config info.
## @Globals SPELL
#---------------------------------------------------------------------
-function run_spell_config()
+run_spell_config()
{

SPELL_CONFIG=$DEPENDS_CONFIG/$SPELL
@@ -1806,7 +1804,7 @@ function run_spell_config()
## @Param fast -- if set only show spells, not full depends db entries
## @Param all - if set returns also runtime dependencies
#---------------------------------------------------------------------
-function real_show_up_depends()
+real_show_up_depends()
{
local i=0
local MAX_DEPTH=$2
diff --git a/var/lib/sorcery/modules/libdepengine
b/var/lib/sorcery/modules/libdepengine
index 6078ee6..df4b9fe 100755
--- a/var/lib/sorcery/modules/libdepengine
+++ b/var/lib/sorcery/modules/libdepengine
@@ -38,7 +38,7 @@
## tasks. It invokes the cast_engine on each requested spell and cleans
## up any left-over pending triggers.
#------------------------------------------------------------------------
-function depengine_entry_point() {
+depengine_entry_point() {
$STD_DEBUG
local spell_list=$1
local need_cast_list=$2
@@ -94,7 +94,7 @@ function depengine_entry_point() {
## @param Spell to cast
## @param In trigger flag, default 0. If 1 and a depends loop exists
back-off and fail gracefully.
#------------------------------------------------------------------------
-function depengine_cast_engine() {
+depengine_cast_engine() {
$STD_DEBUG
local spell=$1
local in_trigger=${2:-0}
@@ -158,7 +158,7 @@ function depengine_cast_engine() {
## @global dependent spells even if another one fails.
##
#------------------------------------------------------------------------
-function recurse_depends() {
+recurse_depends() {
$STD_DEBUG
local spell=$1
local in_trigger=${2:-0}
@@ -243,7 +243,7 @@ function recurse_depends() {
## Attempt to run all this spell's triggers. Some triggers may not be
## runable at this time, or it may be better to run them later.
#------------------------------------------------------------------------
-function execute_triggers() {
+execute_triggers() {
$STD_DEBUG
local spell=$1
local failed=$2
@@ -343,7 +343,7 @@ function execute_triggers() {
#------------------------------------------------------------------------
## frontend to cast spells, unregisters pending triggers if any
#------------------------------------------------------------------------
-function dpgn_cast_spell_front() {
+dpgn_cast_spell_front() {
if ! [[ $CAST_PASS ]] ; then
message "ERROR: Missing cast pass variable!!"
exit 1
@@ -374,27 +374,27 @@ function dpgn_cast_spell_front() {
#------------------------------------------------------------------------
## set the spell color
#------------------------------------------------------------------------
-function dpgn_set_spell_color() {
+dpgn_set_spell_color() {
hash_put state_hash $1 $2
}
#------------------------------------------------------------------------
## get the spell color
#------------------------------------------------------------------------
-function dpgn_get_spell_color() {
+dpgn_get_spell_color() {
hash_get state_hash $1
}

#------------------------------------------------------------------------
## Mark this spell as a pending trigger
#------------------------------------------------------------------------
-function dpgn_register_pending_trigger() {
+dpgn_register_pending_trigger() {
hash_put pending_triggers $1 1
}

#------------------------------------------------------------------------
## determine if a trigger is pending or not
#------------------------------------------------------------------------
-function dpgn_is_pending_trigger_registered() {
+dpgn_is_pending_trigger_registered() {
local pending
hash_get_ref pending_triggers $1 pending
[[ $pending == 1 ]]
@@ -403,14 +403,14 @@ function dpgn_is_pending_trigger_registered() {
#------------------------------------------------------------------------
## mark spell as no longer needing a trigger
#------------------------------------------------------------------------
-function dpgn_unregister_pending_trigger() {
+dpgn_unregister_pending_trigger() {
hash_unset pending_triggers $1
}

#------------------------------------------------------------------------
## return all the pending triggers
#------------------------------------------------------------------------
-function dpgn_get_all_pending_triggers() {
+dpgn_get_all_pending_triggers() {
hash_get_table_fields pending_triggers
}

diff --git a/var/lib/sorcery/modules/libdispel
b/var/lib/sorcery/modules/libdispel
index b6f5baf..dbece13 100755
--- a/var/lib/sorcery/modules/libdispel
+++ b/var/lib/sorcery/modules/libdispel
@@ -19,7 +19,7 @@
## careful using this function!
##
#---------------------------------------------------------------------
-function reap_regular_files() {
+reap_regular_files() {
debug "libsorcery" "reap_regular_files()"
local FILE
while read FILE; do
@@ -36,7 +36,7 @@ function reap_regular_files() {
## C<reap_modified_file> is called. Otherwise, the file is deleted.
##
#---------------------------------------------------------------------
-function reap_config_files() {
+reap_config_files() {
debug "libsorcery" "reap_config_files()"
local FILE md5
while read FILE; do
@@ -70,7 +70,7 @@ function reap_config_files() {
## C<PRESERVE> is on, the file will not be moved.
##
#---------------------------------------------------------------------
-function reap_modified_file() {
+reap_modified_file() {
local SAVE
message "${FILE_COLOR}${1}${DEFAULT_COLOR}"
message "${MESSAGE_COLOR}was previously modified by SA?"
@@ -88,7 +88,7 @@ function reap_modified_file() {
#---------------------------------------------------------------------
## Removes spell config stages if there are any
#---------------------------------------------------------------------
-function reap_spell_config_stage() {
+reap_spell_config_stage() {
lock_file "$CONFIG_STAGE_DIRECTORY/$SPELL"
# it's locked - we also don't have to care about the unlikely "current"
stage
rm -fr "$CONFIG_STAGE_DIRECTORY/$SPELL"
@@ -98,7 +98,7 @@ function reap_spell_config_stage() {
#---------------------------------------------------------------------
## Removes depends entries for what the spell depends on
#---------------------------------------------------------------------
-function reap_depends() {
+reap_depends() {
# save the old depends data as abandoned stuff so its seen later on
# recasts as the default
mkdir -p $ABANDONED_DEPENDS
@@ -127,7 +127,7 @@ function reap_depends() {
## files in /etc or any of its sub-directories.
##
#---------------------------------------------------------------------
-function reaper() {
+reaper() {
# Example: reaper "$INSTALL_LOG" "$MD5_LOG"

debug "libdispel" "Running reaper() on $1"
@@ -191,7 +191,7 @@ function reaper() {
## First argument is a file containing install log, removes state files
##
#---------------------------------------------------------------------
-function reap_state_files() {
+reap_state_files() {
# Example: reaper "$INSTALL_LOG" "$MD5_LOG"

debug "libdispel" "Running reap_state_files() on $1"
@@ -237,7 +237,7 @@ function reap_state_files() {
## @return true Can be dispelled
## @return false Cannot be dispelled
#-----
-function dispel_not_possible() {
+dispel_not_possible() {

if ! spell_ok $SPELL ; then
message "${SPELL_COLOR}${SPELL}${DEFAULT_COLOR}" \
@@ -251,7 +251,7 @@ function dispel_not_possible() {
#-----
## Does the sustained checks for spells
#-----
-function dispel_sustained() {
+dispel_sustained() {

if [ "$SUSTAIN" == "on" ] &&
grep -q "^$SPELL$" $SUSTAINED
@@ -268,7 +268,7 @@ function dispel_sustained() {
## Find out where a spell is located
## @Globals SPELL
#-----
-function load_spell() {
+load_spell() {
local SPELL=$1
if tablet_set_spell $SPELL ; then
load_functions_file
@@ -294,7 +294,7 @@ function load_spell() {
#-----
## Run the PRE_REMOVE script if it exists
#-----
-function pre_remove() {
+pre_remove() {
debug "libdispel" "pre_remove()"
if [[ $SCRIPT_DIRECTORY ]] ; then
run_spell_file PRE_REMOVE pre_remove
@@ -305,7 +305,7 @@ function pre_remove() {
#-----
## Run the POST_REMOVE script if it exists.
#-----
-function post_remove() {
+post_remove() {
debug "libdispel" "post_remove()"
if [[ $SCRIPT_DIRECTORY ]] ; then
run_spell_file POST_REMOVE post_remove
@@ -316,7 +316,7 @@ function post_remove() {
#---------------------------------------------------------------------
## Dispel a spell
#---------------------------------------------------------------------
-function dispel_spell() {
+dispel_spell() {

local SPELL=$1
run_hook dispel pre
@@ -372,7 +372,7 @@ function dispel_spell() {
## Set one of always, ask_yes, ask_no, and ignore to on based
## on the value of default, leave the remaining as off.
#---------------------------------------------------------------------
-function dispel_depends_value_to_items() {
+dispel_depends_value_to_items() {
always=off
ask_yes=off
ask_no=off
@@ -395,7 +395,7 @@ function dispel_depends_value_to_items() {
## Present a radiolist menu with the quad-options for one of various
## dependency following options.
#---------------------------------------------------------------------
-function dispel_depends_menu_template() {
+dispel_depends_menu_template() {
local TITLE=$1
local DEFAULT_NAME=$2
local DEFAULT=$3
@@ -421,7 +421,7 @@ function dispel_depends_menu_template() {
#---------------------------------------------------------------------
## Present menus for each of the four dependency following options.
#---------------------------------------------------------------------
-function dispel_depends_defaults_menu() {
+dispel_depends_defaults_menu() {
dispel_depends_menu_template \
"Default action for orphaned spells" \
"ORPHAN_MENU_DEFAULT" "$ORPHAN_MENU_DEFAULT"
diff --git a/var/lib/sorcery/modules/libdownload
b/var/lib/sorcery/modules/libdownload
index 2f1335f..6ef9394 100755
--- a/var/lib/sorcery/modules/libdownload
+++ b/var/lib/sorcery/modules/libdownload
@@ -66,7 +66,7 @@ fi
##
##
#-------------------------------------------------------------------------
-function dl_get_bucket() {
+dl_get_bucket() {
$STD_DEBUG
local handler=$1
local target=$2
@@ -92,7 +92,7 @@ function dl_get_bucket() {
return 1
}

-function dl_command_check() {
+dl_command_check() {
local cmd
smgl_which $1 cmd
if ! [[ $cmd ]] || ! test -x $cmd ; then
@@ -108,7 +108,7 @@ function dl_command_check() {
## it should eventually be a seperate, userdefinable script, with
## this as the default of course
#-------------------------------------------------------------------------
-function dl_connect() {
+dl_connect() {

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

@@ -157,7 +157,7 @@ function dl_connect() {
## this clever function disconnects us if we aren't downloading something
## the heuristic is rather poor.
#-------------------------------------------------------------------------
-function dl_disconnect() {
+dl_disconnect() {

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

@@ -175,7 +175,7 @@ function dl_disconnect() {



-function disconnect_script() {
+disconnect_script() {
cat > $1 << EOF

. /etc/sorcery/config
diff --git a/var/lib/sorcery/modules/libgcc b/var/lib/sorcery/modules/libgcc
index 7c1f622..0c08a42 100755
--- a/var/lib/sorcery/modules/libgcc
+++ b/var/lib/sorcery/modules/libgcc
@@ -33,7 +33,7 @@
## installed gcc is at least "version"
## @return 1 otherwise
#---------------------------------------------------------------------
-function real_using_gcc() {
+real_using_gcc() {
: ${CC:=gcc}
# Check if it's GCC we're using
case "$CC" in *gcc);; *) return 1;; esac
@@ -66,7 +66,7 @@ function real_using_gcc() {
## will be used for compiling
##
#---------------------------------------------------------------------
-function gcc_add_paths() {
+gcc_add_paths() {
export PATH=$(envar_prepend_path $1/bin $PATH)
export LD_LIBRARY_PATH=$(envar_prepend_path $1/lib $LD_LIBRARY_PATH)
export LD_RUN_PATH=$(envar_prepend_path $1/lib $LD_RUN_PATH)
@@ -80,7 +80,7 @@ function gcc_add_paths() {
## alters the environment so that that gcc version is used for compilation.
##
#---------------------------------------------------------------------
-function invoke_gcc() {
+invoke_gcc() {
# $GCC_VERSION contains only two of the version fields, but any patchlevel
# will do, so we pass a regex to the otherwise stricter real_using_gcc
if [[ $GCC_VERSION ]] && ! real_using_gcc "$GCC_VERSION(\.[0-9])?"; then
@@ -93,10 +93,10 @@ function invoke_gcc() {

# backward compatibility functions; currently still used in archspecs,
# since they were part of sorcery before
-function use_gcc() {
+use_gcc() {
real_using_gcc "$@"
}
-function use_gcc2() {
+use_gcc2() {
real_using_gcc 2.95
}

diff --git a/var/lib/sorcery/modules/libgpg b/var/lib/sorcery/modules/libgpg
index ba3fa93..aecf3b6 100755
--- a/var/lib/sorcery/modules/libgpg
+++ b/var/lib/sorcery/modules/libgpg
@@ -26,7 +26,7 @@
## @stdout message when gpg is not installed
##
#---------------------------------------------------------------------
-function gpg_verify_signature() { # $1 sig $2 file $3 pubring $4 algo var
+gpg_verify_signature() { # $1 sig $2 file $3 pubring $4 algo var

local signature=$1
local file=$2
@@ -78,7 +78,7 @@ function gpg_verify_signature() { # $1 sig $2 file $3
pubring $4 algo var
## @return 0 on success, 1 on failure
## @stdout full path to sorcery key (if successful)
#---------------------------------------------------------------------
-function gpg_get_sorcery_key() {
+gpg_get_sorcery_key() {
local branch=${1:-$SORCERY_BRANCH}
local key=$GPG_KEY_DIR/sorcery-$branch.gpg
test -f $key || return 1
@@ -92,7 +92,7 @@ function gpg_get_sorcery_key() {
## @return 0 on success, 1 on failure
## @stdout full path to grimoire key (if successful)
#---------------------------------------------------------------------
-function gpg_get_grimoire_key() {
+gpg_get_grimoire_key() {
local branch=$1
local key=$GPG_KEY_DIR/grimoire-$branch.gpg
test -f $key || return 1
@@ -115,7 +115,7 @@ function gpg_get_grimoire_key() {
##
## @stdout possibly a failure message depending on what happens (nothing is
output on success)
#---------------------------------------------------------------------
-function gpg_verify_grimoire() {
+gpg_verify_grimoire() {
if [[ "$GPG_VERIFY_GRIMOIRE" != on ]] ; then
return 201
fi
@@ -152,7 +152,7 @@ function gpg_verify_grimoire() {



-function verify_grimoire_tree() {
+verify_grimoire_tree() {
local grimoire_name=$1
local grimoire_dir=$2

@@ -214,7 +214,7 @@ function verify_grimoire_tree() {
##
## @stdout possibly a failure message depending on what happens (nothing is
output on success)
#---------------------------------------------------------------------
-function gpg_verify_sorcery() {
+gpg_verify_sorcery() {
if [[ "$GPG_VERIFY_SORCERY" != on ]] ; then
return 201
fi
@@ -248,7 +248,7 @@ function gpg_verify_sorcery() {
##
## @stdout possibly a failure message depending on what happens (nothing is
output on success)
#---------------------------------------------------------------------
-function gpg_verify_common() {
+gpg_verify_common() {
# download the signature
local FILENAME=$1
local SOURCE_URL=$2
@@ -295,7 +295,7 @@ function gpg_verify_common() {
## @stdout going on, or possibly a query asking the user if they want
## @stdout to continue even though gpg verification failed.
#---------------------------------------------------------------------
-function gpg_user_query() {
+gpg_user_query() {
local rc=$1
if [[ $rc == 0 ]] ; then
message "${MESSAGE_COLOR}gpg signature verified!${DEFAULT_COLOR}"
@@ -338,7 +338,7 @@ function gpg_user_query() {
## installed and supports the specified hash function.
##
#---------------------------------------------------------------------
-function gpg_hashsum() {
+gpg_hashsum() {
local algorithm=$1
local file=$2
LC_ALL=C.UTF-8 gpg --print-md "$algorithm" "$file"| tr -d '\n ' |cut -f2
-d:|
@@ -352,7 +352,7 @@ function gpg_hashsum() {
##
## This assumes the caller has already verified that gpg is installed.
#---------------------------------------------------------------------
-function gpg_get_hashes() {
+gpg_get_hashes() {
LC_ALL=C.UTF-8 gpg --version 2> /dev/null | awk -F: '/^Hash/ { gsub(",","
",$2); print tolower($2); }'
}

@@ -363,7 +363,7 @@ function gpg_get_hashes() {
## @param algorithm to use, this can be anything supported by gpg
## @param regular expression of files to ignore
#---------------------------------------------------------------------
-function verify_against_manifest() {
+verify_against_manifest() {
local dir=$1
local manifest=$2
local algorithm=$3
@@ -416,7 +416,7 @@ function verify_against_manifest() {
#---------------------------------------------------------------------
## Verify a grimoire tree and ignore files sorcery adds post-download
#---------------------------------------------------------------------
-function verify_grimoire_against_manifest() {
+verify_grimoire_against_manifest() {
verify_against_manifest $1 $2 $3 \
'^ *2
\./\(GRIMOIRE\|codex\.index\|provides\.index\)$'
}
@@ -425,7 +425,7 @@ function verify_grimoire_against_manifest() {
## Ask the user what they want to do if verification of a grimoire tree
## fails.
#---------------------------------------------------------------------
-function grimoire_tree_user_query() {
+grimoire_tree_user_query() {
local grimoire_name=$1
message "${PROBLEM_COLOR}Verification of the grimoire tree" \
"${DEFAULT_COLOR}${SPELL_COLOR}$grimoire_name${DEFAULT_COLOR}" \
diff --git a/var/lib/sorcery/modules/libgrimoire
b/var/lib/sorcery/modules/libgrimoire
index 79614ce..01b51f0 100755
--- a/var/lib/sorcery/modules/libgrimoire
+++ b/var/lib/sorcery/modules/libgrimoire
@@ -31,7 +31,7 @@
## mk_source_dir /tmp/newdir
## </pre>
#---------------------------------------------------------------------
-function real_mk_source_dir() {
+real_mk_source_dir() {

debug "libgrimoire" "Running mk_source_dir() on ${1:-SOURCE_DIRECTORY}
with size ${2:-2g}"

@@ -60,7 +60,7 @@ function real_mk_source_dir() {
## given.
##
#---------------------------------------------------------------------
-function real_rm_source_dir() {
+real_rm_source_dir() {

local dead_dir="${1:-$SOURCE_DIRECTORY}"
dead_dir=$(readlink -f "$dead_dir")
@@ -114,7 +114,7 @@ function real_rm_source_dir() {
## handle failures when using multiple jobs.
##
#---------------------------------------------------------------------
-function make() {
+make() {

local JOBS=""

@@ -170,7 +170,7 @@ function make() {
## @param Spell
## @Stdout file name
#---------------------------------------------------------------------
-function install_desktop_files() {
+install_desktop_files() {
debug "libgrimoire" "Running install_desktop_files() on $SPELL"
local each file
local target_dir
@@ -201,7 +201,7 @@ function install_desktop_files() {
## Returns the current version of the given spell
##
#---------------------------------------------------------------------
-function real_installed_version() {
+real_installed_version() {
spell_ok $1 || return
private_installed_version "$@"
}
@@ -214,7 +214,7 @@ function real_installed_version() {
## Behavior is undefined is spell is not installed.
##
#---------------------------------------------------------------------
-function private_installed_version() {
+private_installed_version() {
awk -F: -v spell="$1" '$1 == spell { print $4; exit }' $SPELL_STATUS
2>/dev/null
}

@@ -226,15 +226,12 @@ function private_installed_version() {
## returns the given spellname if it is installed
##
#---------------------------------------------------------------------
-function real_conflicts() {
+real_conflicts() {
debug "libgrimoire" "Running conflicts() on $1. Default query answer $2."

- if spell_ok $1; then
- if [[ $2 == y ]]; then
- echo "$1:y"
- else
- echo "$1:n"
- fi
+ if spell_ok "$1"; then
+ case "$2" in y) a=y;; *) a=n;; esac
+ echo "$1:$a"
fi
}

@@ -245,7 +242,7 @@ function real_conflicts() {
## See ask_continue_with_rejected for second part of this function.
##
#---------------------------------------------------------------------
-function warn_rejected()
+warn_rejected()
{
message "${MESSAGE_COLOR}This spell is considered${PROBLEM_COLOR}" \
"rejected${DEFAULT_COLOR}${MESSAGE_COLOR} because of the" \
@@ -267,7 +264,7 @@ function warn_rejected()
## anyway. (defaults to NO), unless running in UNATTEND_SAFE mode.
##
#---------------------------------------------------------------------
-function ask_continue_with_rejected()
+ask_continue_with_rejected()
{
if spell_installed "$SPELL" && [ -e $SCRIPT_DIRECTORY/UNATTEND_SAFE ]; then
message "${SPELL_COLOR}$SPELL${DEFAULT_COLOR}${MESSAGE_COLOR} is" \
diff --git a/var/lib/sorcery/modules/libhash b/var/lib/sorcery/modules/libhash
index f73b37b..811ac83 100755
--- a/var/lib/sorcery/modules/libhash
+++ b/var/lib/sorcery/modules/libhash
@@ -54,7 +54,7 @@
## variable names with those characters.
##
#---------------------------------------------------------------------
-function hash_build_variable_name() {
+hash_build_variable_name() {
local ___TABLE="$1"
local ___FIELD="$2"

@@ -94,7 +94,7 @@ function hash_build_variable_name() {
## most likely reverses hash_build_field_name
##
#---------------------------------------------------------------------
-function hash_unbuild_field_name() {
+hash_unbuild_field_name() {
local ___TABLE="$2"
local ___FIELD=${1#$___TABLE}
___FIELD=${___FIELD%_*}
@@ -122,7 +122,7 @@ function hash_unbuild_field_name() {
## Saves the value in the specified table/field.
##
#---------------------------------------------------------------------
-function hash_put() {
+hash_put() {
local VARIABLE_NAME
hash_build_variable_name "$1" "$2" VARIABLE_NAME
eval "${VARIABLE_NAME}=\"\${3}\""
@@ -140,7 +140,7 @@ function hash_put() {
## string.
##
#---------------------------------------------------------------------
-function hash_get() {
+hash_get() {
local VARIABLE_NAME
hash_build_variable_name "$1" "$2" VARIABLE_NAME
echo "${!VARIABLE_NAME}"
@@ -157,7 +157,7 @@ function hash_get() {
## empty string is returned.
##
#---------------------------------------------------------------------
-function hash_get_ref() {
+hash_get_ref() {
local VARIABLE_NAME
hash_build_variable_name "$1" "$2" VARIABLE_NAME
eval "$3=\${!VARIABLE_NAME}"
@@ -171,7 +171,7 @@ function hash_get_ref() {
## Appends the value to the specified table/field.
##
#---------------------------------------------------------------------
-function hash_append() {
+hash_append() {
local VARIABLE_NAME
local old_value
local sep=${4:-" "}
@@ -193,7 +193,7 @@ function hash_append() {
## the variables through make.
##
#---------------------------------------------------------------------
-function hash_export() {
+hash_export() {
local VARIABLE_NAME
hash_build_variable_name $1 "" VARIABLE_NAME
# make sure the hash has something in it before trying to export it
@@ -208,7 +208,7 @@ function hash_export() {
## Unsets field. Deletes value.
##
#---------------------------------------------------------------------
-function hash_unset() {
+hash_unset() {
local VARIABLE_NAME
hash_build_variable_name "$1" "$2" VARIABLE_NAME
unset ${VARIABLE_NAME}
@@ -222,7 +222,7 @@ function hash_unset() {
## The reverse of hash_append, it removes an item from the field's value.
##
#---------------------------------------------------------------------
-function hash_unset_part() {
+hash_unset_part() {
local VARIABLE_NAME
local old_value
local item=$3
@@ -244,7 +244,7 @@ function hash_unset_part() {
## Unsets all fields in a table.
##
#---------------------------------------------------------------------
-function hash_reset() {
+hash_reset() {
local TABLE_NAME
hash_build_variable_name "$1" '' TABLE_NAME
eval "local VARIABLES=\"\${!${TABLE_NAME}*}\""
@@ -260,7 +260,7 @@ function hash_reset() {
## optional delimiter. If no delimiter is give, \n will be used.
##
#---------------------------------------------------------------------
-function hash_get_table() {
+hash_get_table() {

local TABLE_NAME
hash_build_variable_name "$1" '' TABLE_NAME
@@ -285,7 +285,7 @@ function hash_get_table() {
## used.
##
#---------------------------------------------------------------------
-function hash_get_table_fields() {
+hash_get_table_fields() {

local TABLE_NAME
hash_build_variable_name "$1" '' TABLE_NAME
@@ -309,7 +309,7 @@ function hash_get_table_fields() {
## and is not intended for regular use.
##
#---------------------------------------------------------------------
-function hash_debug_dump() {
+hash_debug_dump() {
local TABLE_NAME
local FIELD
local value
diff --git a/var/lib/sorcery/modules/libinitd
b/var/lib/sorcery/modules/libinitd
index cdb55ac..530043d 100755
--- a/var/lib/sorcery/modules/libinitd
+++ b/var/lib/sorcery/modules/libinitd
@@ -41,7 +41,7 @@
## Makes a backup of "old file" if it differs from "new file"
##
#---------------------------------------------------------------------
-function _init_make_backup()
+_init_make_backup()
{

# Don't bother if the old file doesn't exist
@@ -67,14 +67,14 @@ function _init_make_backup()
## prints them to stdout separated by newlines.
##
#---------------------------------------------------------------------
-function _init_get_conf_files()
+_init_get_conf_files()
{
-
- sed -n -f - $1 <<EOF
-s!^\.\s\s*/etc/sysconfig/\([^[:space:]]*\).*!\1!p
-s!^source\s\s*/etc/sysconfig/\([^[:space:]]*\).*!\1!p
-EOF
-
+ awk '
+ ( $1 == "." || $1 == "source") &&
+ match($2, /^[/]etc[/]sysconfig[/]/) {
+ print substr($2, RLENGTH + 1)
+ }
+ ' "$1"
}


@@ -84,11 +84,11 @@ EOF
## Inserts new options from the new file into the old, existing, file
##
#---------------------------------------------------------------------
-function _init_merge_config_file()
+_init_merge_config_file()
{

# Get newly added options
- local new_opts=$( sed -n -e 's/[[:space:]]*\([[:alnum:]_]*\)=.*/\1/p' $1
$2 |
+ local new_opts=$( sed -n -e 's/[\t\v\f\r ]*\([A-Za-z0-9_]*\)=.*/\1/p' $1
$2 |
sort | uniq -u )

# for now the file is always modified...
@@ -113,7 +113,7 @@ function _init_merge_config_file()

# The variable we're looking for has come, add it to the hold space and
# then print everything, quit when done...
-/^[[:space:]]*$opt=/ { H ; x ; p; q; }
+/^[\t\v\f\r ]*$opt=/ { H ; x ; p; q; }

# Default action, append line to hold space
H
@@ -129,7 +129,7 @@ EOF
## Installs or merges a list of init-script configuration-files.
##
#---------------------------------------------------------------------
-function _init_install_conf_files()
+_init_install_conf_files()
{

mkdir -p $INSTALL_ROOT/etc/sysconfig
@@ -169,14 +169,14 @@ function _init_install_conf_files()
## script (if any)
##
#---------------------------------------------------------------------
-function init_prepare_install()
+init_prepare_install()
{

local service="$1"
local old_provides="$2"
local result_list="$3"
local script_path="$SCRIPT_DIRECTORY/init.d/$service"
- local script_provides=$( grep '^[[:space:]]*PROVIDES' $script_path )
+ local script_provides=$( grep '^[\t\v\f\r ]*PROVIDES' $script_path )
script_provides=$( eval "( ${script_provides:=:} ; echo \$PROVIDES ; )" )

[ -z "$script_provides" ] && return
@@ -202,13 +202,13 @@ function init_prepare_install()
## * Installs any config file used by the script.
##
#---------------------------------------------------------------------
-function init_install()
+init_install()
{

local enable_script="$1"
local script_name="$2"
local script_path="$SCRIPT_DIRECTORY/init.d/$script_name"
- local script_runlevel=$( grep '^[[:space:]]*RUNLEVEL' $script_path )
+ local script_runlevel=$( grep '^[\t\v\f\r ]*RUNLEVEL' $script_path )
script_runlevel=$( eval "( $script_runlevel ; echo \$RUNLEVEL )" )

[ "$script_runlevel" = "s" ] && script_runlevel="S"
@@ -256,7 +256,7 @@ function init_install()
## Does cleanup if necessary. Must be run _after_ installwatch has stopped.
##
#---------------------------------------------------------------------
-function init_post_install()
+init_post_install()
{
(
IFS="$WHITESPACE_IFS"
@@ -265,7 +265,7 @@ function init_post_install()
mark_file_modified "$INSTALL_ROOT/etc/sysconfig/facilities"
IFS=":"
set $sp # $1 - script name, $2 - facility
- if ! sedit "s/^\([[:space:]]*$2\)=.*/\1=$1/" \
+ if ! sedit "s/^\([\t\v\f\r ]*$2\)=.*/\1=$1/" \
$INSTALL_ROOT/etc/sysconfig/facilities ; then
message -n "${PROBLEM_COLOR}Unable to modify facilities file to make
"
message "$1 provider of $2.${DEFAULT_COLOR}"
diff --git a/var/lib/sorcery/modules/liblock b/var/lib/sorcery/modules/liblock
index ad012ff..4259fed 100755
--- a/var/lib/sorcery/modules/liblock
+++ b/var/lib/sorcery/modules/liblock
@@ -203,7 +203,7 @@ global_clean_resources()
## @Blocking
##
#---------------------------------------------------------------------
-function lock_file()
+lock_file()
{
debug "liblock" "$FUNCNAME - $*"
lock_resources file "$1"
@@ -217,7 +217,7 @@ function lock_file()
## Unlocks a file so that another process can lock and modify it.
##
#---------------------------------------------------------------------
-function unlock_file()
+unlock_file()
{
debug "liblock" "$FUNCNAME - $*"
unlock_resources file "$1"
@@ -240,7 +240,7 @@ function unlock_file()
## @return 0 If successful
## @return 1 If not successful
#---------------------------------------------------------------------
-function lock_start_transaction()
+lock_start_transaction()
{
debug "liblock" "$FUNCNAME - $*"
local NUMTRANS transaction_file file="$1"
@@ -284,7 +284,7 @@ function lock_start_transaction()
## Before this func is called, the files remain unchanged.
##
#---------------------------------------------------------------------
-function lock_commit_transaction()
+lock_commit_transaction()
{
debug "liblock" "$FUNCNAME - $*"
local TMP_FILE unlockList=""
@@ -331,7 +331,7 @@ function lock_commit_transaction()
## ignored/undone.
##
#---------------------------------------------------------------------
-function lock_kill_transaction()
+lock_kill_transaction()
{
debug "liblock" "$FUNCNAME - $*"
local TMP_FILE string
@@ -357,7 +357,7 @@ function lock_kill_transaction()
## however counter_down and counter_check will clean up after misbehaving
## processes.
#---------------------------------------------------------------------
-function counter_up() {
+counter_up() {
local counterfile="$1.$2"
# we replace / with ^
counterfile="${LOCK_DIR}/${counterfile//\//^}"
@@ -373,7 +373,7 @@ function counter_up() {
## @param Type of resource
## @param Name of resource
#---------------------------------------------------------------------
-function counter_down() {
+counter_down() {
local counterfile="$1.$2"
local foo each
# we replace / with ^
@@ -396,7 +396,7 @@ function counter_down() {
## @param Name of resource
##
#---------------------------------------------------------------------
-function counter_reset() {
+counter_reset() {
local counterfile="$1.$2"
local foo each
# we replace / with ^
@@ -416,7 +416,7 @@ function counter_reset() {
## Also cleans stale items
##
#---------------------------------------------------------------------
-function counter_check() {
+counter_check() {
local counterfile="$1.$2"
# we replace / with ^
counterfile="${LOCK_DIR}/${counterfile//\//^}"
@@ -441,7 +441,7 @@ function counter_check() {
## Caller must hold a lock on the file
##
#---------------------------------------------------------------------
-function counter_clean() {
+counter_clean() {
for each in $(cat $1) ; do
ps -A|grep -q $each && echo $each
done
diff --git a/var/lib/sorcery/modules/libmedia
b/var/lib/sorcery/modules/libmedia
index 2c34ef8..fbd163f 100755
--- a/var/lib/sorcery/modules/libmedia
+++ b/var/lib/sorcery/modules/libmedia
@@ -20,7 +20,7 @@
## sets the colors based upon COLOR_SCHEME and defaults to a BRIGHT
## color scheme
#---------------------------------------------------------------------
-function media_init() {
+media_init() {

# color ASCII codes
#
@@ -89,7 +89,7 @@ function media_init() {
## Passes name of chosen scheme to the set_sound_scheme funtion.
##
#---------------------------------------------------------------------
-function sound_schemes_menu() {
+sound_schemes_menu() {

local SOUND_HELP="Here you can choose your prefered sound scheme"
FER_SOUND="Ferris sound scheme"
@@ -138,7 +138,7 @@ function sound_schemes_menu() {
## If the sound spell is not installed it will be cast for the user.
##
#---------------------------------------------------------------------
-function set_sound_theme() {
+set_sound_theme() {

remove_config $LOCAL_CONFIG "SOUND"
remove_config $LOCAL_CONFIG "SOUND_THEME"
@@ -203,7 +203,7 @@ color_schemes_menu() {
## First argument is "off" or "on" to turn console colors off or on
##
#---------------------------------------------------------------------
-function color() {
+color() {

case $1 in
off) unset SPELL_COLOR
diff --git a/var/lib/sorcery/modules/libmisc b/var/lib/sorcery/modules/libmisc
index 064c17f..3b7334a 100755
--- a/var/lib/sorcery/modules/libmisc
+++ b/var/lib/sorcery/modules/libmisc
@@ -20,7 +20,7 @@
## Produces "a" "string" "to" "explode".
## </pre>
#---------------------------------------------------------------------
-function explode()
+explode()
{ # $1==string to explode, $2==delimiter, $3==name of array to put it in

[[ "$3" ]] || return 1
@@ -55,7 +55,7 @@ function explode()
## files before compiling. See the sed man page for more information.
##
#---------------------------------------------------------------------
-function real_sedit() {
+real_sedit() {
sed -i "$1" "$2"
}

@@ -68,8 +68,8 @@ function real_sedit() {
## Argument is a string to check if the string contains all digits or
## not
#--------------------------------------------------------------------
-function isdigit() {
- echo $1 | grep '[[:digit:]]+' >> /dev/null 2>&1
+isdigit() {
+ echo "$1" | grep '^[0-9][0-9]*$' >> /dev/null 2>&1
}

#--------------------------------------------------------------------
@@ -80,8 +80,8 @@ function isdigit() {
##
## Argument is a string to check if it contains all chars a-zA-Z
#--------------------------------------------------------------------
-function isalpha() {
- echo $1 | grep '[[:alpha:]]+' >> /dev/null 2>&1
+isalpha() {
+ echo "$1" | grep '^[A-Za-z][A-Za-z]*$' >> /dev/null 2>&1
}

#---------------------------------------------------------------------
@@ -100,7 +100,7 @@ function isalpha() {
## Returns true or false based on the answer given.
##
#---------------------------------------------------------------------
-function real_query() {
+real_query() {
debug "libmisc" "Running query() with the following arguments: '$1' and
'$2'"
local _response
run_hook real_query
@@ -134,7 +134,7 @@ function real_query() {
## Asks user for string, with default answer and timeout (like query)
##
#---------------------------------------------------------------------
-function real_query_string () {
+real_query_string() {

debug "libmisc" "Running question() with the following arguments: '$1'
and '$2'"

@@ -170,7 +170,7 @@ function real_query_string () {
## @Stdout message
## echo's the given arguments if SILENT is not set.
#---------------------------------------------------------------------
-function real_message() {
+real_message() {
if [ ! -n "$SILENT" ]; then
if [ "$1" == "-n" ]; then
shift 1
@@ -189,7 +189,7 @@ function real_message() {
## @Stderr message
## echo's the given arguments if SILENT is not set.
#---------------------------------------------------------------------
-function error_message() {
+error_message() {
real_message "$@" 1>&2
}

@@ -221,7 +221,7 @@ debug_stream() {
## comes from. i.e. DEBUG_liblock, DEBUG_libsorcery, DEBUG_cast etc.
##
#---------------------------------------------------------------------
-function debug() {
+debug() {

[[ $DEBUG ]] || return 0

@@ -246,7 +246,7 @@ function debug() {
## Displays progress spinner like the one in fsck.
##
#---------------------------------------------------------------------
-function progress_spinner() {
+progress_spinner() {
let PROGRESS_SPINNER=$PROGRESS_SPINNER+1
if (( PROGRESS_SPINNER > ${#PROGRESS_SPINNER_CHARS}-1 )); then
PROGRESS_SPINNER=0;
@@ -265,7 +265,7 @@ function progress_spinner() {
## Or just a dot in the dot format
##</pre>
#---------------------------------------------------------------------
-function progress_bar() {
+progress_bar() {
debug "libmisc" "progress_bar - $*"
local percent i len num_dash

@@ -338,7 +338,7 @@ debug "libmisc" "progress_bar - $*"
## Clears the current line and puts the cursor at the begining of it.
##
#---------------------------------------------------------------------
-function clear_line() {
+clear_line() {

echo -en '\r\033[2K'
return 0
@@ -373,7 +373,7 @@ function clear_line() {
## One would run it by calling: run_hook SUCCESS post
##
#---------------------------------------------------------------------
-function init_hooks() {
+init_hooks() {
debug "libmisc" "init_hooks - starting"
# check if we were called already
declare -F hook_marker &>/dev/null && return 0
@@ -447,7 +447,7 @@ function init_hooks() {
## @optional_param hook_order pre|post
##
#---------------------------------------------------------------------
-function run_hook() {
+run_hook() {
local spell_file="$1"
local hook_order="$2"
local rc=$3
@@ -473,7 +473,7 @@ function run_hook() {
## argument. If EDITOR is not set, "nano -w" is used.
##
#---------------------------------------------------------------------
-function edit_file() {
+edit_file() {

${EDITOR:-nano -w} $1

@@ -491,7 +491,7 @@ function edit_file() {
## be treated literaly.
##
#---------------------------------------------------------------------
-function esc_str()
+esc_str()
{
if [[ $1 == ".*" ]]; then
if [[ -z $2 ]]; then
@@ -519,7 +519,7 @@ function esc_str()
## Does NOT escape strings matching "\.\*(.*".
##
#---------------------------------------------------------------------
-function esc_provider_str()
+esc_provider_str()
{
local _escaped
# the pattern is intentionally not quoted, so glob matching occurs
@@ -542,7 +542,7 @@ function esc_provider_str()
## PARAMS=$(consolidate_params "$@")
## su -c "$0 $PARAMS" root
#---------------------------------------------------------------------
-function consolidate_params() {
+consolidate_params() {
local param
for param in "$@"; do
# add and remove a dummy space, so echo parameters can be used as values
@@ -558,7 +558,7 @@ function consolidate_params() {
## and outputs their base names.
##
#---------------------------------------------------------------------
-function get_basenames() {
+get_basenames() {
local directory
while read directory; do
smgl_basename "$directory"
@@ -573,7 +573,7 @@ function get_basenames() {
## and outputs their directory names.
##
#---------------------------------------------------------------------
-function get_dirnames() {
+get_dirnames() {
local path_name
while read path_name; do
smgl_dirname "$path_name"
@@ -589,7 +589,7 @@ function get_dirnames() {
## Checks whether the passed directory exists and if not, tries to
## create it, first checking if it already exists as something else.
#---------------------------------------------------------------------
-function ensure_dir() {
+ensure_dir() {
if ! [[ -d $1 ]]; then
if [[ -e $1 ]]; then
message "${PROBLEM_COLOR}$1 exists, but is not a directory!" \
@@ -619,7 +619,7 @@ function ensure_dir() {
## In stdin mode, if the string does not terminate with the delimiter, the
last
## token will be ignored.
#----------------------------------------------------------------------
-function iterate()
+iterate()
{ # $1=callback+args, $2=separator, $3=(opt)string
# debug "libmisc" "iterate - $@"

@@ -663,7 +663,7 @@ function iterate()
## item in return_var
##
#---------------------------------------------------------------------
-function select_list()
+select_list()
{
local i
local foo temp number
@@ -699,7 +699,7 @@ function select_list()
## @param message to print out for the query
## @param default answer
#---------------------------------------------------------------------
-function select_list_sub() {
+select_list_sub() {
local returnvar=$1
local hashname=$2
local msgstr=$3
@@ -725,7 +725,7 @@ function select_list_sub() {
## are separated by spaces
##
#---------------------------------------------------------------------
-function real_list_remove () {
+real_list_remove() {
local var=$1
shift

@@ -733,7 +733,7 @@ function real_list_remove () {

for i in $@; do
eval "$var=\`echo \" \$$var \" | sed \
- -e \"s/[[:space:]]\\+/ /g\" \
+ -e \"s/[\t\v\f\r ]\\+/ /g\" \
-e \"s/ $i / /g\" \
-e \"s/^ *//\" \
-e \"s/ *$//\"\`"
@@ -749,7 +749,7 @@ function real_list_remove () {
## separated by spaces
##
#---------------------------------------------------------------------
-function real_list_add () {
+real_list_add() {
local var=$1
shift
local i
@@ -785,7 +785,7 @@ function real_list_add () {
## other list_* functions. Use the ${var[*]} form when passing arrays
##
#---------------------------------------------------------------------
-function real_list_find () {
+real_list_find() {
local item token
[[ "$1" ]] || return 1
local input=$1
@@ -810,7 +810,7 @@ function real_list_find () {
## of the variable to read
##
#---------------------------------------------------------------------
-function real_persistent_read() {
+real_persistent_read() {
local exfile pfile tb_dir
local varin=$2
local varout=$3
@@ -832,7 +832,7 @@ function real_persistent_read() {
## Adds variable names to the list of persistent variables
##
#---------------------------------------------------------------------
-function real_persistent_add () {
+real_persistent_add() {
if [[ $PROTECT_SORCERY ]] ; then
for each in "$@" ; do
if is_sorcery_var $each; then
@@ -856,7 +856,7 @@ function real_persistent_add () {
## Removes variable names from the list of persistent variables
##
#---------------------------------------------------------------------
-function real_persistent_remove () {
+real_persistent_remove() {
list_remove PERSISTENT_VARIABLES "$@"
}

@@ -865,7 +865,7 @@ function real_persistent_remove () {
## Loads persistent variables stored in file "$SPELL_CONFIG"
##
#---------------------------------------------------------------------
-function real_persistent_load () {
+real_persistent_load() {
local PERSISTENT_LOADING=yes
local PERSISTENT_FILE=${1:-$SPELL_CONFIG.p}
lock_file "$PERSISTENT_FILE"
@@ -884,7 +884,7 @@ function real_persistent_load () {
## variables
##
#---------------------------------------------------------------------
-function real_persistent_save () {
+real_persistent_save() {
local VAR
local TMP
local file=$SPELL_CONFIG.p
@@ -907,7 +907,7 @@ function real_persistent_save () {
## ( for example from 'gaze what' )
##
#---------------------------------------------------------------------
-function real_persistent_clear () {
+real_persistent_clear() {
local VAR
for VAR in $PERSISTENT_VARIABLES; do
unset "$VAR"
@@ -930,7 +930,7 @@ function real_persistent_clear () {
## function and are not working with variables directly
##
#---------------------------------------------------------------------
-function config_get_option () {
+config_get_option() {
if [[ $PROTECT_SORCERY ]] ; then
if is_sorcery_var $1; then
complain_sorcery_var $1
@@ -962,7 +962,7 @@ function config_get_option () {
## when cast -r is run, this makes the new persistent config clean
## but allows us to provide the user defaults from the last cast.
#---------------------------------------------------------------------
-function config_get_last_option() {
+config_get_last_option() {
if [[ $PROTECT_SORCERY ]] ; then
if is_sorcery_var $1; then
complain_sorcery_var $1
@@ -1008,7 +1008,7 @@ function config_get_last_option() {
## working with variables directly
##
#---------------------------------------------------------------------
-function config_set_option () {
+config_set_option() {
persistent_add $1
eval "$1=\"$2\""
}
@@ -1025,7 +1025,7 @@ function config_set_option () {
## Return variable is also marked as persistent
##
#---------------------------------------------------------------------
-function real_config_query () {
+real_config_query() {
local ANSWER
if config_get_option "$1" ANSWER; then
# option allready ANSWERed in config
@@ -1064,7 +1064,7 @@ function real_config_query () {
##
## Return variable is also marked as persistent
#---------------------------------------------------------------------
-function real_config_query_option () {
+real_config_query_option() {
local ANSWER key

# If the option exists
@@ -1110,7 +1110,7 @@ function real_config_query_option () {
## Return variable is also marked as persistent
##
#---------------------------------------------------------------------
-function real_config_query_string () {
+real_config_query_string() {
local ANSWER

if config_get_option "$1" ANSWER; then
@@ -1138,7 +1138,7 @@ function real_config_query_string () {
## Return variable is also marked as persistent
##
#---------------------------------------------------------------------
-function real_config_query_list () {
+real_config_query_list() {
local ANSWER
local VARIABLE="$1"
local QUESTION="$2"
@@ -1176,14 +1176,14 @@ function real_config_query_list () {
## This is the number portion of SOURCE[[:digit:]], eg '', "2", "3", etc.
## A prefix may be given and it will be prepended to each result value.
#---------------------------------------------------------------------
-function real_get_source_nums() {
+real_get_source_nums() {
local foo
compgen -v SOURCE |
- grep '^SOURCE[[:digit:]]*$'|sort -u|
+ grep '^SOURCE[0-9]*$'|sort -u|
while read foo; do echo "${1}${foo/SOURCE/}"; done
}

-function get_spell_files() {
+get_spell_files() {
for src in $(real_get_source_nums SOURCE); do
echo ${!src}
done
@@ -1199,7 +1199,7 @@ function get_spell_files() {
## existing function, false otherwise.
##
#---------------------------------------------------------------------
-function misc_is_function() {
+misc_is_function() {
local FUNCTION_NAME=$1
[[ "$(type -t $FUNCTION_NAME)" == "function" ]]
}
@@ -1212,7 +1212,7 @@ function misc_is_function() {
## @param Filename to read as input, a pipe may not be used.
## @param Base directory to remove directories up to (usually $INSTALL_ROOT)
#---------------------------------------------------------------------
-function remove_files_and_dirs() {
+remove_files_and_dirs() {
cat $1 | while read file; do
if [[ ! -d $file ]]; then
rm -f $file
@@ -1239,7 +1239,7 @@ function remove_files_and_dirs() {
## even in subprocesses called through make.
## @param name of the script needing the tmp dir
#---------------------------------------------------------------------
-function mk_tmp_dirs() {
+mk_tmp_dirs() {
debug "$FUNCNAME" "Making tmp dirs for $$"
local SCRIPT_NAME=$1 STATS tmp
SCRIPT_NAME=${SCRIPT_NAME:-misc}
@@ -1296,7 +1296,7 @@ function mk_tmp_dirs() {
}

# emergency exit function if we fail to make a TMP_DIR
-function mk_tmp_dir_error() {
+mk_tmp_dir_error() {
message "Failed to make temporary dir, this" \
"might be due to a security attack,\nplease" \
"check the permissions of $1. Bailing out..." 2>/dev/null
@@ -1314,7 +1314,7 @@ function mk_tmp_dir_error() {
## Marches through $PATH looking for the executable specified
##
#---------------------------------------------------------------------
-function smgl_which() {
+smgl_which() {
local target=$1 location
local BREAK
function smgl_which_sub() {
@@ -1344,7 +1344,7 @@ function smgl_which() {
## @param variable to return path in (pass by reference)
##
#---------------------------------------------------------------------
-function find_make() {
+find_make() {
local ___REAL_MAKE
smgl_which make ___REAL_MAKE
rc=$?
@@ -1360,7 +1360,7 @@ function find_make() {
#---------------------------------------------------------------------
## @param tmp_dir, should begin with /tmp/sorcery
#---------------------------------------------------------------------
-function cleanup_tmp_dir() {
+cleanup_tmp_dir() {
local TMP_DIR=$1
if [ ${TMP_DIR:0:13} == "/tmp/sorcery/" ]; then
rm -rf $TMP_DIR
@@ -1388,7 +1388,7 @@ function cleanup_tmp_dir() {
## in some circumstances and not others, and one uses it where its safe,
## someone will forget and start using it in places that arent safe...
#---------------------------------------------------------------------
-function is_sorcery_var() {
+is_sorcery_var() {
local vars="TOP_LEVEL DISPLAY PATH TMP_DIR SAFE_CAST \
FAILED_LIST SUCCESS_LIST SPELL SPELLS spells MAKEFILE DEPS_ONLY \
CAST_PASS download_log IW_LOG OPTS SOLO QUIET INSTALL_QUEUE \
@@ -1411,7 +1411,7 @@ function is_sorcery_var() {
## @stdout Complain vehemently that a variable name is used by sorcery and
## @stdout the user should file a bug because a spell is using the variable
#---------------------------------------------------------------------
-function complain_sorcery_var() {
+complain_sorcery_var() {
message "${PROBLEM_COLOR}WARNING: ATTEMPTING TO USE" \
"${DEFAULT_COLOR}${SPELL_COLOR}\"$1\"" \
"${DEFAULT_COLOR}${PROBLEM_COLOR}AS A SPELL VARIABLE."
@@ -1443,7 +1443,7 @@ function complain_sorcery_var() {
## SMGL_COMPAT_ARCHS. The result is an array from most specific arch to least
## specific. $ARCHITECTURE does not change meaning since $A == ${A[0]}.
#-------------------------------------------------------------------
-function set_architecture() {
+set_architecture() {

$STD_DEBUG
local specdir
@@ -1493,7 +1493,7 @@ function set_architecture() {
## Creates functions with identical bodies. It is useful if you need
## to override a bunch of functions which have already been defined.
#---------------------------------------------------------------------
-function define_functions() {
+define_functions() {
local funcName
local funcContent="$1"
shift
@@ -1524,7 +1524,7 @@ function define_functions() {
## }
## </pre>
#---------------------------------------------------------------------
-function upvar() {
+upvar() {
# This makes eval see things as name=$2,
# which makes leading/trailing whitespace and special chars magically work.
eval "$1=\$2"
@@ -1534,14 +1534,14 @@ function upvar() {
#---------------------------------------------------------------------
## Like uniq, but doesnt require a sorted list, implemented in awk.
#---------------------------------------------------------------------
-function awkuniq() {
+awkuniq() {
awk '!($0 in seen) { seen[$0]; print }'
}

#---------------------------------------------------------------------
## Dirname written in bash, optionally uses an upvar (making it forkless).
#---------------------------------------------------------------------
-function smgl_dirname() {
+smgl_dirname() {
local __dir=() __dirname i __last_dir

# Pull of any trailing /'s, there could be more than/one///
@@ -1587,7 +1587,7 @@ function smgl_dirname() {
## basename written in bash, optionally uses upvar (making it forkless).
## Does not have ability to remove file extension like the real basename.
#---------------------------------------------------------------------
-function smgl_basename() {
+smgl_basename() {
local __base=$1
local __last_base

@@ -1617,7 +1617,7 @@ function smgl_basename() {
## TODO: remove grimoire functions libgcc gcc_prepend_path and use
## this one
#--------------------------------------------------------------------
-function envar_prepend_path()
+envar_prepend_path()
{
if test -z $2
then
@@ -1631,7 +1631,7 @@ function envar_prepend_path()
## Appends the input to the notice log, prepending the spell name as a
## title, appending a newline and teeing the input back unchanged.
#---------------------------------------------------------------------
-function append_to_notice_log() {
+append_to_notice_log() {
local notice_log=$TMP_DIR/notice_log
local tmp_log=$TMP_DIR/tmp_notice_log

@@ -1651,7 +1651,7 @@ function append_to_notice_log() {
##
## @param reason
#---------------------------------------------------------------------
-function log_failure_reason() {
+log_failure_reason() {
[[ -z $CAST_BACKUPDIR ]] && return 1

# delve has a different TMP_DIR, so we can't use it
@@ -1672,7 +1672,7 @@ function log_failure_reason() {
##
## @param upvar
#---------------------------------------------------------------------
-function get_failure_reason() {
+get_failure_reason() {
local failure_reason_log=$CAST_BACKUPDIR/failure_reason_log
local _upvar=$1
local _reason
@@ -1692,7 +1692,7 @@ function get_failure_reason() {
## @param use dialog (optional)
## @param message to print on error (optional)
#---------------------------------------------------------------------
-function show_file() {
+show_file() {
local file=$1
local dialog=${2:-yes}
local msg=${3:-"File not found."}
@@ -1728,7 +1728,7 @@ function show_file() {
## TERM=screen
##
#---------------------------------------------------------------------
-function set_term_title()
+set_term_title()
{
case $TERM in
xterm*|rxvt) echo -ne "\e]0;$@\007" ;;
diff --git a/var/lib/sorcery/modules/libqueue
b/var/lib/sorcery/modules/libqueue
index 15775d2..3395c5c 100755
--- a/var/lib/sorcery/modules/libqueue
+++ b/var/lib/sorcery/modules/libqueue
@@ -14,7 +14,7 @@
## install queue.
##
#---------------------------------------------------------------------
-function update_install_queue() {
+update_install_queue() {
local line spell curr_version curr_updated page_dir info curr_patchlevel
local curr_sec_patch count size
local tmp_queue=$TMP_DIR/install_queue
@@ -55,7 +55,7 @@ function update_install_queue() {
## reasons and creates an install queue.
##
#---------------------------------------------------------------------
-function update_security_install_queue() {
+update_security_install_queue() {
local line spell page_dir info curr_sec_patch=0
local tmp_queue=$TMP_DIR/install_queue
local recheck_queue=$TMP_DIR/recheck_queue
@@ -103,7 +103,7 @@ function update_security_install_queue() {
## Find all spells that need to be updated due to security reasons.
## Checks the version caches and compares them to the installed one.
#---------------------------------------------------------------------
-function find_security_updates() {
+find_security_updates() {
local tmp_queue=$1
local recheck_queue=$2

@@ -159,7 +159,7 @@ if [ "$LIBQUEUE_VERCMP" = newer ]; then
else
awk_version_compare='function version_cmp(v1, v2) { return -(v1 != v2) }'
fi
-function version_compare_gt() {
+version_compare_gt() {
awk "$awk_version_compare"'
BEGIN {
exit !(version_cmp(ARGV[1], ARGV[2]) < 0)
@@ -171,7 +171,7 @@ function version_compare_gt() {
## Find all spells that need to be updated (for any reason).
## Checks the version caches and compares them to the installed one.
#---------------------------------------------------------------------
-function find_updates() {
+find_updates() {
local tmp_queue=$1
local recheck_queue=$2

@@ -228,7 +228,7 @@ function find_updates() {
## Frontend routine to encapsulate whether or not a spell needs updating
## Used by lazy dependency resolution
#---------------------------------------------------------------------
-function does_spell_need_update() {
+does_spell_need_update() {
local spell=$1
local tmp_queue=$TMP_DIR/install_queue
local recheck_queue=$TMP_DIR/recheck_queue
@@ -246,7 +246,7 @@ function does_spell_need_update() {
## use the version cache and is also needed for checking multiversioned
## spells.
#---------------------------------------------------------------------
-function does_spell_need_update_slow() {
+does_spell_need_update_slow() {
local spell=$1
local curr_version=$2
local curr_updated=$3
@@ -295,7 +295,7 @@ function does_spell_need_update_slow() {
## Common code between update_install_queue,
## update_security_install_queue and does_spell_need_update
#---------------------------------------------------------------------
-function update_install_queue_sub() {
+update_install_queue_sub() {
local tmp_queue=$1
local recheck_queue=$2
local type=$3
@@ -354,7 +354,7 @@ function update_install_queue_sub() {
#---------------------------------------------------------------------
## Slow higher-level check if a spell needs to be updated
#---------------------------------------------------------------------
-function update_install_queue_slow() {
+update_install_queue_slow() {
local spell=$1
# this is in a subshell because the caller may not want to actually load
# the spell yet
@@ -372,7 +372,7 @@ function update_install_queue_slow() {
## List files in install queue, give user chance to modify it.
##
#---------------------------------------------------------------------
-function list_install_queue() {
+list_install_queue() {
if [[ -f $INSTALL_QUEUE ]]; then
lock_file $INSTALL_QUEUE

@@ -401,7 +401,7 @@ function list_install_queue() {
## Display the history of the install queue for review
##
#---------------------------------------------------------------------
-function install_queue_history() {
+install_queue_history() {
local spell
# we can't use read, since the loop needs a normal stdin
for spell in $(< $INSTALL_QUEUE); do
@@ -429,7 +429,7 @@ function install_queue_history() {
## line of the queue is removed, and returned.
##
#---------------------------------------------------------------------
-function pop_queue() {
+pop_queue() {
local item found
local exit_code=0

@@ -464,7 +464,7 @@ function pop_queue() {
## queue before being added at the end.
##
#---------------------------------------------------------------------
-function push_queue() {
+push_queue() {
local t_file

pop_queue "$1" "$2"
@@ -482,7 +482,7 @@ function push_queue() {
## the casting of the queue not have to recast completed spells).
##
#---------------------------------------------------------------------
-function pop_install_queue() {
+pop_install_queue() {

pop_queue $INSTALL_QUEUE "$1"

@@ -495,7 +495,7 @@ function pop_install_queue() {
## remove queue.
##
#---------------------------------------------------------------------
-function push_install_queue() {
+push_install_queue() {

pop_queue $REMOVE_QUEUE "$1"
pop_queue $INSTALL_QUEUE "$1"
@@ -511,7 +511,7 @@ function push_install_queue() {
## install queue.
##
#---------------------------------------------------------------------
-function push_remove_queue() {
+push_remove_queue() {

pop_queue $INSTALL_QUEUE "$1"
pop_queue $REMOVE_QUEUE "$1"
diff --git a/var/lib/sorcery/modules/libresurrect
b/var/lib/sorcery/modules/libresurrect
index f9d2253..583c5c1 100755
--- a/var/lib/sorcery/modules/libresurrect
+++ b/var/lib/sorcery/modules/libresurrect
@@ -14,7 +14,7 @@
## @param spellname
## determines if a particular version of a spell can be resurrected
#---------------------------------------------------------------------
-function can_resurrect() {
+can_resurrect() {
debug "libresurrect" "can_resurrect - $*"
local SPELL=$1
local VERSION=$2
@@ -65,7 +65,7 @@ function can_resurrect() {
##
## FIXME: some of the informative message calls might work better as debug
messages
#------------------------------------------------------------------------
-function resurrect_spell() { (
+resurrect_spell() { (
debug "libresurrect" "resurrect - $*"
local SPELL=$1
local VERSION=$2
@@ -322,7 +322,7 @@ function resurrect_spell() { (
) }


-function resurrect_sub() {
+resurrect_sub() {
# 10) if theres a PRE_RESURRECT run it or fail/rollback
if test -x $SCRIPT_DIRECTORY/PRE_RESURRECT ; then
run_hook PRE_RESURRECT pre
@@ -427,7 +427,7 @@ function resurrect_sub() {
## @param to File to replace
## @param savetime Backup time if necessary (optional, defaults to $(date
+'%Y%m%d%H%M')
#------------------------------------------------------------------------
-function real_install_config_file() {
+real_install_config_file() {
if [[ ! $1 ]] || [[ ! $2 ]] ; then
message "${PROBLEM_COLOR}Missing values for arguments \"$1\" or \"$2\"" \
"$DEFAULT_COLOR"
@@ -456,7 +456,7 @@ function real_install_config_file() {
## @param savetime Backup time if necessary
## @param md5_log MD5 log for previous version of the spell, must be
in root form
#------------------------------------------------------------------------
-function internal_install_config_file() {
+internal_install_config_file() {
local from=$1
local to=$2
local savetime=$3
@@ -522,7 +522,7 @@ function internal_install_config_file() {
## choice 2 is currently the default, someday there will be a menu to
## choose what the default will be
#------------------------------------------------------------------------
-function real_handle_changed_config() {
+real_handle_changed_config() {
local from=$1
local to=$2
local savetime=$3
@@ -573,7 +573,7 @@ function real_handle_changed_config() {

}

-function resurrect_success() {
+resurrect_success() {

local INSTALL_LOG=$INSTALL_LOGS/$SPELL-$VERSION
local MD5_LOG=$MD5SUM_LOGS/$SPELL-$VERSION
@@ -669,7 +669,7 @@ function resurrect_success() {
}


-function resurrect_fail() {
+resurrect_fail() {
message "${PROBLEM_COLOR}Resurrect failed for spell:" \
"${SPELL_COLOR}${SPELL}${DEFAULT_COLOR} version" \
"${VERSION_COLOR}${VERSION}${DEFAULT_COLOR}"
diff --git a/var/lib/sorcery/modules/libscreen
b/var/lib/sorcery/modules/libscreen
index 913a536..bc5a8ec 100755
--- a/var/lib/sorcery/modules/libscreen
+++ b/var/lib/sorcery/modules/libscreen
@@ -3,7 +3,7 @@
#-----
## Output a short message about using libscreen
#-----
-function screen_quick_intro() {
+screen_quick_intro() {
message "${MESSAGE_COLOR}Using screen mode. Watch the bottom for notices."
message "${MESSAGE_COLOR}Press ^A-n and ^A-p to cycle through windows."
message "${MESSAGE_COLOR}Screen help is available with ^A-? (control-a
?)${DEFAULT}"
@@ -18,7 +18,7 @@ function screen_quick_intro() {
## It execs a screen session with the specified name, with the specified
## arguments.
#-----
-function screen_start() {
+screen_start() {
$STD_DEBUG
local name="$1"
local screen
@@ -37,7 +37,7 @@ function screen_start() {
## a command in a screen.
## The .!!| args to exec were determined by trial and error. ::: didn't work.
#-----
-function screen_command() {
+screen_command() {
$STD_DEBUG
local name="$1"
shift
@@ -61,7 +61,7 @@ function screen_command() {
## Only one of each type is allowed to exist at once
## They are actualy window numbers in disguise
#-----
-function screen_new_window() {
+screen_new_window() {
$STD_DEBUG
local screen_name="$1"
local win_num="$2"
@@ -79,7 +79,7 @@ function screen_new_window() {
## Doesn't work properly since screen doesn't like being run in the bg.
## Default escape code is ^A.
#-----
-function screen_attach() {
+screen_attach() {
$STD_DEBUG
screen -r "$1" $SCREEN_KEY &
}
@@ -88,7 +88,7 @@ function screen_attach() {
## @param Screen session name
## Detaches the named screen session from the tty.
#-----
-function screen_detach() {
+screen_detach() {
$STD_DEBUG
screen -x "$1" -X detach
}
@@ -99,7 +99,7 @@ function screen_detach() {
## Kills the window in the session. Also notifies the user that the window
was
## closed
#-----
-function screen_kill_window() {
+screen_kill_window() {
$STD_DEBUG
screen -x "$1" -p "$2" -X kill
sleep $SCREEN_ANTI_RACE_SLEEP
@@ -113,7 +113,7 @@ function screen_kill_window() {
## @param New name
## Give an existing window a new name
#-----
-function screen_name_window() {
+screen_name_window() {
$STD_DEBUG
screen -x "$1" -p "$2" -X title "$3"
sleep $SCREEN_ANTI_RACE_SLEEP
@@ -124,7 +124,7 @@ function screen_name_window() {
## Give aname to the current window.
## There are race conditions aplenty if you're not careful
#-----
-function screen_name_curr_window() {
+screen_name_curr_window() {
$STD_DEBUG
screen -x "$1" -X title "$2"
sleep $SCREEN_ANTI_RACE_SLEEP
@@ -135,7 +135,7 @@ function screen_name_curr_window() {
## @param Message
## Notify the user of something happening using the status bar
#-----
-function screen_notify() {
+screen_notify() {
$STD_DEBUG
screen -x "$1" -X echo "$@"
sleep $SCREEN_ANTI_RACE_SLEEP
@@ -147,7 +147,7 @@ function screen_notify() {
## Sets a window to be monitored. The user will be informed of any activity
## in the window.
#-----
-function screen_monitor_window() {
+screen_monitor_window() {
$STD_DEBUG
screen -x "$1" -p "$2" -X monitor on
sleep $SCREEN_ANTI_RACE_SLEEP
@@ -158,7 +158,7 @@ function screen_monitor_window() {
## @param Window to monitor
## Stops a window from being monitored
#-----
-function screen_unmonitor_window() {
+screen_unmonitor_window() {
$STD_DEBUG
screen -x "$1" -p "$2" -X monitor off
sleep $SCREEN_ANTI_RACE_SLEEP
@@ -169,7 +169,7 @@ function screen_unmonitor_window() {
## @param Window to switch to
## Changes the window the user sees
#-----
-function screen_switch_window() {
+screen_switch_window() {
$STD_DEBUG
screen -x "$1" -X select "$2"
sleep $SCREEN_ANTI_RACE_SLEEP
@@ -179,7 +179,7 @@ function screen_switch_window() {
## @param Screen session name
## Ends the screen session. Should end all processes running in the screen.
#-----
-function screen_quit() {
+screen_quit() {
$STD_DEBUG
screen -x "$1" -X quit
}
@@ -191,7 +191,7 @@ function screen_quit() {
## Moves a window to a new number
## If something is already at that number, it swaps them
#-----
-function screen_move_window() {
+screen_move_window() {
$STD_DEBUG
screen -x "$1" -p "$2" -X number "$3"
sleep $SCREEN_ANTI_RACE_SLEEP
@@ -202,7 +202,7 @@ function screen_move_window() {
## @param Delay in seconds
## Sets the time screen shows messages for
#-----
-function screen_set_msgwait() {
+screen_set_msgwait() {
$STD_DEBUG
screen -x "$1" -X msgwait $2
sleep $SCREEN_ANTI_RACE_SLEEP
diff --git a/var/lib/sorcery/modules/libsecurity
b/var/lib/sorcery/modules/libsecurity
index e45b8ff..0430252 100755
--- a/var/lib/sorcery/modules/libsecurity
+++ b/var/lib/sorcery/modules/libsecurity
@@ -22,7 +22,7 @@
## Checks the md5 of a single source file sourcenumber in spelldirectory.
##
#---------------------------------------------------------------------
-function gaze_checkmd5 () {
+gaze_checkmd5() {
i=$1/DETAILS
SOURCEnum=$2
SOURCEvar=SOURCE$SOURCEnum
@@ -173,7 +173,7 @@ function gaze_checkmd5 () {
## sourcenumber in spelldirectory.
##
#---------------------------------------------------------------------
-function gaze_checkmd5syntax () {
+gaze_checkmd5syntax() {
rp=$1
sn=$2
echo -en "${YELLOW}${BOLD}"
@@ -222,7 +222,7 @@ function gaze_checkmd5syntax () {
## Checks the md5s of all source files in spelldirectory.
##
#---------------------------------------------------------------------
-function gaze_checkmd5s() {
+gaze_checkmd5s() {
spellroot=$1
SCRIPT_DIRECTORY=$spellroot
spellpath=$spellroot/DETAILS
@@ -270,7 +270,7 @@ function gaze_checkmd5s() {
## arguments, the entire grimoire.
##
#---------------------------------------------------------------------
-function gaze_md5check() {
+gaze_md5check() {

message "${MESSAGE_COLOR}Going to check the md5 sums for the requested
item, section or"
message "grimoire by testing your current collection of
sources...${DEFAULT_COLOR}"
diff --git a/var/lib/sorcery/modules/libsorcery
b/var/lib/sorcery/modules/libsorcery
index f3b0ff7..0933912 100755
--- a/var/lib/sorcery/modules/libsorcery
+++ b/var/lib/sorcery/modules/libsorcery
@@ -18,7 +18,7 @@
## branch.
##
#---------------------------------------------------------------------
-function update_sorcery_scripts() {
+update_sorcery_scripts() {

local BRANCH=$1

@@ -135,7 +135,7 @@ function update_sorcery_scripts() {
## use to run proccesses at.
##
#---------------------------------------------------------------------
-function set_nice() {
+set_nice() {

PROMPT="Please enter the process priority sorcery should run at."

@@ -155,7 +155,7 @@ function set_nice() {
## use to run proccesses with.
##
#---------------------------------------------------------------------
-function set_umask() {
+set_umask() {

PROMPT="Please enter the permissions mask sorcery should run with."

@@ -176,8 +176,7 @@ function set_umask() {
## Displays and the contents of the file given as the first argument.
##
#---------------------------------------------------------------------
-function report() {
-
+report() {
if ! [ -f $1 ]; then return; fi

run_hook REPORT
@@ -201,7 +200,7 @@ function report() {
## filename with a different extension exists.
##
#---------------------------------------------------------------------
-function guess_filename() {
+guess_filename() {

local filename=$1

@@ -232,7 +231,7 @@ function guess_filename() {
## check if the file exists, or one with a similar compression exists
## @param file
#-------------------------------------------------------------------------
-function file_exists() {
+file_exists() {
guess_filename $1 > /dev/null
}

@@ -243,7 +242,7 @@ function file_exists() {
## Also runs ldconfig with the saved libraries.
##
#---------------------------------------------------------------------
-function save_libraries() {
+save_libraries() {

if [ -z "$SOURCE_DIRECTORY" ]
then return
@@ -296,7 +295,7 @@ function save_libraries() {
## Also runs ldconfig with the saved libraries.
##
#---------------------------------------------------------------------
-function save_binaries() {
+save_binaries() {
local dir
if [ -z "$SOURCE_DIRECTORY" ]
then return
@@ -345,7 +344,7 @@ function save_binaries() {
## Runs default ldconfig to stop using the saved libraries
##
#---------------------------------------------------------------------
-function release_saved_libraries() {
+release_saved_libraries() {
ldconfig
}

@@ -355,7 +354,7 @@ function release_saved_libraries() {
## Recovers from a CTRL-C while casting a spell
##
#---------------------------------------------------------------------
-function spell_recover() {
+spell_recover() {

debug "libsorcery" "Running spell_recover()"

@@ -379,7 +378,7 @@ function spell_recover() {
## Returns the section a spell is in.
##
#---------------------------------------------------------------------
-function find_section() {
+find_section() {

debug "libsorcery" "Running find_section() on $1"

@@ -397,7 +396,7 @@ function find_section() {
## Reads a list from standard input, and prints out each entry that is
## a directory (and not a symbolic link to a directory).
#---------------------------------------------------------------------
-function directories() {
+directories() {
local item
while read item; do
if [[ -d $item ]] && ! [[ -h $item ]]; then
@@ -414,7 +413,7 @@ function directories() {
## a file (and not a symbolic link to a file).
##
#---------------------------------------------------------------------
-function files() {
+files() {
local item
while read item; do
if [[ -f $item ]] && ! [[ -h $item ]]; then
@@ -431,7 +430,7 @@ function files() {
## a symbolic linke
##
#---------------------------------------------------------------------
-function symlinks() {
+symlinks() {
local item
while read item; do
if [[ -h $item ]]; then
@@ -451,7 +450,7 @@ function symlinks() {
## Used to filter out excluded or protected files from install logs.
##
#---------------------------------------------------------------------
-function filter() {
+filter() {
local thing RID_LIST NOT_RID_LIST
local files each invert
for each in $@; do
@@ -508,7 +507,7 @@ function filter() {
## Used to filter in config files from install logs.
##
#---------------------------------------------------------------------
-function filter_in() {
+filter_in() {
local thing RID_LIST NOT_RID_LIST
local files each
for each in $@; do
@@ -547,7 +546,7 @@ function filter_in() {
fi
}

-function filter_generic() {
+filter_generic() {
local args=$1
local filter_name=$2
local system_filter=$3
@@ -576,19 +575,19 @@ function filter_generic() {
fi
}

-function filter_volatiles() {
+filter_volatiles() {
filter_generic "$*" volatiles $VOLATILES
}

-function filter_configs() {
+filter_configs() {
filter_generic "$*" configs $CONFIGS
}

-function filter_excluded() {
+filter_excluded() {
filter_generic "$*" excluded $EXCLUDED
}

-function filter_protected() {
+filter_protected() {
filter_generic "$*" protected $PROTECTED
}

@@ -600,7 +599,7 @@ function filter_protected() {
## Given a list of files from standard input, returns the directory
## of each file.
#---------------------------------------------------------------------
-function dirnames() {
+dirnames() {
get_dirnames "$@"
}

@@ -613,7 +612,7 @@ function dirnames() {
## athlon-xp, athlon-mp, powerpc, speedy, tiny, risky, strip
##
#---------------------------------------------------------------------
-function optimize() {
+optimize() {
debug "libsorcery" "In optimize()"

unset CFLAGS CXXFLAGS LDFLAGS CPPFLAGS
@@ -684,7 +683,7 @@ function optimize() {
## @Stdout history
## Display the history of the grimoire given for review
#---------------------------------------------------------------------
-function grimoire_history() {
+grimoire_history() {

local grimoire="$1"
if [ -e $grimoire/ChangeLog ] ; then
@@ -706,7 +705,7 @@ function grimoire_history() {
## Display the history of sorcery for review
##
#---------------------------------------------------------------------
-function sorcery_history() {
+sorcery_history() {
local date="`cat "$STATE_DIRECTORY/sorcery.lastupdate" 2> /dev/null`"
[ -z "$date" ] && date="20030818"
local datedash="`echo "$date" | sed 's,^\(....\)\(..\)\(..\)$,\1-\2-\3,'`"
@@ -722,7 +721,7 @@ function sorcery_history() {
## Get the new changes from passed changelog argument
##
#---------------------------------------------------------------------
-function get_new_changes() {
+get_new_changes() {
local msg="$1"
local date="$2"
local changelog="$(awk -v date="$date" -F'[- ]' -- '/^[0-9]/{if (($1 $2
$3) < date) exit}{print}' "$3")"
@@ -747,7 +746,7 @@ function get_new_changes() {
## Pager with timeouts, cannot be used from a pipe.
## Invokes a subshell in case there are other background jobs running
#---------------------------------------------------------------------
-function timeout_pager() { (
+timeout_pager() { (
$PAGER "$@" &
sleep 1
for ((i=0;i<PAGER_TIMEOUT*10;i++)) ; do
@@ -769,7 +768,7 @@ function timeout_pager() { (
## Attempt to fix any spells that may be broken.
##
#---------------------------------------------------------------------
-function fix_installed_spells() {
+fix_installed_spells() {

local ANSWER=

@@ -786,7 +785,7 @@ function fix_installed_spells() {
## Returns a list of the log files for each spell.
##
#---------------------------------------------------------------------
-function log_list() {
+log_list() {
local spell version
while read spell version; do
# the install and md5sum logs are not compressed
@@ -805,7 +804,7 @@ function log_list() {
## Removes stale logs.
##
#---------------------------------------------------------------------
-function clean_logs() {
+clean_logs() {
debug "libsorcery" "Running clean_logs()"
local file

@@ -828,7 +827,7 @@ function clean_logs() {
## Updates the activity log.
##
#---------------------------------------------------------------------
-function activity_log() {
+activity_log() {
local date command spell version outcome info

lock_file $ACTIVITY_LOG
@@ -848,7 +847,7 @@ function activity_log() {
## Executes the spell's DETAILS file.
##
#---------------------------------------------------------------------
-function run_details() {
+run_details() {
debug "libsorcery" "starting run_details for $SPELL"
if ! codex_set_current_spell_by_name $SPELL; then
local GRIMOIRES=`codex_get_all_grimoires`
@@ -868,7 +867,7 @@ function run_details() {
## needed to fully unset a DETAILS (afk 4/21/04)
##
#---------------------------------------------------------------------
-function unset_details() {
+unset_details() {

local TEMP=""
local VARS="SPELL VERSION SOURCE_DIRECTORY WEB_SITE UPDATED ENTERED SHORT"
@@ -879,7 +878,7 @@ function unset_details() {
TEMP=${TEMP}${i}\\n
done
# not all SOURCE_* should be deleted (SOURCE_CACHE)
- VARS="$VARS `echo -e $TEMP | egrep
"^SOURCE[[:digit:]]*(_URL|_GPG|_IGNORE)?$"`"
+ VARS="$VARS `echo -e $TEMP | egrep "^SOURCE[0-9]*(_URL|_GPG|_IGNORE)?$"`"

unset $VARS
}
@@ -894,7 +893,7 @@ function unset_details() {
## THIS FUNCTION IS DEPRECIATED AND SHOULD NOT BE CALLED FOR ANY REASON
##
#---------------------------------------------------------------------
-function boost() {
+boost() {

debug "libsorcery" "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"
@@ -907,7 +906,7 @@ function boost() {
## Given a list of source files, returns true if each file exists.
##
#---------------------------------------------------------------------
-function verify_source() {
+verify_source() {
local source_file
for source_file in $@; do
if ! guess_filename $SOURCE_CACHE/$source_file > /dev/null; then
@@ -931,7 +930,7 @@ function verify_source() {
## source files.
##
#---------------------------------------------------------------------
-function sources() { (
+sources() { (
while [ $# -gt 0 ]; do
codex_set_current_spell_by_name "$1"
get_spell_files
@@ -947,7 +946,7 @@ function sources() { (
## source files.
##
#---------------------------------------------------------------------
-function source_urls() { (
+source_urls() { (
while [ $# -gt 0 ]; do
codex_set_current_spell_by_name "$1"
get_spell_files_and_urls | awk '{print $2}'
@@ -961,7 +960,7 @@ function source_urls() { (
## Returns a list of files that should not be pruned.
##
#---------------------------------------------------------------------
-function generate_keep_list() {
+generate_keep_list() {
local source_keep="$1"
local cache_keep="$2"
local type="$3"
@@ -995,7 +994,7 @@ function generate_keep_list() {
## Removes unnecessary files from the source cache and install cache.
##
#---------------------------------------------------------------------
-function prune() {
+prune() {

debug "libsorcery" "Running prune()"
local NO_KEEP
@@ -1064,7 +1063,7 @@ function prune() {
## Adds /var/lib/sorcery/build to the C<PATH> if necessary.
##
#---------------------------------------------------------------------
-function invoke_build_dir() {
+invoke_build_dir() {

# This merits some explaination:
#
@@ -1123,7 +1122,7 @@ function invoke_build_dir() {
## are missing.
##
#---------------------------------------------------------------------
-function verify_sources() {
+verify_sources() {
verify_source $(sources $SPELL)
}

@@ -1135,7 +1134,7 @@ function verify_sources() {
## in dialog menu (either gzip/bzip).
##
#---------------------------------------------------------------------
-function set_compression_type() {
+set_compression_type() {

local B_HELP="bzip2 compression (slow, small files)"
local P_HELP="parallel bzip2 compression (slow unless on SMP, small files)"
@@ -1209,7 +1208,7 @@ function set_compression_type() {
## the extension is .gz, .tgz, .bz2, .zip, .rpm, .Z, .xz, .7z or .lzma.
##
#---------------------------------------------------------------------
-function filename_indicates_compression() {
+filename_indicates_compression() {
grep -qE "^.*\.(gz|tgz|bz2|zip|Z|rpm|xz|7z|lzma)$" <<< "$1"
}

@@ -1217,7 +1216,7 @@ function filename_indicates_compression() {
## Check that we have all the passed grimoires and use them to
## override the default selection (all)
#---------------------------------------------------------------------
-function override_grimoires() {
+override_grimoires() {
local grimoires=$1
local grimoire

@@ -1241,7 +1240,7 @@ function override_grimoires() {
## Sets the most appropriate params for PAGER
## @Globals PAGER
#---------------------------------------------------------------------
-function set_pager() {
+set_pager() {
if [[ -z $PAGER ]]; then
if real_spell_ok less; then
# pager info
diff --git a/var/lib/sorcery/modules/libspell
b/var/lib/sorcery/modules/libspell
index 76b0fb3..4de495b 100755
--- a/var/lib/sorcery/modules/libspell
+++ b/var/lib/sorcery/modules/libspell
@@ -19,7 +19,7 @@
## are declared here as false so they exist, but are re-defined when in
## the proper context. This is merely a safety valve.
#---------------------------------------------------------------------
-function load_spell_file_functions() {
+load_spell_file_functions() {
for each in $(
cat << EOF
PREPARE:prepare
@@ -141,7 +141,7 @@ private_default_grimoire_generic() {
## Core entry point for sorcery to run a spell file.
## Arms real_default_*_file functions then runs the spell file/cmd/function
#---------------------------------------------------------------------
-function run_spell_file() {
+run_spell_file() {
local rc=0
local spell_file=$1
local function_suffix=$2
diff --git a/var/lib/sorcery/modules/libstage
b/var/lib/sorcery/modules/libstage
index ca330ca..5985672 100755
--- a/var/lib/sorcery/modules/libstage
+++ b/var/lib/sorcery/modules/libstage
@@ -10,7 +10,7 @@
## Main for installing staged spell called imediatly after devoking
## installwatch and stage root
#---------------------------------------------------------------------
-function transfer_staged_spell()
+transfer_staged_spell()
{
stage_install_ordinary

@@ -40,7 +40,7 @@ function transfer_staged_spell()
unlock_file "$CONFIG_STAGE_DIRECTORY/$SPELL"
}

-function filter_spell_configs()
+filter_spell_configs()
{
filter_generic "$*" configs $CONFIGS codex
}
@@ -49,7 +49,7 @@ function filter_spell_configs()
## Install config files to a staged location on the system or if
## they are also excluded, just install them normally.
#---------------------------------------------------------------------
-function stage_install_configs()
+stage_install_configs()
{
local spell_configs=$(get_all_package_files | filter_spell_configs -v)

@@ -68,7 +68,7 @@ function stage_install_configs()
#---------------------------------------------------------------------
## Install non-configs in the stage root
#---------------------------------------------------------------------
-function stage_install_ordinary()
+stage_install_ordinary()
{
message "${MESSAGE_COLOR}Installing ordinary files${DEFAULT_COLOR}"
get_all_package_files |
@@ -80,7 +80,7 @@ function stage_install_ordinary()
## @Stdout list of files installed by package
## lists all files the package installs relative to /
#---------------------------------------------------------------------
-function get_all_package_files()
+get_all_package_files()
{
# no point in using -printf "/%P\n" since it would cause a difference:
# the searchpath is now returned as empty; there it would be /
@@ -91,7 +91,7 @@ function get_all_package_files()
## @Stdin list of files to install
## install the files from the stage directory to the system
#---------------------------------------------------------------------
-function stage_install_files()
+stage_install_files()
{
local file
while read file ; do
@@ -100,7 +100,7 @@ function stage_install_files()
done
}

-function stage_install_directory()
+stage_install_directory()
{
local DIR=$1
local stat=( $(stat -c '%a %U %G' "$STAGE_DIRECTORY/TRANSL/$DIR" ) )
@@ -125,7 +125,7 @@ function stage_install_directory()
fi
}

-function stage_install_file()
+stage_install_file()
{
local FILE=$1
local stat=( $(stat -c '%a %U %G %h %i' "$STAGE_DIRECTORY/TRANSL/$FILE" ) )
@@ -167,7 +167,7 @@ function stage_install_file()
esac
}

-function stage_install_symlink()
+stage_install_symlink()
{
local FILE=$1
local SAVE=$CONFIG_STAGE_DIRECTORY/$FILE.$(date +%Y%m%d%H%M%S)
@@ -190,7 +190,7 @@ function stage_install_symlink()
esac
}

-function stage_install_fifo()
+stage_install_fifo()
{
local FILE=$1
local SAVE=$CONFIG_STAGE_DIRECTORY/$FILE.$(date +%Y%m%d%H%M%S)
@@ -222,7 +222,7 @@ function stage_install_fifo()
esac
}

-function stage_install_char_block()
+stage_install_char_block()
{
local FILE=$1
local stat=( $(stat -c '%a %U %G %t %T' "$STAGE_DIRECTORY/TRANSL/$FILE" ) )
@@ -259,7 +259,7 @@ function stage_install_char_block()
## install the file from the stage root to the system does check for
## dir so that the file can be moved
#---------------------------------------------------------------------
-function stage_install_list()
+stage_install_list()
{
if [[ -h $STAGE_DIRECTORY/TRANSL/$1 ]]
then
@@ -293,7 +293,7 @@ function stage_install_list()
## @param file
## @param spell owner of the file, so we don't need to look that up
#--------------------------------------------------------------------
-function recursive_config_stage_cleanup()
+recursive_config_stage_cleanup()
{
local file=$1 dirname
local spell=$2
diff --git a/var/lib/sorcery/modules/libstate
b/var/lib/sorcery/modules/libstate
index 31a73ae..ae2c4d4 100755
--- a/var/lib/sorcery/modules/libstate
+++ b/var/lib/sorcery/modules/libstate
@@ -23,7 +23,7 @@
## @Example add_depends kdelibs alsa-driver on optional --with-alsa
--without-alsa
##
#---------------------------------------------------------------------
-function add_depends()
+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() - $*"

@@ -71,7 +71,7 @@ function add_depends()
## @return 2 on error
##
#---------------------------------------------------------------------
-function search_depends_status_exact()
+search_depends_status_exact()
{ # $1=depends file $2=spell, $3=depends, $4=on/off, $5=optional/required,
$6=on arg, $7=off arg

local depends_status=$1
@@ -108,7 +108,7 @@ function search_depends_status_exact()
## @param off arg (optional)
##
#---------------------------------------------------------------------
-function search_depends_status_simple()
+search_depends_status_simple()
{ # $1=depends file $2=spell, $3=depends, $4=on/off, $5=optional/required,
$6=on arg, $7=off arg

local depends_status=$1
@@ -138,7 +138,7 @@ function search_depends_status_simple()
## Prints out the matching line(s)
##
#---------------------------------------------------------------------
-function search_depends_status()
+search_depends_status()
{ # $1=depends file $2=spell, $3=(opt)depends

[[ -z $2 ]] && return 1
@@ -172,7 +172,7 @@ function search_depends_status()
##
## Prints out one line of output
#---------------------------------------------------------------------
-function get_depends_options()
+get_depends_options()
{ # $1=depends_status $2=spell

local depends_status=$1
@@ -205,7 +205,7 @@ function get_depends_options()
## @param off arg
##
#---------------------------------------------------------------------
-function remove_depends_status()
+remove_depends_status()
{ # $1=depends file $2=spell, $3=(OPT)depends, $4=(OPT)on/off,
$5=(OPT)optional/required, $6=(OPT)on arg, $7=(OPT)off arg

local depends_status=$1
@@ -239,7 +239,7 @@ function remove_depends_status()
## @param dependency
##
#---------------------------------------------------------------------
-function toggle_depends_status() {
+toggle_depends_status() {
local depends_status=$1
shift

@@ -266,7 +266,7 @@ function toggle_depends_status() {
## @param on/off
##
#---------------------------------------------------------------------
-function change_spell_provider() {
+change_spell_provider() {
local depends_status=$1
shift

@@ -297,7 +297,7 @@ function change_spell_provider() {
## @param variable name to put the filename name in (pass by reference)
##
#---------------------------------------------------------------------
-function get_uncommitted_depends_file() {
+get_uncommitted_depends_file() {
local SPELL=$1
local temp_spell_depends
hash_get_ref "uncommitted_hash" $SPELL temp_spell_depends
@@ -323,7 +323,7 @@ function get_uncommitted_depends_file() {
## @param spell
## @param variable name to put the filename in
#---------------------------------------------------------------------
-function get_uncommitted_sub_depends_file() {
+get_uncommitted_sub_depends_file() {
local SPELL=$1
local upvar=$2
local __tmp
@@ -343,7 +343,7 @@ function get_uncommitted_sub_depends_file() {
## @param spell
## @param variable name to put the filename in
#---------------------------------------------------------------------
-function get_uncommitted_rsub_depends_file() {
+get_uncommitted_rsub_depends_file() {
local SPELL=$1
local upvar=$2
local __tmp
@@ -364,7 +364,7 @@ function get_uncommitted_rsub_depends_file() {
## @param sub-dependee
## @param sub-depends
#---------------------------------------------------------------------
-function add_sub_depends() {
+add_sub_depends() {
$STD_DEBUG
remove_sub_depends "$@" || return 1
local file=$1
@@ -384,7 +384,7 @@ function add_sub_depends() {
## @param sub-dependee (optional)
## @param sub-depends (optional)
#---------------------------------------------------------------------
-function search_sub_depends() {
+search_sub_depends() {
$STD_DEBUG
local file=$1
shift
@@ -407,7 +407,7 @@ function search_sub_depends() {
## @param sub-dependee
## @param sub-depends
#---------------------------------------------------------------------
-function remove_sub_depends() {
+remove_sub_depends() {
$STD_DEBUG
local file=$1
shift
@@ -454,7 +454,7 @@ function remove_sub_depends() {
## @param on/off
##
#---------------------------------------------------------------------
-function add_default_depends() {
+add_default_depends() {
debug "libstate" "add_default_depends() - $*"

#already here
@@ -498,7 +498,7 @@ function add_default_depends() {
## @param on/off/spell
##
#---------------------------------------------------------------------
-function remove_default_depends() {
+remove_default_depends() {

local file=$1
shift
@@ -525,7 +525,7 @@ function remove_default_depends() {
## @param on/off/spell
##
#---------------------------------------------------------------------
-function search_default_depends() {
+search_default_depends() {

local default_depends=$1
shift
@@ -555,7 +555,7 @@ function search_default_depends() {
## @param on/off
##
#---------------------------------------------------------------------
-function add_default_provider() {
+add_default_provider() {
debug "libstate" "add_default_depends() - $*"

#already here
@@ -585,11 +585,11 @@ function add_default_provider() {

# these are the same, as their countparts but are here for completeness
# and incase they do someday diverge
-function remove_default_provider() {
+remove_default_provider() {
remove_default_depends "$@"
}

-function search_default_provider() {
+search_default_provider() {
search_default_depends "$@"
}

@@ -600,7 +600,7 @@ function search_default_provider() {
## Removes the spell info from the passed file ($VERSION_STATUS)
##
#---------------------------------------------------------------------
-function remove_version_cache() {
+remove_version_cache() {
local file=$1
lock_start_transaction "$file" t_file
sed -i "/^$2 /d" $t_file
@@ -619,7 +619,7 @@ function remove_version_cache() {
## adds the info to the passed file (usually $VERSION_STATUS)
##
#---------------------------------------------------------------------
-function add_version_cache() {
+add_version_cache() {
local file=$1
shift
remove_version_cache "$file" $1
@@ -641,7 +641,7 @@ function add_version_cache() {
## @param (if spell) version
##
#---------------------------------------------------------------------
-function add_spell_status()
+add_spell_status()
{ #$1=spell, $2=action, $3=version, OR $1=action.

local spell action version date
@@ -669,7 +669,7 @@ function add_spell_status()
## adds the spell to the /var/state/sorcery/packages file
##
#---------------------------------------------------------------------
-function add_spell() {
+add_spell() {
remove_spell $1
add_spell_status $1 $2 $3
}
@@ -685,7 +685,7 @@ function add_spell() {
## Prints out the matching line(s)
##
#---------------------------------------------------------------------
-function search_spell_status() {
+search_spell_status() {
[[ -z $2 ]] && return 1
local spell_status=$1
shift
@@ -718,7 +718,7 @@ function search_spell_status() {
## @return 0 for all other cases ( even when spell is not found )
##
#---------------------------------------------------------------------
-function query_spell_status()
+query_spell_status()
{ #$1=spell, $2=(OPT)version

local return_var __status
@@ -745,7 +745,7 @@ function query_spell_status()
##
## @return 0 if the given spell's status is "installed"
#---------------------------------------------------------------------
-function real_spell_installed() {
+real_spell_installed() {
local status
query_spell_status "$1" status
[[ $status == installed ]]
@@ -758,7 +758,7 @@ function real_spell_installed() {
## @return 0 if the given spell's status is "held"
##
#---------------------------------------------------------------------
-function real_spell_held() {
+real_spell_held() {
local status
query_spell_status "$1" status
[[ $status == held ]]
@@ -770,7 +770,7 @@ function real_spell_held() {
##
## @return 0 if the given spell's status is "installed" or "held"
#---------------------------------------------------------------------
-function real_spell_ok() {
+real_spell_ok() {
local status
query_spell_status "$1" status
[[ $status == installed ]] || [[ $status == held ]]
@@ -783,7 +783,7 @@ function real_spell_ok() {
##
## @return 0 if any provider of $1 is installed
#---------------------------------------------------------------------
-function real_provider_ok() {
+real_provider_ok() {
for spell in $(search_depends_status_exact $DEPENDS_STATUS '.*' ".*($1)" \
'on' '.*' '.*' |cut -f2 -d:|cut -f1 -d\(|sort -u); do
spell_ok $spell && return 0
@@ -801,7 +801,7 @@ function real_provider_ok() {
## @return 0 if a dependency from $1 on $2 is enabled, 1 otherwise.
## @stdout the provider name(s)
#---------------------------------------------------------------------
-function real_get_spell_provider() {
+real_get_spell_provider() {
local dep_status
if [[ $3 ]] ; then
dep_status=$DEPENDS_STATUS
@@ -824,7 +824,7 @@ function real_get_spell_provider() {
## @return 0 if a dependency from $1 on $2 is enabled, 1 otherwise.
## @stdout the provider name(s)
#---------------------------------------------------------------------
-function real_is_depends_enabled() {
+real_is_depends_enabled() {
local dep_status
if [[ $3 ]] ; then
dep_status=$DEPENDS_STATUS
@@ -842,7 +842,7 @@ function real_is_depends_enabled() {
## @return 0 if the given spell's status is "exiled"
##
#---------------------------------------------------------------------
-function real_spell_exiled() {
+real_spell_exiled() {
local status
query_spell_status "$1" status
[[ $status == exiled ]]
@@ -854,7 +854,7 @@ function real_spell_exiled() {
## Removes all specified offending entries in SPELL_STATUS
##
#---------------------------------------------------------------------
-function remove_spell_status()
+remove_spell_status()
{ #$1=spell to remove status of

lock_start_transaction "$SPELL_STATUS" tSPELL_STATUS
@@ -870,7 +870,7 @@ function remove_spell_status()
## if C<EXILE> is set, the spell is changed to "exiled" in the file.
##
#---------------------------------------------------------------------
-function remove_spell() {
+remove_spell() {
debug "libsorcery" "Running remove_spell() on $1"
remove_spell_status $1
if [ -n "$EXILE" ]; then
@@ -885,7 +885,7 @@ function remove_spell() {
## SPELL_STATUS doesn't have to mentioned in libsorcery
##
#---------------------------------------------------------------------
-function all_spell_status()
+all_spell_status()
{
lock_file "$SPELL_STATUS"
cat $SPELL_STATUS
@@ -898,7 +898,7 @@ function all_spell_status()
## sets &lt;spells&gt;'s status to held
##
#---------------------------------------------------------------------
-function set_held () {
+set_held() {
local t_status
lock_start_transaction "$SPELL_STATUS" t_status
for to_hold in $@; do
@@ -913,7 +913,7 @@ function set_held () {
## sets &lt;spells&gt;'s status to exiled
##
#---------------------------------------------------------------------
-function set_exiled () {
+set_exiled() {
local TO_DISPELL=""
local TO_EXILE
local MY_STATUS
@@ -953,7 +953,7 @@ function set_exiled () {
## resets <spells>'s 'exiled' status
##
#---------------------------------------------------------------------
-function set_unexiled () {
+set_unexiled() {
local MY_STATUS
local TO_UNEXILE
for TO_UNEXILE in $@; do
@@ -973,7 +973,7 @@ function set_unexiled () {
## sets <spells>'s status to installed
##
#---------------------------------------------------------------------
-function set_unheld () {
+set_unheld() {
local t_status
lock_start_transaction "$SPELL_STATUS" t_status
for to_hold in $@; do
@@ -989,7 +989,7 @@ function set_unheld () {
## returns all spells that are in that status
##
#---------------------------------------------------------------------
-function get_all_spells_with_status () {
+get_all_spells_with_status() {
local status=$1
lock_file $SPELL_STATUS
if [[ $status != ok ]]; then
@@ -1011,7 +1011,7 @@ function get_all_spells_with_status () {
## variable and value rather than the equals sign.
##
#---------------------------------------------------------------------
-function modify_local_config() {
+modify_local_config() {
debug "libstate" "modify_local_config() - $*"
modify_config $LOCAL_CONFIG "$@"
}
@@ -1028,7 +1028,7 @@ function modify_local_config() {
## variable and value rather than the equals sign.
##
#---------------------------------------------------------------------
-function modify_config() {
+modify_config() {

debug "libstate" "modify_config() - $*"
local FILE=$1
@@ -1057,7 +1057,7 @@ function modify_config() {

# remove previous reference
lock_start_transaction "$FILE" tFILE
- grep -v "^[[:blank:]]*${1}${separator}" $FILE > $tFILE
+ grep -v "^[\t ]*${1}${separator}" $FILE > $tFILE

# justifying...
EQUALS_COL=$((20-${#1}))
@@ -1090,7 +1090,7 @@ function modify_config() {
## variable and value rather than the equals sign.
##
#---------------------------------------------------------------------
-function remove_config() {
+remove_config() {

debug "libstate" "remove_config() - $*"
local FILE=$1
@@ -1110,7 +1110,7 @@ function remove_config() {

# remove previous reference
lock_start_transaction "$FILE" tFILE
- grep -v "^[[:blank:]]*${1}${separator}" $FILE > $tFILE
+ grep -v "^[\t ]*${1}${separator}" $FILE > $tFILE
lock_commit_transaction $FILE

}
diff --git a/var/lib/sorcery/modules/libsummon
b/var/lib/sorcery/modules/libsummon
index d7da21e..3244c3e 100755
--- a/var/lib/sorcery/modules/libsummon
+++ b/var/lib/sorcery/modules/libsummon
@@ -26,7 +26,7 @@
## Also takes care of making entries in the activity log
##
#---------------------------------------------------------------------
-function summon_spell() {
+summon_spell() {
$STD_DEBUG
local SPELL=$1
local rc=1
@@ -64,7 +64,7 @@ function summon_spell() {
##
## @Stdout multiple lines, one per SOURCE/SOURCEx as "SOURCE SOURCE_URL[0]
SOURCE_URL[1]"
#-------------------------------------------------------------------------
-function get_spell_files_and_urls() {
+get_spell_files_and_urls() {
$STD_DEBUG
local url src
for src in $(real_get_source_nums SOURCE); do
@@ -81,7 +81,7 @@ function get_spell_files_and_urls() {
## Call acquire_src for each SOURCEx_URL
##
#-------------------------------------------------------------------------
-function real_default_sorcery_download() {
+real_default_sorcery_download() {
$STD_DEBUG
local SOURCE_NUMBER
for SOURCE_NUMBER in $(real_get_source_nums X); do
@@ -98,7 +98,7 @@ function real_default_sorcery_download() {
## doing so.
##
#-------------------------------------------------------------------------
-function real_acquire_src() {
+real_acquire_src() {
$STD_DEBUG
local DLNUM="$1"
local SVAR="SOURCE${DLNUM}"
@@ -125,7 +125,7 @@ function real_acquire_src() {
## file is ignored.
##
#-------------------------------------------------------------------------
-function is_downloaded() {
+is_downloaded() {
local target="$1"
local dlnum="${2:-1}"
local reason="$3"
@@ -151,7 +151,7 @@ function is_downloaded() {
## then calls download_src_args with them.
##
#-------------------------------------------------------------------------
-function real_download_src() {
+real_download_src() {
$STD_DEBUG
local DLNUM="$1"
local SVAR="SOURCE${DLNUM}"
@@ -182,7 +182,7 @@ function real_download_src() {
## downloaded it is repackaged as the specified file for later use.
##
#-------------------------------------------------------------------------
-function download_src_args() {
+download_src_args() {
$STD_DEBUG
local target="$1"
local urls="$2"
@@ -275,7 +275,7 @@ function download_src_args() {
## Download the resource, first try a leapforward url, then the given
## urls and finally the fallbacks.
#-------------------------------------------------------------------------
-function download_src_sub() {
+download_src_sub() {

$STD_DEBUG

@@ -321,7 +321,7 @@ function download_src_sub() {
## @param summon target return value, pass by reference
## @param summon type return value, pass by reference
#-------------------------------------------------------------------------
-function download_from_leapforward() {
+download_from_leapforward() {
$STD_DEBUG
if ! [ -n "$LEAPFORWARD_URL" ]; then
return 1
@@ -352,7 +352,7 @@ function download_from_leapforward() {
## @param summon type return value, pass by reference
##
#-------------------------------------------------------------------------
-function download_from_fallback() {
+download_from_fallback() {
$STD_DEBUG
local target="$1"
local url_list="$2"
@@ -391,7 +391,7 @@ function download_from_fallback() {
##
##
#-------------------------------------------------------------------------
-function unpack_for_update() {
+unpack_for_update() {
$STD_DEBUG
local target="$1"
local url_list="$2"
@@ -440,7 +440,7 @@ function unpack_for_update() {
## @return 1 if file fails the check
## @return 0 if file passes the check
#---------------------------------------------------------------------
-function source_sanity() {
+source_sanity() {
[[ "$1" ]] || return 0
[[ "$SUMMON_SANITY" == off ]] && return 0
local core_msg
diff --git a/var/lib/sorcery/modules/libtablet
b/var/lib/sorcery/modules/libtablet
index 6a3d814..e54d538 100755
--- a/var/lib/sorcery/modules/libtablet
+++ b/var/lib/sorcery/modules/libtablet
@@ -87,7 +87,7 @@

################################### Accessors ########################

-function tablet_get_version() {
+tablet_get_version() {
local tb_dir=$1 tb_version value
tablet_get_tb_version $tb_dir tb_version
[[ $? != 0 ]] && return 1
@@ -99,7 +99,7 @@ function tablet_get_version() {
return 0
}

-function tablet_get_updated() {
+tablet_get_updated() {
local tb_dir=$1 tb_version value
tablet_get_tb_version $tb_dir tb_version
[[ $? != 0 ]] && return 1
@@ -111,7 +111,7 @@ function tablet_get_updated() {
return 0
}

-function tablet_get_patchlevel() {
+tablet_get_patchlevel() {
local tb_dir=$1 tb_version value
tablet_get_tb_version $tb_dir tb_version
[[ $? != 0 ]] && return 1
@@ -124,7 +124,7 @@ function tablet_get_patchlevel() {
return 0
}

-function tablet_get_security_patch() {
+tablet_get_security_patch() {
local tb_dir=$1 tb_version value
tablet_get_tb_version $tb_dir tb_version
[[ $? != 0 ]] && return 1
@@ -137,7 +137,7 @@ function tablet_get_security_patch() {
return 0
}

-function tablet_get_build_api() {
+tablet_get_build_api() {
local tb_dir=$1 tb_version value
tablet_get_tb_version $tb_dir tb_version
[[ $? != 0 ]] && return 1
@@ -149,7 +149,7 @@ function tablet_get_build_api() {
return 0
}

-function tablet_get_depends() {
+tablet_get_depends() {
local tb_dir=$1 tb_version value
tablet_get_tb_version $tb_dir tb_version
[[ $? != 0 ]] && return 1
@@ -161,7 +161,7 @@ function tablet_get_depends() {
return 0
}

-function tablet_get_sub_depends() {
+tablet_get_sub_depends() {
local tb_dir=$1 tb_version value
tablet_get_tb_version $tb_dir tb_version
[[ $? != 0 ]] && return 1
@@ -173,7 +173,7 @@ function tablet_get_sub_depends() {
return 0
}

-function tablet_get_rsub_depends() {
+tablet_get_rsub_depends() {
local tb_dir=$1 tb_version value
tablet_get_tb_version $tb_dir tb_version
[[ $? != 0 ]] && return 1
@@ -184,7 +184,7 @@ function tablet_get_rsub_depends() {
eval "$2=\"$value\""
return 0
}
-function tablet_get_status() {
+tablet_get_status() {
local tb_dir=$1 tb_version value
tablet_get_tb_version $tb_dir tb_version
[[ $? != 0 ]] && return 1
@@ -196,7 +196,7 @@ function tablet_get_status() {
return 0
}

-function tablet_get_sources() {
+tablet_get_sources() {
local tb_dir=$1 tb_version value
tablet_get_tb_version $tb_dir tb_version
[[ $? != 0 ]] && return 1
@@ -208,7 +208,7 @@ function tablet_get_sources() {
return 0
}

-function tablet_get_spell_file() {
+tablet_get_spell_file() {
local tb_dir=$1 tb_version value
tablet_get_tb_version $tb_dir tb_version
[[ $? != 0 ]] && return 1
@@ -220,7 +220,7 @@ function tablet_get_spell_file() {
return 0
}

-function tablet_get_persistent_config() {
+tablet_get_persistent_config() {
local tb_dir=$1 tb_version value
tablet_get_tb_version $tb_dir tb_version
[[ $? != 0 ]] && return 1
@@ -232,7 +232,7 @@ function tablet_get_persistent_config() {
return 0
}

-function tablet_get_section_file () {
+tablet_get_section_file() {
local tb_dir=$1 tb_version value
tablet_get_tb_version $tb_dir tb_version
[[ $? != 0 ]] && return 1
@@ -244,7 +244,7 @@ function tablet_get_section_file () {
return 0
}

-function tablet_get_grimoire_file() {
+tablet_get_grimoire_file() {
local tb_dir=$1 tb_version value
tablet_get_tb_version $tb_dir tb_version
[[ $? != 0 ]] && return 1
@@ -259,7 +259,7 @@ function tablet_get_grimoire_file() {
#---
## return section name from tablet
#---
-function tablet_get_section_name() {
+tablet_get_section_name() {
local tb_dir=$1 tb_version value
tablet_get_tb_version $tb_dir tb_version
[[ $? != 0 ]] && return 1
@@ -271,7 +271,7 @@ function tablet_get_section_name() {
return 0
}

-function tablet_get_grimoire_name() {
+tablet_get_grimoire_name() {
local tb_dir=$1 tb_version value
tablet_get_tb_version $tb_dir tb_version
[[ $? != 0 ]] && return 1
@@ -283,7 +283,7 @@ function tablet_get_grimoire_name() {
return 0
}

-function tablet_get_log_file() {
+tablet_get_log_file() {
local tb_dir=$1 tb_version value
tablet_get_tb_version $tb_dir tb_version
[[ $? != 0 ]] && return 1
@@ -295,20 +295,20 @@ function tablet_get_log_file() {
return 0
}

-function tablet_get_spell_filter() {
+tablet_get_spell_filter() {
tablet_get_spell_file $1 $2 $3
}
-function tablet_get_section_filter() {
+tablet_get_section_filter() {
tablet_get_section_file $1 $2 $3
}
-function tablet_get_grimoire_filter() {
+tablet_get_grimoire_filter() {
tablet_get_grimoire_file $1 $2 $3
}

#---
## get path to roots
#---
-function tablet_get_roots() {
+tablet_get_roots() {
local tb_dir=$1 tb_version value
tablet_get_tb_version $tb_dir tb_version
[[ $? != 0 ]] && return 1
@@ -320,7 +320,7 @@ function tablet_get_roots() {
return 0
}

-function tablet_load_roots() {
+tablet_load_roots() {
local tb_dir=$1 tb_version
tablet_get_tb_version $tb_dir tb_version
[[ $? != 0 ]] && return 1
@@ -331,12 +331,12 @@ function tablet_load_roots() {
source $STATE_CONFIG
}

-function tablet_unload_roots() {
+tablet_unload_roots() {
source $ROOTS_CONFIG
source $STATE_CONFIG
}

-function tablet_get_tb_version() {
+tablet_get_tb_version() {
local tb_dir=$1
if ! [[ $tb_dir ]] ; then
error_message "nothing passed in!"
@@ -366,7 +366,7 @@ function tablet_get_tb_version() {
## dirname of that is $TABLET_PATH/<spell>
## basename of that is <spell>
#---------------------------------------------------------------------
-function tablet_get_spell_name_from_path() {
+tablet_get_spell_name_from_path() {
[[ $1 ]] || return
local tmp
smgl_dirname "$1" tmp
@@ -381,7 +381,7 @@ function tablet_get_spell_name_from_path() {
## @stdout path to unique tablet directory
## @return 0 if the directory was made, 1 if not
#---------------------------------------------------------------------
-function tablet_get_path() {
+tablet_get_path() {
local SPELL=$1
local tb_dir=$TABLET_PATH/$SPELL/$(date +%Y%m%d%H%M%S)
local sleep_time
@@ -418,7 +418,7 @@ function tablet_get_path() {
## the idea for the two globals is to simplify the layers in-between
## and skip searching when it isn't necessary
#----------------------------------------------------------------------
-function tablet_find_spell_dir() {
+tablet_find_spell_dir() {
[[ $TABLET_IGNORE ]] && return 1
if [[ $TABLET_SPELL_DIR ]] ; then
eval "$2=\"$TABLET_SPELL_DIR\""
@@ -468,7 +468,7 @@ function tablet_find_spell_dir() {
## quicker dirtier version of above without special checks since the
## tablet in a cache tarball has nothing to do with the installed system
#----------------------------------------------------------------------
-function tablet_find_resurrect_dir() {
+tablet_find_resurrect_dir() {
local SPELL=$1
if ! test -d $TABLET_PATH; then
return 1
@@ -492,7 +492,7 @@ function tablet_find_resurrect_dir() {
## @param tablet dir
## @globals everything that comes with a spell...
#----------------------------------------------------------------------
-function tablet_install_spell_files() {
+tablet_install_spell_files() {
pushd $1 &>/dev/null || {
message "Failed to enter $1"
return 1
@@ -568,7 +568,7 @@ function tablet_install_spell_files() {
## Note that this function does not use the tablet_get accessors for
## efficiency.
#---------------------------------------------------------------------
-function tablet_set_spell() {
+tablet_set_spell() {
codex_clear_current_spell
SPELL=$1
if [[ $2 ]] && test -d $2; then
@@ -624,7 +624,7 @@ function tablet_set_spell() {
#---------------------------------------------------------------------
## Import repair files for all tablet pages
#---------------------------------------------------------------------
-function tablet_import_repair_files() { (
+tablet_import_repair_files() { (
local tablet_path=$1
local dir rc chapter page

@@ -645,7 +645,7 @@ function tablet_import_repair_files() { (
## Import repair files for a specific tablet page, expects caller
## to have spell_lookup_hash setup for a spell lookup, and nullglob set.
#---------------------------------------------------------------------
-function tablet_import_repair_files_page() {
+tablet_import_repair_files_page() {
local page=$1

local spell spell_dir
@@ -688,7 +688,7 @@ function tablet_import_repair_files_page() {
## Private subroutine for tablet_import_repair_files_page, do not call
## from anywhere else.
#---------------------------------------------------------------------
-function tablet_check_repair_file() {
+tablet_check_repair_file() {
local type=$1
local replace=0
local tablet_file
@@ -741,7 +741,7 @@ function tablet_check_repair_file() {
##
## @param file that will hold the cache
#---------------------------------------------------------------------
-function tablet_create_version_cache() {
+tablet_create_version_cache() {
[[ -f "$1" ]] && return 0
local file="$1"
local page_dir
@@ -796,7 +796,7 @@ function tablet_create_version_cache() {
##
## @param cache file (usually $VERSION_STATUS)
#---------------------------------------------------------------------
-function tablet_check_version_cache() {
+tablet_check_version_cache() {
[[ -z $1 ]] && return 1
[[ -n $OLD_QUEUING_METHOD ]] && return 0
local file=$1
@@ -821,7 +821,7 @@ function tablet_check_version_cache() {
#---------------------------------------------------------------------
##
#---------------------------------------------------------------------
-function tablet_cleanse_tablet() {
+tablet_cleanse_tablet() {
local tablet_path=$1
local backup_dir=$2
local file_backup_dir=$backup_dir/tablet_files
@@ -842,7 +842,7 @@ function tablet_cleanse_tablet() {
#---------------------------------------------------------------------
##
#---------------------------------------------------------------------
-function tablet_cleanse_chapter() {
+tablet_cleanse_chapter() {
local sdir=$1
local backup_dir=$2
local do_repair=$3
@@ -876,7 +876,7 @@ function tablet_cleanse_chapter() {
## @param path to a tablet chapter
## @param backup dir
#---------------------------------------------------------------------
-function tablet_fix_duplicates() {
+tablet_fix_duplicates() {
local spell=$1
local tbc_dir=$2
local backup_dir=$3
@@ -910,7 +910,7 @@ function tablet_fix_duplicates() {
fi
}

-function tablet_backup_page() {
+tablet_backup_page() {
local tb_dir=$1
local backup_dir=$2
local spell_name=$(tablet_get_spell_name_from_path $tb_dir)
@@ -921,7 +921,7 @@ function tablet_backup_page() {
#---------------------------------------------------------------------
## check if the tablet represents a spell version thats installed
#---------------------------------------------------------------------
-function tablet_is_spell_version_installed() {
+tablet_is_spell_version_installed() {
local spell=$1
local tb_dir=$2
local quiet=$3
@@ -950,7 +950,7 @@ function tablet_is_spell_version_installed() {
#---------------------------------------------------------------------
## check if a tablets install log includes itself
#---------------------------------------------------------------------
-function tablet_does_tablet_point_to_itself() {
+tablet_does_tablet_point_to_itself() {
local rc
local tb_dir=$1
local quiet=$2
@@ -987,7 +987,7 @@ function tablet_does_tablet_point_to_itself() {
## as read only, and 2) anyone using the tablet for write operations (they
## shouldnt be) will break the hardlinks
#----------------------------------------------------------------------
-function tablet_coalesce_files() {
+tablet_coalesce_files() {
local dir=${1:-$TABLET_PATH}
local car cdr i each
let i=0
@@ -1022,7 +1022,7 @@ function tablet_coalesce_files() {
## Fix the various known defects with an un-versioned tablet and stuff
## a version of 1 in it.
#---------------------------------------------------------------------
-function tablet_0_repair() {
+tablet_0_repair() {
[[ $1 ]] || return 1
# once all these are done, we should have a version 1 tablet
tablet_0_repair_spell $1 &&
@@ -1043,7 +1043,7 @@ function tablet_0_repair() {
## $tb_dir/spell/<spellname>/DETAILS
## the first is correct, the second is not, correct the problem if it exists
#---------------------------------------------------------------------
-function tablet_0_repair_spell() {
+tablet_0_repair_spell() {
local tb_dir=$1
[[ $tb_dir ]] || return 1
local spell_name=$(tablet_get_spell_name_from_path $tb_dir)
@@ -1073,7 +1073,7 @@ function tablet_0_repair_spell() {
## Repair the "updated" file as it wasnt created for all pre-versioned
## tablets. Source the spell, echo $VERSION into a file named version
#---------------------------------------------------------------------
-function tablet_0_repair_version() {
+tablet_0_repair_version() {
local tb_dir=$1
[[ $tb_dir ]] || return 1
test -f $tb_dir/version ||
@@ -1090,7 +1090,7 @@ function tablet_0_repair_version() {
## Repair the "updated" file as it wasnt created for all pre-versioned
## tablets. Source the spell, echo $UPDATED into a file named updated
#---------------------------------------------------------------------
-function tablet_0_repair_updated() {
+tablet_0_repair_updated() {
local tb_dir=$1
[[ $tb_dir ]] || return 1
test -f $tb_dir/updated ||
diff --git a/var/lib/sorcery/modules/libtime b/var/lib/sorcery/modules/libtime
index 2e05720..2ffe40e 100755
--- a/var/lib/sorcery/modules/libtime
+++ b/var/lib/sorcery/modules/libtime
@@ -18,7 +18,7 @@
##
## @Stdout casting time(s)
#---------------------------------------------------------------------
-function compute_cast_times() {
+compute_cast_times() {
awk -v spell=$1 -v version=$2 '
# log timestamps are in the "%Y%m%d:%H%M\(%z\)" format
(20080625:0853(+0000))
# we need them in "%Y %m %d %H %M %S" and %s (epoch time). We ignore the
@@ -55,7 +55,7 @@ function compute_cast_times() {
## @param spell
## @Stdout cast time of spell in seconds
#---------------------------------------------------------------------
-function compute_cast_time() {
+compute_cast_time() {
# FIXME: make the default configurable
local spell=$1
local type=${2:---last}
@@ -85,7 +85,7 @@ function compute_cast_time() {
## @return 1 if there are no valid times available
## @return 0 otherwise
#---------------------------------------------------------------------
-function compute_all_cast_times() {
+compute_all_cast_times() {
local spell=$1 verbosity=$2
local times time

@@ -133,7 +133,7 @@ function compute_all_cast_times() {
## @Stdin numbers separated by newlines
## @Stdout mean and its error
#---------------------------------------------------------------------
-function compute_mean() {
+compute_mean() {
awk '
{
sum += $0
@@ -164,7 +164,7 @@ function compute_mean() {
## @Stdin numbers separated by newlines
## @Stdout mean value
#---------------------------------------------------------------------
-function compute_weighted_mean() {
+compute_weighted_mean() {
local type=$1
local version=$2

@@ -190,7 +190,7 @@ function compute_weighted_mean() {
## @Stdin numbers separated by newlines
## @Stdout median value
#---------------------------------------------------------------------
-function compute_median() {
+compute_median() {
sort -n | awk '
{ n[NR] = $0 }
END {
@@ -212,7 +212,7 @@ function compute_median() {
## @param ...
## @Stdout total error
#---------------------------------------------------------------------
-function compute_total_error() {
+compute_total_error() {
tr ' ' '\n' <<< "$@" |
awk '
{ total += $0 ^ 2 }
@@ -231,7 +231,7 @@ function compute_total_error() {
## @param estimation error in seconds (optional)
## @Stdout time (DD:HH:MM or HH:MM or MM or "less than a minute")
#---------------------------------------------------------------------
-function pretty_print_time() {
+pretty_print_time() {
if [[ -z $2 ]]; then
pretty_print_time_sub "$@"
else
@@ -248,7 +248,7 @@ function pretty_print_time() {
## @param time in seconds
## @Stdout time (DD:HH:MM or HH:MM or MM or "less than a minute")
#---------------------------------------------------------------------
-function pretty_print_time_sub() {
+pretty_print_time_sub() {
# date can only print day of year starting with 1, so we can't use it,
# yet we have to display the number of days, since the total can be big
awk -v sum=$1 'END {
@@ -281,7 +281,7 @@ function pretty_print_time_sub() {
## @param estimation error in seconds
## @Stdout time +/- error (see pretty_print_time)
#---------------------------------------------------------------------
-function pretty_print_time_error() {
+pretty_print_time_error() {
local error=$1

if (( $error < 60 )); then
diff --git a/var/lib/sorcery/modules/libtrack
b/var/lib/sorcery/modules/libtrack
index b7474cd..9f5d4d4 100755
--- a/var/lib/sorcery/modules/libtrack
+++ b/var/lib/sorcery/modules/libtrack
@@ -11,7 +11,7 @@
## This is used by cast to exclude files it's modified from the md5 list.
##
#---------------------------------------------------------------------
-function libtrack_init() {
+libtrack_init() {
[[ $__MODIFIED_FILES ]] || export
__MODIFIED_FILES="$TMP_DIR/modified_files"
}

@@ -23,7 +23,7 @@ function libtrack_init() {
## files that exist.
##
#---------------------------------------------------------------------
-function exists() {
+exists() {
local item
while read item; do
[[ -e $item ]] && echo $item
@@ -39,7 +39,7 @@ function exists() {
## installwatch is running.
##
#---------------------------------------------------------------------
-function real_track_manual() {
+real_track_manual() {
if [[ -z "$STAGED_INSTALL" || $STAGED_INSTALL == off ]] &&
[[ -z "$INSTALLWATCHFILE" && -z "$INSTW_LOGFILE" ]] ; then
echo "Can't tell installwatch to manually track... installwatch isn't
running."
@@ -54,7 +54,7 @@ function real_track_manual() {
## make a file, check to see if it exists, check to see if the
## contents of the file is what we made it
#--------------------------------------------------------------------
-function run_castfs_sanity()
+run_castfs_sanity()
{
export CASTFS_LOGFILE=${CASTFS_DBGLOG}
export CASTFS_DBGLVL=${CASTFS_DEBUG_LEVEL}
@@ -93,7 +93,7 @@ function run_castfs_sanity()
## Starts Translation Stage Root
##
#---------------------------------------------------------------------
-function real_invoke_stage_root()
+real_invoke_stage_root()
{
export CASTFS_LOGFILE=${CASTFS_DBGLOG}
export CASTFS_DBGLVL=${CASTFS_DEBUG_LEVEL}
@@ -120,7 +120,7 @@ function real_invoke_stage_root()
## Stops Translation Stage Root
##
#---------------------------------------------------------------------
-function real_devoke_stage_root()
+real_devoke_stage_root()
{
unset CASTFS_LOGFILE
unset CASTFS_DBGLVL
@@ -136,7 +136,7 @@ function real_devoke_stage_root()
## Prepare Stage Root
##
#---------------------------------------------------------------------
-function prepare_stage_root()
+prepare_stage_root()
{
mk_source_dir "${STAGE_DIRECTORY}" &&
mk_source_dir "${STAGE_DIRECTORY}/TRANSL" &&
@@ -148,7 +148,7 @@ function prepare_stage_root()
## Destroy Stage Root
##
#---------------------------------------------------------------------
-function destroy_stage_root()
+destroy_stage_root()
{
rm_source_dir $STAGE_DIRECTORY
}
@@ -158,7 +158,7 @@ function destroy_stage_root()
## Sets up installwatch.
##
#---------------------------------------------------------------------
-function real_invoke_installwatch() {
+real_invoke_installwatch() {
if [[ -e $INSTALLWATCH_SO ]]; then
export INSTALLWATCHFILE=$IW_LOG
export INSTW_LOGFILE=$IW_LOG
@@ -171,18 +171,18 @@ function real_invoke_installwatch() {
## Stops using installwatch
##
#---------------------------------------------------------------------
-function real_devoke_installwatch() {
+real_devoke_installwatch() {
unset LD_PRELOAD
unset INSTALLWATCHFILE INSTW_LOGFILE
}

-function is_castfs_installed()
+is_castfs_installed()
{
local loc
if smgl_which castfs loc >/dev/null 2>&1 &&
(
modprobe fuse > /dev/null 2>&1 ||
- grep -q '^nodev[[:space:]]*fuse$' /proc/filesystems
+ grep -q '^nodev[\t\v\f\r ]*fuse$' /proc/filesystems
) &&
[[ -c /dev/fuse ]]
then
@@ -199,7 +199,7 @@ function is_castfs_installed()
## Parses the installwatch log for files installed by a spell.
##
#---------------------------------------------------------------------
-function parse_iw() {
+parse_iw() {
local INPUT=$1

# it is EXTREMELY IMPORTANT that this variable contains an actual
@@ -218,7 +218,7 @@ function parse_iw() {
## Creates the install log containing all files installed by the spell.
##
#---------------------------------------------------------------------
-function create_install_log() {
+create_install_log() {
debug "libtrack" "$FUNCNAME on $SPELL"
local INPUT=$1
local OUTPUT=$2
@@ -255,7 +255,7 @@ function create_install_log() {
## @param output log file
##
#---------------------------------------------------------------------
-function create_stage_install_log() {
+create_stage_install_log() {
debug "libtrack" "$FUNCNAME on $SPELL"
local input="$1"
local output="$2"
@@ -272,7 +272,7 @@ function create_stage_install_log() {
#---------------------------------------------------------------------
## Makes a list of files with the md5sum
#---------------------------------------------------------------------
-function create_md5list() {
+create_md5list() {
local INPUT=$1
local OUTPUT=$2
debug "libtrack" "$FUNCNAME on $SPELL"
@@ -291,7 +291,7 @@ function create_md5list() {
#---------------------------------------------------------------------
## External api to note config files
#---------------------------------------------------------------------
-function real_note_config_file() {
+real_note_config_file() {
if check_if_modified "$1"; then
mark_file_modified "$1"
fi
@@ -302,7 +302,7 @@ function real_note_config_file() {
## Notes that a file was previously modified so that its md5 is
## deliberatly munged
#---------------------------------------------------------------------
-function mark_file_modified() {
+mark_file_modified() {
[[ "$1" ]] || return 1
[[ $__MODIFIED_FILES ]] || export
__MODIFIED_FILES="$TMP_DIR/modified_files"
echo "^$1\$" >> $__MODIFIED_FILES
@@ -313,7 +313,7 @@ function mark_file_modified() {
## @param file to check
## @param md5 file (optional)
#---------------------------------------------------------------------
-function check_if_modified() {
+check_if_modified() {
local to=$1
local md5_log=$2
if ! [[ $2 ]] ; then
@@ -339,7 +339,7 @@ function check_if_modified() {
## @param archive name
## @param upvar
#---------------------------------------------------------------------
-function construct_cache_name() {
+construct_cache_name() {
local name=$1
if [[ -n $ARCHIVEBIN ]]; then
# just use the bin, currently there is no need for another extension
@@ -355,7 +355,7 @@ function construct_cache_name() {
## @param archive name (can be right trimmed, globbing will be done)
## @param upvar (optional)
#---------------------------------------------------------------------
-function find_cache() {
+find_cache() {
debug "libtrack" "$FUNCNAME $@"
local filename=$1
local real_name
@@ -391,7 +391,7 @@ function find_cache() {
## @param compressed archive name
##
#---------------------------------------------------------------------
-function create_cache_archive() {
+create_cache_archive() {

debug "libtrack" "$FUNCNAME on $SPELL"
if [ "$ARCHIVE" == "off" ]; then
@@ -441,10 +441,10 @@ function create_cache_archive() {
## this is to filter the install log from one form to another
## for install_root/track_root conversions
#---------------------------------------------------------------------
-function install_log_filter() {
+install_log_filter() {
sed "s:^$1:$2:"
}
-function md5_log_filter() {
+md5_log_filter() {
sed "s: $1: $2:"
}

@@ -481,7 +481,7 @@ function md5_log_filter() {
## to filterable format just requires removing whatever the expected prefix
is.
## </pre>
#---------------------------------------------------------------------
-function log_adjuster() {
+log_adjuster() {
local input=$1
local output=$2
local informat=$3
@@ -580,7 +580,7 @@ function log_adjuster() {
## @param filename for state files, possibly /dev/stdout or /dev/stderr
don't use the same stream for both types.
##
#---------------------------------------------------------------------
-function seperate_state_files() {
+seperate_state_files() {
local REAL_LOG_DIR=${LOG_DIRECTORY#$STATE_ROOT}
local REAL_STATE_DIR=${STATE_DIRECTORY#$STATE_ROOT}

@@ -618,7 +618,7 @@ function seperate_state_files() {
## are usually going to be different between forks so the liklihood
## of a collision is greatly reduced.
#---------------------------------------------------------------------
-function make_safe_dir() { (
+make_safe_dir() { (
RANDOM=$(date "+%N")
local TMP_SSF=$TMP_DIR/$RANDOM
while ! mkdir "$TMP_SSF" &> /dev/null; do
diff --git a/var/lib/sorcery/modules/libtriggers
b/var/lib/sorcery/modules/libtriggers
index 6531d0d..6f475a1 100755
--- a/var/lib/sorcery/modules/libtriggers
+++ b/var/lib/sorcery/modules/libtriggers
@@ -15,7 +15,7 @@
## Checks for a TRIGGERS file in SCRIPT_DIRECTORY, and if it is
## executable, runs it.
#---------------------------------------------------------------------
-function run_triggers() {
+run_triggers() {
debug "libtriggers" "Starting run_triggers() on $SPELL"

run_spell_file TRIGGERS triggers
@@ -29,7 +29,7 @@ function run_triggers() {
## triggers.
##
#---------------------------------------------------------------------
-function remove_triggers ()
+remove_triggers()
{
debug "libtriggers" "remove_triggers - $*"

@@ -51,7 +51,7 @@ function remove_triggers ()
## optional. If omitted, the value of SPELL will be used.
##
#---------------------------------------------------------------------
-function trigger ()
+trigger()
{
debug "libtriggers" "trigger - $*"

@@ -67,7 +67,7 @@ function trigger ()
#---------------------------------------------------------------------
## Get the triggerees of a given spell event and action
#---------------------------------------------------------------------
-function get_triggerees() {
+get_triggerees() {
local spell=$1
local event=$2
local each
@@ -85,7 +85,7 @@ function get_triggerees() {
## Get the run_script triggers from $spell on $target when theres a
## $action
#---------------------------------------------------------------------
-function get_run_script_triggers() {
+get_run_script_triggers() {
local spell=$1
local event=$2
local target=$3
@@ -104,7 +104,7 @@ function get_run_script_triggers() {
## the trigger and action exist.
##
#---------------------------------------------------------------------
-function set_trigger ()
+set_trigger()
{ #1==trigger to set, $2==spell that triggers it, $3=action,
$4==(optional)spell this is for

debug "libtriggers" "set_trigger - $*"
@@ -147,7 +147,7 @@ function set_trigger ()
## Used by spells to make adding triggerse nice.
##
#---------------------------------------------------------------------
-function real_on_cast () {
+real_on_cast() {
set_trigger "on_cast" "$1" "$2"
}

@@ -159,7 +159,7 @@ function real_on_cast () {
## Used by spells to make adding triggerse nice.
##
#---------------------------------------------------------------------
-function real_on_pre_cast() {
+real_on_pre_cast() {
set_trigger "on_pre_cast" "$1" "$2"
}

@@ -171,7 +171,7 @@ function real_on_pre_cast() {
## Used by spells to make adding triggers nice.
##
#---------------------------------------------------------------------
-function real_on_dispel () {
+real_on_dispel() {
set_trigger "on_dispel" "$1" "$2"
}

@@ -183,12 +183,12 @@ function real_on_dispel () {
## Used by spells to make adding triggerse nice.
##
#---------------------------------------------------------------------
-function real_on_pre_dispel () {
+real_on_pre_dispel() {
set_trigger "on_pre_dispel" "$1" "$2"
}


-function do_trigger () {
+do_trigger() {
TRIGGER=()
explode "$1" ":" TRIGGER
local DC="$DEFAULT_COLOR"
diff --git a/var/lib/sorcery/modules/libunpack
b/var/lib/sorcery/modules/libunpack
index 7e19f15..dc977a8 100755
--- a/var/lib/sorcery/modules/libunpack
+++ b/var/lib/sorcery/modules/libunpack
@@ -116,7 +116,7 @@
## checks on a single source.
##
#---------------------------------------------------------------------
-function real_unpack_file() {
+real_unpack_file() {
debug "libgrimoire" "real_unpack_file - $*"

local FILENUM="$1"
@@ -147,7 +147,7 @@ function real_unpack_file() {
## Does the work of verifying a file with the new-world verification
## system.
#---------------------------------------------------------------------
-function real_verify_file() {
+real_verify_file() {
debug "libunpack" "real_verify_file - $*"

local FILENUM="$1"
@@ -185,7 +185,7 @@ function real_verify_file() {
## Note: zip is a special case because it doesn't work with streams.
##
#---------------------------------------------------------------------
-function uncompress_core() {
+uncompress_core() {
debug "libgrimoire" "uncompress_core - $*"

case "$2" in
@@ -214,7 +214,7 @@ function uncompress_core() {
## Note: zip is a special case because it doesn't work with streams.
##
#---------------------------------------------------------------------
-function unpack_core() {
+unpack_core() {
debug "libgrimoire" "unpack_core - $*"

case "$2" in
@@ -245,7 +245,7 @@ function unpack_core() {
## Return value is always success due to `file' workings
##
#---------------------------------------------------------------------
-function real_guess_compressor() {
+real_guess_compressor() {
# NOTE: if the file doesn't exist, `file' still completes successfully
# the COMPRESSOR value in this case will be "can't"

@@ -264,7 +264,7 @@ function real_guess_compressor() {
## Used to be uncompress_md5(), now it is uncompress_core()
##
#---------------------------------------------------------------------
-function real_uncompress() { uncompress_core "$@"; }
+real_uncompress() { uncompress_core "$@"; }


#---------------------------------------------------------------------
@@ -273,7 +273,7 @@ function real_uncompress() { uncompress_core "$@"; }
## Returns 200 if the user says not to Abort in the face, otherwise
##
#---------------------------------------------------------------------
-function unpack_spell_required() {
+unpack_spell_required() {
debug "libgrimoire" "Running unpack_spell_required -- $1"

local x
@@ -300,7 +300,7 @@ function unpack_spell_required() {
## verification levels, 1 otherwise
##
#--------------------------------------------------------------------
-function is_allowed_verf_level() {
+is_allowed_verf_level() {
local rc=0
local VRFLEVEL=$1
message "${MESSAGE_COLOR}Checking spell level ${VRFLEVEL}${DEFAULT_COLOR}"
@@ -335,7 +335,7 @@ function is_allowed_verf_level() {
## is not present in the hash list)
##
#--------------------------------------------------------------------
-function is_allowed_hash() {
+is_allowed_hash() {
local rc=0
local hash=$1
local HASHLEVEL=$2
@@ -369,7 +369,7 @@ function is_allowed_hash() {
## work with streams.
##
#---------------------------------------------------------------------
-function unpack_gpg() {
+unpack_gpg() {
debug "libgrimoire" "Running unpack_gpg -- $*"

local FILENAME="$( guess_filename "$SOURCE_CACHE/$1" )"
@@ -434,7 +434,7 @@ function unpack_gpg() {
## work with streams.
##
#---------------------------------------------------------------------
-function unpack_hash() {
+unpack_hash() {
debug "libgrimoire" "Running unpack_hash() on $1"

local FILENAME="$( guess_filename "$SOURCE_CACHE/$1" )"
@@ -493,7 +493,7 @@ function unpack_hash() {
## fails
##
#--------------------------------------------------------------------
-function hash_user_query() {
+hash_user_query() {
local rc=$1
local spell=$2
case "$rc" in
@@ -515,7 +515,7 @@ function hash_user_query() {
## Returns what query returns if it's called
##
#--------------------------------------------------------------------
-function unpack_file_user_query() {
+unpack_file_user_query() {
local rc=$1
case "$rc" in
0)
@@ -541,7 +541,7 @@ function unpack_file_user_query() {
## work with streams.
##
#---------------------------------------------------------------------
-function unpack_ignore() {
+unpack_ignore() {
debug "libgrimoire" "Running unpack_ignore() on $1"

REASON="$2"
@@ -575,7 +575,7 @@ ask_risky|ask_ignore) query "Abort?" "n" &&
return 1 || return 0 ;;
## work with streams.
##
#---------------------------------------------------------------------
-function unpack_missing() {
+unpack_missing() {
debug "libgrimoire" "Running unpack_missing() on $1"

message "${PROBLEM_COLOR}Missing check for source file $1!${DEFAULT_COLOR}"
@@ -602,7 +602,7 @@ function unpack_missing() {
## program on it. A wrapper around uncompress_unpack
##
#---------------------------------------------------------------------
-function uncompress_unpack_cache() {
+uncompress_unpack_cache() {
uncompress_unpack "$1" root cache same-permissions
}

@@ -617,7 +617,7 @@ function uncompress_unpack_cache() {
## untar'ing the file.
##
#---------------------------------------------------------------------
-function uncompress_unpack() {
+uncompress_unpack() {
debug "libgrimoire" "Running uncompress_unpack() on $@"

local basedir
@@ -648,7 +648,7 @@ function uncompress_unpack() {
## Interface to unpack a file without any verification.
##
#---------------------------------------------------------------------
-function real_unpack_file_simple() { uncompress_unpack "$@"; }
+real_unpack_file_simple() { uncompress_unpack "$@"; }


#---------------------------------------------------------------------
@@ -661,7 +661,7 @@ function real_unpack_file_simple() { uncompress_unpack
"$@"; }
## then the source cache.
##
#---------------------------------------------------------------------
-function locate_spell_file() {
+locate_spell_file() {
debug "libgrimoire" "Running locate_spell_file() $2 on $1"

# checks in any case
diff --git a/var/lib/sorcery/modules/liburl b/var/lib/sorcery/modules/liburl
index a4f26f9..e3c250a 100755
--- a/var/lib/sorcery/modules/liburl
+++ b/var/lib/sorcery/modules/liburl
@@ -99,7 +99,7 @@ fi
## like scribe and sorcery update will probably directly call url_download.
##
#---------------------------------------------------------------------
-function url_download_expand_sort() {
+url_download_expand_sort() {
$STD_DEBUG
local target=$1
local url_list=$2
@@ -152,7 +152,7 @@ function url_download_expand_sort() {
##
##
#---------------------------------------------------------------------
-function url_download() {
+url_download() {
$STD_DEBUG
local target=$1
local url_list=$2
@@ -208,7 +208,7 @@ function url_download() {
#---------------------------------------------------------------------
## @param urllist
#---------------------------------------------------------------------
-function url_get_valid_urls() {
+url_get_valid_urls() {
$STD_DEBUG
local upvar="$1"
local url_list="$2"
@@ -228,7 +228,7 @@ function url_get_valid_urls() {
##
## Frontend to expand urls into a nice list.
#---------------------------------------------------------------------
-function url_expand_urls() {
+url_expand_urls() {
$STD_DEBUG
local upvar="$1"
local url_list="$2"
@@ -245,7 +245,7 @@ function url_expand_urls() {
#---------------------------------------------------------------------
## @param urllist
#---------------------------------------------------------------------
-function url_sort_urls() {
+url_sort_urls() {
$STD_DEBUG
local upvar="$1"
local url_list="$2"
@@ -271,7 +271,7 @@ function url_sort_urls() {
## is preserved, although that group of urls may move as a whole in
## the list.
#---------------------------------------------------------------------
-function url_rank() {
+url_rank() {

local urlList sortedList urlCounter
local finalList url_speed
@@ -351,7 +351,7 @@ function url_rank() {
## a url_handler. Doing so elsewhere is bugworthy.
##
#---------------------------------------------------------------------
-function url_get_prefix() {
+url_get_prefix() {
$STD_DEBUG
local URL=$1
local URL_PREFIX=${URL/:\/\/*}
@@ -367,7 +367,7 @@ function url_get_prefix() {
## @param url prefix
## @stdout url sans prefix
#---------------------------------------------------------------------
-function url_strip_prefix() {
+url_strip_prefix() {
$STD_DEBUG
echo $1 | sed "s!^$2://!!"
}
@@ -383,7 +383,7 @@ function url_strip_prefix() {
##
## Get the download handler for this url
#---------------------------------------------------------------------
-function url_bucketize() {
+url_bucketize() {
$STD_DEBUG
url_generic_apifunc bucketize $1
}
@@ -395,7 +395,7 @@ function url_bucketize() {
## this is usually only called by dl handlers who know what url types
## they can handle, and thus, understand the return value.
#---------------------------------------------------------------------
-function url_crack() {
+url_crack() {
$STD_DEBUG
url_generic_apifunc crack "$@"
}
@@ -407,7 +407,7 @@ function url_crack() {
## Attempt to get more similar urls to the given one based on the
## sorcery mirrors files. Most url types simply expand to the input.
#---------------------------------------------------------------------
-function url_expand() {
+url_expand() {
$STD_DEBUG
url_generic_apifunc expand "$@"
}
@@ -418,7 +418,7 @@ function url_expand() {
## Verify the url, this usually means going out to the internet and
## somehow determining if the link is good.
#---------------------------------------------------------------------
-function url_verify() {
+url_verify() {
$STD_DEBUG
url_generic_apifunc verify "$@"
}
@@ -432,7 +432,7 @@ function url_verify() {
## true if a hostname could be found, returns false otherwise.
##
#---------------------------------------------------------------------
-function url_hostname() {
+url_hostname() {
$STD_DEBUG
url_generic_apifunc hostname $1
}
@@ -446,7 +446,7 @@ function url_hostname() {
## running netselect.
##
#---------------------------------------------------------------------
-function url_netselect() {
+url_netselect() {
$STD_DEBUG
url_generic_apifunc netselect "$@"
}
@@ -459,7 +459,7 @@ function url_netselect() {
## library, returns false otherwise.
##
#---------------------------------------------------------------------
-function url_is_valid() {
+url_is_valid() {
$STD_DEBUG
url_generic_apifunc is_valid $1
}
@@ -478,7 +478,7 @@ function url_is_valid() {
## is assumed to be the same.
##
#---------------------------------------------------------------------
-function url_generic_apifunc() {
+url_generic_apifunc() {
local tmp_func=$1
shift
local tmp_url=$1 tmp_prefix
diff --git a/var/lib/sorcery/modules/url_handlers/url_bzr
b/var/lib/sorcery/modules/url_handlers/url_bzr
index 660ee0d..e22c830 100755
--- a/var/lib/sorcery/modules/url_handlers/url_bzr
+++ b/var/lib/sorcery/modules/url_handlers/url_bzr
@@ -30,7 +30,7 @@
## @Global BZR_DIRECTORY
##
#---------------------------------------------------------------------
-function url_bzr_crack() {
+url_bzr_crack() {
URL=$(url_strip_prefix "$1" bzr)
BZR_ROOT=bzr://$(echo $URL | cut -d: -f1)
BZR_DIRECTORY=$(echo $URL | cut -d: -f2)
@@ -42,7 +42,7 @@ function url_bzr_crack() {
## echoes the download handler - bzr
##
#---------------------------------------------------------------------
-function url_bzr_bucketize() {
+url_bzr_bucketize() {
echo bzr
}

@@ -53,7 +53,7 @@ function url_bzr_bucketize() {
## OR if the url is an empty string.
##
#---------------------------------------------------------------------
-function url_bzr_verify() {
+url_bzr_verify() {
local URL BZR_ROOT item
url_bzr_crack $1
for item in URL BZR_ROOT; do
@@ -68,7 +68,7 @@ function url_bzr_verify() {
##
## Gets the hostname out of the url
#---------------------------------------------------------------------
-function url_bzr_hostname() {
+url_bzr_hostname() {
echo $1|sed 's:^.*//\([^/]*\).*$:\1:'
}

@@ -78,7 +78,7 @@ function url_bzr_hostname() {
## Gets a netselect type output for the url
##
#---------------------------------------------------------------------
-function url_bzr_netselect() {
+url_bzr_netselect() {
local tmp_hostname url_speed each

for each in "$@" ; do
diff --git a/var/lib/sorcery/modules/url_handlers/url_cvs
b/var/lib/sorcery/modules/url_handlers/url_cvs
index b8dd995..5cd0b9c 100755
--- a/var/lib/sorcery/modules/url_handlers/url_cvs
+++ b/var/lib/sorcery/modules/url_handlers/url_cvs
@@ -80,7 +80,7 @@
## @global CVS_TAG
##
#---------------------------------------------------------------------
-function url_cvs_crack() {
+url_cvs_crack() {

URL=`url_strip_prefix "$1" cvs`
CVS_ROOT=`echo $URL | sed "s#\(^[^/]*[^:]*\):.*#\1#"`
@@ -97,7 +97,7 @@ function url_cvs_crack() {
## Ensure that all the fields that should be parsed out from a url
## do indeed exist
#---------------------------------------------------------------------
-function url_cvs_is_valid() {
+url_cvs_is_valid() {
local URL CVS_ROOT CVS_MODULE CVS_TAG item
url_cvs_crack $1
for item in URL CVS_ROOT CVS_MODULE CVS_TAG; do
@@ -113,7 +113,7 @@ function url_cvs_is_valid() {
## Get the hostname of the url
##
#---------------------------------------------------------------------
-function url_cvs_hostname() {
+url_cvs_hostname() {
echo $1|sed 's/^[^@]*@\([^:]*\):.*$/\1/'
}

@@ -123,7 +123,7 @@ function url_cvs_hostname() {
## Gets a netselect type output for the url
##
#---------------------------------------------------------------------
-function url_cvs_netselect() {
+url_cvs_netselect() {
local tmp_hostname url_speed each

for each in $@ ; do
diff --git a/var/lib/sorcery/modules/url_handlers/url_default
b/var/lib/sorcery/modules/url_handlers/url_default
index 812cb46..e414676 100755
--- a/var/lib/sorcery/modules/url_handlers/url_default
+++ b/var/lib/sorcery/modules/url_handlers/url_default
@@ -16,7 +16,7 @@
## Outputs file as that is the dl handler for file:// urls
##
#---------------------------------------------------------------------
-function url_default_bucketize() {
+url_default_bucketize() {
url_get_prefix $1
}

@@ -26,7 +26,7 @@ function url_default_bucketize() {
## Outputs the url with the prefix removed
##
#---------------------------------------------------------------------
-function url_default_crack() {
+url_default_crack() {
local prefix=$(url_get_prefix $1)
[[ $prefix ]] || return 1
url_strip_prefix "$1" $prefix
@@ -35,7 +35,7 @@ function url_default_crack() {
#---------------------------------------------------------------------
##=item url_default_expand
#---------------------------------------------------------------------
-function url_default_expand() {
+url_default_expand() {
echo "$@"
}

@@ -46,7 +46,7 @@ function url_default_expand() {
## True if url_crack returns true
##
#---------------------------------------------------------------------
-function url_default_is_valid() {
+url_default_is_valid() {
url_crack $1 >/dev/null
}

@@ -56,7 +56,7 @@ function url_default_is_valid() {
## Always returns true
##
#---------------------------------------------------------------------
-function url_default_verify() {
+url_default_verify() {
true
}

@@ -66,7 +66,7 @@ function url_default_verify() {
## Outputs localhost
##
#---------------------------------------------------------------------
-function url_default_hostname() {
+url_default_hostname() {
echo localhost
}

@@ -76,7 +76,7 @@ function url_default_hostname() {
## Fake netselect return 0 for each url
##
#---------------------------------------------------------------------
-function url_default_netselect() {
+url_default_netselect() {
local each
for each in $@ ; do
echo "0 $each"
diff --git a/var/lib/sorcery/modules/url_handlers/url_dir
b/var/lib/sorcery/modules/url_handlers/url_dir
index 498aa31..5d699e8 100755
--- a/var/lib/sorcery/modules/url_handlers/url_dir
+++ b/var/lib/sorcery/modules/url_handlers/url_dir
@@ -42,7 +42,7 @@
## directory exists OR if the dir is an empty string.
##
#---------------------------------------------------------------------
-function url_dir_verify() {
+url_dir_verify() {

DIRNAME=`url_dir_crack $1`
if [ -n "$DIRNAME" ]; then
diff --git a/var/lib/sorcery/modules/url_handlers/url_file
b/var/lib/sorcery/modules/url_handlers/url_file
index aec1488..94fd747 100755
--- a/var/lib/sorcery/modules/url_handlers/url_file
+++ b/var/lib/sorcery/modules/url_handlers/url_file
@@ -21,7 +21,7 @@
## OR if the file is an empty string.
##
#---------------------------------------------------------------------
-function url_file_verify() {
+url_file_verify() {
FILENAME=`url_file_strip_prefix $1`
if [[ "$FILENAME" ]] ; then
[ -f "$FILENAME" ] &&
diff --git a/var/lib/sorcery/modules/url_handlers/url_git
b/var/lib/sorcery/modules/url_handlers/url_git
index a1ef161..47636e6 100755
--- a/var/lib/sorcery/modules/url_handlers/url_git
+++ b/var/lib/sorcery/modules/url_handlers/url_git
@@ -31,7 +31,7 @@
## @Global GIT_TAG
##
#---------------------------------------------------------------------
-function url_git_crack() {
+url_git_crack() {
URL=$(url_strip_prefix "$1" git)
GIT_ROOT=git://$(sed "s#\(^[^/]*[^:]*\):.*#\1#" <<< "$URL")
local GIT_DIRECTORY_TAG=$(sed "s#^[^/]*[^:]*\(.*\)#\1#" <<< "$URL")
@@ -47,7 +47,7 @@ function url_git_crack() {
## echoes the download handler - git
##
#---------------------------------------------------------------------
-function url_git_bucketize() {
+url_git_bucketize() {
echo git
}

@@ -58,7 +58,7 @@ function url_git_bucketize() {
## OR if the url is an empty string.
##
#---------------------------------------------------------------------
-function url_git_verify() {
+url_git_verify() {
local URL GIT_ROOT item
url_git_crack $1
for item in URL GIT_ROOT; do
@@ -73,7 +73,7 @@ function url_git_verify() {
##
## Gets the hostname out of the url
#---------------------------------------------------------------------
-function url_git_hostname() {
+url_git_hostname() {
echo $1|sed 's:^.*//\([^/]*\).*$:\1:'
}

@@ -83,7 +83,7 @@ function url_git_hostname() {
## Gets a netselect type output for the url
##
#---------------------------------------------------------------------
-function url_git_netselect() {
+url_git_netselect() {
local tmp_hostname url_speed each

for each in "$@" ; do
diff --git a/var/lib/sorcery/modules/url_handlers/url_git_http
b/var/lib/sorcery/modules/url_handlers/url_git_http
index e1d380a..27ddaa7 100755
--- a/var/lib/sorcery/modules/url_handlers/url_git_http
+++ b/var/lib/sorcery/modules/url_handlers/url_git_http
@@ -31,7 +31,7 @@
## @Global GIT_TAG
##
#---------------------------------------------------------------------
-function url_git_http_crack() {
+url_git_http_crack() {
URL=$(url_strip_prefix "$1" git_http)
GIT_ROOT=http://$(sed "s#\(^[^/]*[^:]*\):.*#\1#" <<< "$URL")
local GIT_DIRECTORY_TAG=$(sed "s#^[^/]*[^:]*\(.*\)#\1#" <<< "$URL")
@@ -46,7 +46,7 @@ function url_git_http_crack() {
## echoes the download handler - git
##
#---------------------------------------------------------------------
-function url_git_http_bucketize() {
+url_git_http_bucketize() {
echo git
}

@@ -57,7 +57,7 @@ function url_git_http_bucketize() {
## OR if the url is an empty string.
##
#---------------------------------------------------------------------
-function url_git_http_verify() {
+url_git_http_verify() {
local URL GIT_ROOT item
url_git_http_crack $1
for item in URL GIT_ROOT; do
@@ -72,7 +72,7 @@ function url_git_http_verify() {
##
## Gets the hostname out of the url
#---------------------------------------------------------------------
-function url_git_http_hostname() {
+url_git_http_hostname() {
echo $1|sed 's:^.*//\([^/]*\).*$:\1:'
}

@@ -82,7 +82,7 @@ function url_git_http_hostname() {
## Gets a netselect type output for the url
##
#---------------------------------------------------------------------
-function url_git_http_netselect() {
+url_git_http_netselect() {
local tmp_hostname url_speed each

for each in "$@" ; do
diff --git a/var/lib/sorcery/modules/url_handlers/url_git_local
b/var/lib/sorcery/modules/url_handlers/url_git_local
index 8523b8c..9b170e4 100644
--- a/var/lib/sorcery/modules/url_handlers/url_git_local
+++ b/var/lib/sorcery/modules/url_handlers/url_git_local
@@ -31,7 +31,7 @@
## @Global GIT_TAG
##
#---------------------------------------------------------------------
-function url_git_local_crack() {
+url_git_local_crack() {
URL=$(url_strip_prefix "$1" git_local)
GIT_ROOT=$(sed "s#\(^[^/]*[^:]*\):.*#\1#" <<< "$URL")
local GIT_DIRECTORY_TAG=$(sed "s#^[^/]*[^:]*\(.*\)#\1#" <<< "$URL")
@@ -46,7 +46,7 @@ function url_git_local_crack() {
## echoes the download handler - git
##
#---------------------------------------------------------------------
-function url_git_local_bucketize() {
+url_git_local_bucketize() {
echo git
}

@@ -57,7 +57,7 @@ function url_git_local_bucketize() {
## OR if the url is an empty string.
##
#---------------------------------------------------------------------
-function url_git_local_verify() {
+url_git_local_verify() {
local URL GIT_ROOT GIT_DIRECTORY GIT_TAG item
url_git_local_crack $1
for item in URL GIT_ROOT; do
@@ -72,7 +72,7 @@ function url_git_local_verify() {
##
## Gets the hostname out of the url
#---------------------------------------------------------------------
-function url_git_local_hostname() {
+url_git_local_hostname() {
echo $1|sed 's:^.*//\([^/]*\).*$:\1:'
}

diff --git a/var/lib/sorcery/modules/url_handlers/url_hg_http
b/var/lib/sorcery/modules/url_handlers/url_hg_http
index c70b2cc..caac2d6 100644
--- a/var/lib/sorcery/modules/url_handlers/url_hg_http
+++ b/var/lib/sorcery/modules/url_handlers/url_hg_http
@@ -31,7 +31,7 @@
## @Global HG_TAG
##
#---------------------------------------------------------------------
-function url_hg_http_crack() {
+url_hg_http_crack() {
URL=$(url_strip_prefix "$1" hg_http)
HG_ROOT=$(echo $URL | sed "s#\(^[^/]*[^:]*\):.*#\1#")
HG_ROOT=http://$HG_ROOT
@@ -47,7 +47,7 @@ function url_hg_http_crack() {
## echoes the download handler - hg
##
#---------------------------------------------------------------------
-function url_hg_http_bucketize() {
+url_hg_http_bucketize() {
echo hg
}

@@ -58,7 +58,7 @@ function url_hg_http_bucketize() {
## OR if the url is an empty string.
##
#---------------------------------------------------------------------
-function url_hg_http_verify() {
+url_hg_http_verify() {
local URL HG_ROOT item
url_hg_http_crack $1
for item in URL HG_ROOT; do
@@ -73,7 +73,7 @@ function url_hg_http_verify() {
##
## Gets the hostname out of the url
#---------------------------------------------------------------------
-function url_hg_http_hostname() {
+url_hg_http_hostname() {
echo $1|sed 's:^.*//\([^/]*\).*$:\1:'
}

@@ -83,7 +83,7 @@ function url_hg_http_hostname() {
## Gets a netselect type output for the url
##
#---------------------------------------------------------------------
-function url_hg_http_netselect() {
+url_hg_http_netselect() {
local tmp_hostname url_speed each

for each in "$@" ; do
diff --git a/var/lib/sorcery/modules/url_handlers/url_http
b/var/lib/sorcery/modules/url_handlers/url_http
index 61759e0..0f6ead4 100755
--- a/var/lib/sorcery/modules/url_handlers/url_http
+++ b/var/lib/sorcery/modules/url_handlers/url_http
@@ -26,13 +26,13 @@
## echoes the download handler - wget
##
#---------------------------------------------------------------------
-function url_http_bucketize() {
+url_http_bucketize() {
echo $HTTP_DL_HANDLER
}
-function url_ftp_bucketize() {
+url_ftp_bucketize() {
echo $HTTP_DL_HANDLER
}
-function url_https_bucketize() {
+url_https_bucketize() {
echo $HTTP_DL_HANDLER
}

@@ -43,7 +43,7 @@ function url_https_bucketize() {
## OR if the url is an empty string.
##
#---------------------------------------------------------------------
-function url_http_verify() {
+url_http_verify() {
local URL=$1
local hints="$2"
local check_certificate
@@ -70,7 +70,7 @@ function url_http_verify() {
## OR if the url is an empty string.
##
#---------------------------------------------------------------------
-function url_https_verify() {
+url_https_verify() {
url_http_verify "$@"
}

@@ -88,7 +88,7 @@ function url_https_verify() {
## @Implementation_note if the file is in the directory listing.
##
#---------------------------------------------------------------------
-function url_ftp_verify() {
+url_ftp_verify() {
local URL=$1

if [ -n "$URL" ]; then
@@ -114,13 +114,13 @@ function url_ftp_verify() {
##
## Gets the hostname out of the url
#---------------------------------------------------------------------
-function url_http_hostname() {
+url_http_hostname() {
echo $1|sed 's:^.*//\([^/]*\).*$:\1:'
}
-function url_https_hostname() {
+url_https_hostname() {
url_http_hostname $1
}
-function url_ftp_hostname() {
+url_ftp_hostname() {
url_http_hostname $1
}

@@ -131,13 +131,13 @@ function url_ftp_hostname() {
## we can take advantage of its multi-A record handling
##
#---------------------------------------------------------------------
-function url_http_netselect() {
+url_http_netselect() {
netselect -t 3 -s 1000 "$@" 2>/dev/null
}
-function url_https_netselect() {
+url_https_netselect() {
netselect -t 3 -s 1000 "$@" 2>/dev/null
}
-function url_ftp_netselect() {
+url_ftp_netselect() {
netselect -t 3 -s 1000 "$@" 2>/dev/null
}

@@ -150,7 +150,7 @@ function url_ftp_netselect() {
## @param a list of urls
## @stdout the expanded form of those urls
#-------------------------------------------------------------------------
-function url_http_expand() {
+url_http_expand() {
local A=$'\a'
local URL rep tgt my_hostname each
# put the requested url first
@@ -173,7 +173,7 @@ function url_http_expand() {
done
}

-function url_ftp_expand() {
+url_ftp_expand() {
url_http_expand "$@"
}
# note that there is no https_expand
diff --git a/var/lib/sorcery/modules/url_handlers/url_rsync
b/var/lib/sorcery/modules/url_handlers/url_rsync
index 7f071bc..20e9773 100755
--- a/var/lib/sorcery/modules/url_handlers/url_rsync
+++ b/var/lib/sorcery/modules/url_handlers/url_rsync
@@ -51,7 +51,7 @@
## Simply outputs the input.
##
#---------------------------------------------------------------------
-function url_rsync_crack() {
+url_rsync_crack() {
url_strip_prefix "$1" rsync
}

@@ -62,7 +62,7 @@ function url_rsync_crack() {
## Gets the hostname for this rsync type url
##
#---------------------------------------------------------------------
-function url_rsync_hostname() {
+url_rsync_hostname() {
echo $1|sed 's|^.*//\(.*\)::.*$|\1|'
}

@@ -73,7 +73,7 @@ function url_rsync_hostname() {
## are multiple A records
##
#---------------------------------------------------------------------
-function url_rsync_netselect() {
+url_rsync_netselect() {
netselect -s 1000 $@ 2>/dev/null
}

diff --git a/var/lib/sorcery/modules/url_handlers/url_smgl_tla
b/var/lib/sorcery/modules/url_handlers/url_smgl_tla
index b9bcb5b..fa26b55 100755
--- a/var/lib/sorcery/modules/url_handlers/url_smgl_tla
+++ b/var/lib/sorcery/modules/url_handlers/url_smgl_tla
@@ -48,7 +48,7 @@
##
## Outputs "tla".
#
-----------------------------------------------------------------------------
-function url_smgl_tla_bucketize() {
+url_smgl_tla_bucketize() {
echo tla
}

@@ -63,7 +63,7 @@ function url_smgl_tla_bucketize() {
## @global TLA_REVISION
##
#
-----------------------------------------------------------------------------
-function url_smgl_tla_crack() {
+url_smgl_tla_crack() {

URL=`url_strip_prefix "$1" smgl_tla`
TLA_LOCATION=`echo $URL|cut -d"%" -f1`
@@ -78,7 +78,7 @@ function url_smgl_tla_crack() {
## Verifies the specified tla url exists. Returns true for now...
##
#
----------------------------------------------------------------------------
-function url_smgl_tla_is_valid() {
+url_smgl_tla_is_valid() {
local URL TLA_LOCATION TLA_ARCHIVE TLA_REVISION item
for item in URL TLA_LOCATION TLA_ARCHIVE TLA_REVISION; do
[[ ${!item} ]] || return 1
@@ -92,7 +92,7 @@ function url_smgl_tla_is_valid() {
## Get the hostname of the url
##
#---------------------------------------------------------------------
-function url_smgl_tla_hostname() {
+url_smgl_tla_hostname() {
local P1=$(echo $1|cut -d"%" -f1)
echo $P1|sed 's#^.*://\([^/:]*\)[/:].*$#\1#'
}
@@ -103,7 +103,7 @@ function url_smgl_tla_hostname() {
## Gets a netselect type output for the url
##
#---------------------------------------------------------------------
-function url_smgl_tla_netselect() {
+url_smgl_tla_netselect() {
local tmp_hostname url_speed each

for each in $@ ; do
diff --git a/var/lib/sorcery/modules/url_handlers/url_svn
b/var/lib/sorcery/modules/url_handlers/url_svn
index af19970..480646f 100755
--- a/var/lib/sorcery/modules/url_handlers/url_svn
+++ b/var/lib/sorcery/modules/url_handlers/url_svn
@@ -62,7 +62,7 @@
## @Global SVN_TAG
##
#---------------------------------------------------------------------
-function url_svn_crack() {
+url_svn_crack() {

URL=`url_strip_prefix "$1" svn`
SVN_ROOT=`echo $URL | sed "s#\(^[^/]*[^:]*\):.*#\1#"`
@@ -84,7 +84,7 @@ function url_svn_crack() {
## Ensure that all the fields that should be parsed out from a url
## do indeed exist
#---------------------------------------------------------------------
-function url_svn_is_valid() {
+url_svn_is_valid() {
local URL SVN_ROOT SVN_MODULE SVN_TAG item
url_svn_crack $1
for item in URL SVN_ROOT SVN_MODULE SVN_TAG; do
@@ -100,7 +100,7 @@ function url_svn_is_valid() {
## Get the hostname of the url
##
#---------------------------------------------------------------------
-function url_svn_hostname() {
+url_svn_hostname() {
echo $1|sed 's#^svn://\([^/:]*\)[/:].*$#\1#'
}

@@ -110,7 +110,7 @@ function url_svn_hostname() {
## Gets a netselect type output for the url
##
#---------------------------------------------------------------------
-function url_svn_netselect() {
+url_svn_netselect() {
local tmp_hostname url_speed each

for each in "$@" ; do
diff --git a/var/lib/sorcery/modules/url_handlers/url_svn_http
b/var/lib/sorcery/modules/url_handlers/url_svn_http
index 2392146..24a196b 100644
--- a/var/lib/sorcery/modules/url_handlers/url_svn_http
+++ b/var/lib/sorcery/modules/url_handlers/url_svn_http
@@ -44,7 +44,7 @@
##
## Outputs svn as that is the dl handler for svn_http:// urls
#---------------------------------------------------------------------
-function url_svn_http_bucketize() {
+url_svn_http_bucketize() {
echo svn
}

@@ -59,7 +59,7 @@ function url_svn_http_bucketize() {
## @Global SVN_TAG
##
#---------------------------------------------------------------------
-function url_svn_http_crack() {
+url_svn_http_crack() {

URL=`url_strip_prefix "$1" svn_http`
SVN_ROOT=http://`echo $URL | sed "s#\(^[^/]*[^:]*\):.*#\1#"`
@@ -76,7 +76,7 @@ function url_svn_http_crack() {
## Ensure that all the fields that should be parsed out from a url
## do indeed exist
#---------------------------------------------------------------------
-function url_svn_http_is_valid() {
+url_svn_http_is_valid() {
url_svn_is_valid "$@"
}

@@ -86,7 +86,7 @@ function url_svn_http_is_valid() {
## Get the hostname of the url
##
#---------------------------------------------------------------------
-function url_svn_http_hostname() {
+url_svn_http_hostname() {
echo $1|sed 's#^svn_http://\([^/:]*\)[/:].*$#\1#'
}

@@ -96,7 +96,7 @@ function url_svn_http_hostname() {
## Gets a netselect type output for the url
##
#---------------------------------------------------------------------
-function url_svn_http_netselect() {
+url_svn_http_netselect() {
local tmp_hostname url_speed each

for each in "$@" ; do
diff --git a/var/lib/sorcery/modules/url_handlers/url_svn_https
b/var/lib/sorcery/modules/url_handlers/url_svn_https
index 7e71645..364376b 100644
--- a/var/lib/sorcery/modules/url_handlers/url_svn_https
+++ b/var/lib/sorcery/modules/url_handlers/url_svn_https
@@ -44,7 +44,7 @@
##
## Outputs svn as that is the dl handler for svn_https:// urls
#---------------------------------------------------------------------
-function url_svn_https_bucketize() {
+url_svn_https_bucketize() {
echo svn
}

@@ -59,7 +59,7 @@ function url_svn_https_bucketize() {
## @Global SVN_TAG
##
#---------------------------------------------------------------------
-function url_svn_https_crack() {
+url_svn_https_crack() {

URL=`url_strip_prefix "$1" svn_https`
SVN_ROOT=https://`echo $URL | sed "s#\(^[^/]*[^:]*\):.*#\1#"`
@@ -76,7 +76,7 @@ function url_svn_https_crack() {
## Ensure that all the fields that should be parsed out from a url
## do indeed exist
#---------------------------------------------------------------------
-function url_svn_https_is_valid() {
+url_svn_https_is_valid() {
url_svn_is_valid "$@"
}

@@ -86,7 +86,7 @@ function url_svn_https_is_valid() {
## Get the hostname of the url
##
#---------------------------------------------------------------------
-function url_svn_https_hostname() {
+url_svn_https_hostname() {
echo $1|sed 's#^svn_https://\([^/:]*\)[/:].*$#\1#'
}

@@ -96,7 +96,7 @@ function url_svn_https_hostname() {
## Gets a netselect type output for the url
##
#---------------------------------------------------------------------
-function url_svn_https_netselect() {
+url_svn_https_netselect() {
local tmp_hostname url_speed each

for each in "$@" ; do
diff --git a/var/lib/sorcery/modules/url_handlers/url_svn_ssh
b/var/lib/sorcery/modules/url_handlers/url_svn_ssh
index a2d2ec6..b1b6aa3 100644
--- a/var/lib/sorcery/modules/url_handlers/url_svn_ssh
+++ b/var/lib/sorcery/modules/url_handlers/url_svn_ssh
@@ -40,7 +40,7 @@
##
## Outputs svn as that is the dl handler for svn_http:// urls
#---------------------------------------------------------------------
-function url_svn_ssh_bucketize() {
+url_svn_ssh_bucketize() {
echo svn
}

@@ -55,7 +55,7 @@ function url_svn_ssh_bucketize() {
## @Global SVN_TAG
##
#---------------------------------------------------------------------
-function url_svn_ssh_crack() {
+url_svn_ssh_crack() {

URL=`url_strip_prefix "$1" svn_ssh`
SVN_ROOT=svn+ssh://`echo $URL | sed "s#\(^[^/]*[^:]*\):.*#\1#"`
@@ -72,7 +72,7 @@ function url_svn_ssh_crack() {
## Ensure that all the fields that should be parsed out from a url
## do indeed exist
#---------------------------------------------------------------------
-function url_svn_ssh_is_valid() {
+url_svn_ssh_is_valid() {
url_svn_is_valid "$@"
}

@@ -82,7 +82,7 @@ function url_svn_ssh_is_valid() {
## Get the hostname of the url
##
#---------------------------------------------------------------------
-function url_svn_ssh_hostname() {
+url_svn_ssh_hostname() {
echo $1|sed 's#^svn_ssh://\([^/:]*\)[/:].*$#\1#'
}

@@ -92,7 +92,7 @@ function url_svn_ssh_hostname() {
## Gets a netselect type output for the url
##
#---------------------------------------------------------------------
-function url_svn_ssh_netselect() {
+url_svn_ssh_netselect() {
local tmp_hostname url_speed each

for each in "$@" ; do



  • [SM-Commit] GIT changes to master sorcery by Ismael Luceno (a59d4780d6b3c02fc558d2c947f59433680473e1), Ismael Luceno, 02/06/2019

Archive powered by MHonArc 2.6.24.

Top of Page