Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (6e6d793a3929575752793e9cfc222a0e4443dc78)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Jaka Kranjc <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (6e6d793a3929575752793e9cfc222a0e4443dc78)
  • Date: Tue, 15 Jan 2008 09:18:23 -0600

GIT changes to master sorcery by Jaka Kranjc <lynxlynxlynx AT sourcemage.org>:

ChangeLog | 2
var/lib/sorcery/modules/libapi | 72 +++++++++---------
var/lib/sorcery/modules/libcast | 16 ++--
var/lib/sorcery/modules/libcodex | 120 +++++++++++++++---------------
var/lib/sorcery/modules/libcrossinstall | 6 -
var/lib/sorcery/modules/libdepends | 84 ++++++++++-----------
var/lib/sorcery/modules/libdepengine | 2
var/lib/sorcery/modules/libdispel | 4 -
var/lib/sorcery/modules/libdownload | 6 -
var/lib/sorcery/modules/libgcc2 | 10 +-
var/lib/sorcery/modules/libgpg | 4 -
var/lib/sorcery/modules/libgrimoire | 8 +-
var/lib/sorcery/modules/libhash | 48 ++++++------
var/lib/sorcery/modules/libinitd | 4 -
var/lib/sorcery/modules/liblock | 64 ++++++++--------
var/lib/sorcery/modules/libmedia | 24 +++---
var/lib/sorcery/modules/libmisc | 126
++++++++++++++++----------------
var/lib/sorcery/modules/libresurrect | 22 ++---
var/lib/sorcery/modules/libscreen | 8 +-
var/lib/sorcery/modules/libsecurity | 18 ++--
var/lib/sorcery/modules/libstage | 14 +--
var/lib/sorcery/modules/libsummon | 10 +-
var/lib/sorcery/modules/libtablet | 24 +++---
var/lib/sorcery/modules/libtrack | 22 ++---
var/lib/sorcery/modules/libtriggers | 14 +--
var/lib/sorcery/modules/libunpack | 94 +++++++++++------------
var/lib/sorcery/modules/liburl | 32 ++++----
27 files changed, 431 insertions(+), 427 deletions(-)

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

lib*: removed trailing whitespace

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

libdispel: added a transaction to reap_depends

diff --git a/ChangeLog b/ChangeLog
index ce58b6c..177ee72 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,8 @@
* build_api/common: accompanying changes to avoid double locking
* libressurect: accompanying changes to avoid double locking
* libsorcery: added a missin $ in pop_queue and locking to push_queue
+ * libdispel: added a transaction to reap_depends
+ * lib*: removed trailing whitespace

2007-12-31 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* liblock: avoid two possible tiny race conditions
diff --git a/var/lib/sorcery/modules/libapi b/var/lib/sorcery/modules/libapi
index 28fae2b..76a3099 100755
--- a/var/lib/sorcery/modules/libapi
+++ b/var/lib/sorcery/modules/libapi
@@ -23,15 +23,15 @@
# config_query_list (libmisc)
# config_query_option (libmisc)
# config_query_string (libmisc)
-# conflicts (libgrimoire)
-# default_sorcery_build (build_api/...)
+# conflicts (libgrimoire)
+# default_sorcery_build (build_api/...)
# default_sorcery_download (libsummon)
# default_sorcery_install (build_api/api2) (BUILD_API==2 only)
# default_sorcery_install_extras (build_api/api2) (BUILD_API==2 only)
# default_sorcery_post_build (build_api/api1) (BUILD_API==1 only)
# default_sorcery_post_install (build_api/api2) (BUILD_API==2 only)
# default_sorcery_transfer (build_api/api2) (BUILD_API==2 only)
-# default_sorcery_pre_build (build_api/common)
+# default_sorcery_pre_build (build_api/common)
# default_sorcery_pre_install (build_api/api2) (BUILD_API==2 only)
# depends (libdepends)
# devoke_installwatch (libtrack)
@@ -43,32 +43,32 @@
# guess_compressor (libunpack)
# handle_changed_config (libresurrect)
# is_depends_enabled (libstate)
-# installed_version (libgrimoire)
+# installed_version (libgrimoire)
# install_config_file (libresurrect)
# invoke_installwatch (libtrack)
# list_add (libmisc)
# list_find (libmisc)
# list_remove (libmisc)
-# message (libmisc)
-# mk_source_dir (libgrimoire)
-# note_config_file (libtrack)
-# on_cast (libtriggers)
-# on_dispel (libtriggers)
-# on_pre_cast (libtriggers)
-# on_pre_dispel (libtriggers)
+# message (libmisc)
+# mk_source_dir (libgrimoire)
+# note_config_file (libtrack)
+# on_cast (libtriggers)
+# on_dispel (libtriggers)
+# on_pre_cast (libtriggers)
+# on_pre_dispel (libtriggers)
# optional_depends (libdepends)
# persistent_add (libmisc)
# persistent_clear (libmisc)
# persistent_load (libmisc)
# persistent_remove (libmisc)
# persistent_save (libmisc)
-# prepare_install (libgrimoire)
+# prepare_install (libgrimoire)
# provider_ok (libstate)
-# query (libmisc)
+# query (libmisc)
# query_string (libmisc)
# runtime_depends (libdepends)
# rm_source_dir (libgrimoire)
-# sedit (libmisc)
+# sedit (libmisc)
# sub_depends (libdepends)
# show_depends (libdepends)
# spell_exiled (libstate)
@@ -112,7 +112,7 @@
#
# The following are set when a spell is loaded, you may use them, but
# not change them:
-# SCRIPT_DIRECTORY SECTION_DIRECTORY GRIMOIRE SPELL_DIRECTORY SECTION
+# SCRIPT_DIRECTORY SECTION_DIRECTORY GRIMOIRE SPELL_DIRECTORY SECTION
#
# global sorcery variables you should never use in a spell:
#
@@ -120,14 +120,14 @@
# must look at one of them, talk to your local sorcery lead about getting
# some sort of accessor functionality)
#
-# TOP_LEVEL DISPLAY PATH TMP_DIR SAFE_CAST
-# FAILED_LIST SUCCESS_LIST SPELL SPELLS spells MAKEFILE DEPS_ONLY
-# CAST_PASS download_log IW_LOG SOLO QUIET INSTALL_QUEUE
-# OVERRIDE_CFLAGS OVERRIDE_CXXFLAGS OVERRIDE_LDFLAGS NO_OPTIMIZATION_FLAGS
-# DOT_PROGRESS VOYEUR_OVERRIDE RECONFIGURE RECAST_DOWN COMPILE RECAST_UP
-# FORCE_DOWNLOAD SILENT FIX DEBUG SEPARATE BASE_URL
-# CAST_HASH BACK_CAST_HASH CANNOT_CAST_HASH uncommitted_hash NEW_DEPENDS
-# spell_depends DEPENDS_CONFIG UP_DEPENDS SPELL_CONFIG GRIMOIRE_DIR
+# TOP_LEVEL DISPLAY PATH TMP_DIR SAFE_CAST
+# FAILED_LIST SUCCESS_LIST SPELL SPELLS spells MAKEFILE DEPS_ONLY
+# CAST_PASS download_log IW_LOG SOLO QUIET INSTALL_QUEUE
+# OVERRIDE_CFLAGS OVERRIDE_CXXFLAGS OVERRIDE_LDFLAGS NO_OPTIMIZATION_FLAGS
+# DOT_PROGRESS VOYEUR_OVERRIDE RECONFIGURE RECAST_DOWN COMPILE RECAST_UP
+# FORCE_DOWNLOAD SILENT FIX DEBUG SEPARATE BASE_URL
+# CAST_HASH BACK_CAST_HASH CANNOT_CAST_HASH uncommitted_hash NEW_DEPENDS
+# spell_depends DEPENDS_CONFIG UP_DEPENDS SPELL_CONFIG GRIMOIRE_DIR
# BUILD_API VOYEUR_STDOUT VOYEUR_STDERR C_LOG C_FIFO INST_LOG MD5_LOG
# INSTALLWATCHFILE CAST_EXIT_STATUS
#
@@ -336,7 +336,7 @@ function default_sorcery_install () {
## @Type API
## @See <@function
var.lib.sorcery.modules.libgrimoire.html,real_default_sorcery_install_extras>
for more details.
## Only defined for BUILD_API==2
-## Installs configuration files and documentation.
+## Installs configuration files and documentation.
#---------------------------------------------------------------------
function default_sorcery_install_extras () {
debug "libapi" "default_sorcery_install_extras - $*"
@@ -390,7 +390,7 @@ function default_sorcery_transfer () {
function default_sorcery_pre_build () {
debug "libapi" "default_sorcery_pre_build - $*"
real_default_sorcery_pre_build "$@"
-}
+}

#---------------------------------------------------------------------
## @Type API
@@ -702,7 +702,7 @@ function message () {

#---------------------------------------------------------------------
## @Type API
-## @param directory name
+## @param directory name
## @param [size]
## @See <@function
var.lib.sorcery.modules.libgrimoire.html,real_mk_source_dir> for more details.
## Creates a tmpfs filesystem. By default, the size is 1GB.
@@ -894,7 +894,7 @@ function persistent_save () {
## variable to read
## returns:
## 1 if the var doesn't exist in the file
-## 2 if the tablet dir doesn't exist
+## 2 if the tablet dir doesn't exist
## 3 if the persistent config file doesn't exist
## 4 if the EXPORTS file doesn't exist
##
@@ -935,7 +935,7 @@ function provider_ok() {
## @param [directory to remove]
## @Globals SOURCE_DIRECTORY
## Removes the given directory or SOURCE_DIRECTORY if no argument is
-## given.
+## given.
## @See <@function
var.lib.sorcery.modules.libgrimoire.html,real_rm_source_dir> for more details.
##
#---------------------------------------------------------------------
@@ -947,7 +947,7 @@ function rm_source_dir() {
#---------------------------------------------------------------------
## @Type API
## @See <@function var.lib.sorcery.modules.libmisc.html,real_query> for more
details.
-## @param question
+## @param question
## @param default answer
##
## @return 0 on yes
@@ -955,7 +955,7 @@ function rm_source_dir() {
##
## Asks the user a yes/no question. First argument is the question to
## ask, second argument is the default answer. If a timeout occurs
-## before the question is answered, the given default answer is
+## before the question is answered, the given default answer is
## applied. Returns true or false based on the answer given.
##
#---------------------------------------------------------------------
@@ -1005,11 +1005,11 @@ function runtime_depends () {
## @param file
## @See <@function var.lib.sorcery.modules.libmisc.html,real_sedit> for more
details.
##
-## First argument is a sed command. Second argument is a file.
-## sedit performs the sed command on the file, modifiying the
-## original file. For example,
+## First argument is a sed command. Second argument is a file.
+## sedit performs the sed command on the file, modifiying the
+## original file. For example,
## <br>sedit "s/foo/bar/g" /tmp/somefile <br>
-## will replace all occurances of foo with bar in /tmp/somefile.
+## will replace all occurances of foo with bar in /tmp/somefile.
## This function is often used in spells to make changes to source
## files before compiling. See the sed man page for more information.
##
@@ -1123,7 +1123,7 @@ function uncompress () {

#---------------------------------------------------------------------
## @Type API
-## @param file to unpack
+## @param file to unpack
## @param md5sum
## @See <@function var.lib.sorcery.modules.libunpack.html,real_unpack> for
more details.
##
@@ -1159,7 +1159,7 @@ function unpack_file () {
## @See <@function
var.lib.sorcery.modules.libunpack.html,real_unpack_file_simple> for more
details.
##
## Interface to unpack a file without any verification.
-##
+##
#---------------------------------------------------------------------
function unpack_file_simple() {
debug "libapi" "$FUNCNAME - $*"
diff --git a/var/lib/sorcery/modules/libcast b/var/lib/sorcery/modules/libcast
index dbc2fdf..c0950ea 100755
--- a/var/lib/sorcery/modules/libcast
+++ b/var/lib/sorcery/modules/libcast
@@ -173,7 +173,7 @@ function query_custom_cflags() {
## expcetd $SCRIPT_DIRECTORY to be setable, any file one level deep in
## $SCRIPT_DIRECTORY/xinetd.d or $SCRIPT_DIRECTORY/init.d is assumed to be
## a service
-##
+##
## the following persistent variables may be set:
## XINETD_ENABLED XINETD_DISABLED
## INIT_ENABLED INIT_DISABLED
@@ -187,7 +187,7 @@ function query_custom_cflags() {
function query_services() {
local XINETD_SCRIPTS
local INIT_SCRIPTS
- local btmp xtmp itmp
+ local btmp xtmp itmp
local tmp retvar
local XINETD INIT BOTH found
local new_init_provides
@@ -403,7 +403,7 @@ function dual_service_query() {
elif list_find $service $IN ; then
init_default=n
fi
-
+
if [[ $init_default == y ]] && [[ $xinetd_default == y ]] ; then
default=both
elif [[ $xinetd_default == y ]] ; then
@@ -602,7 +602,7 @@ function acquire_cast_lock() {
"Solo${DEFAULT_COLOR} ${MESSAGE_COLOR}casts to complete..." \
"${DEFAULT_COLOR}"
lock_resources "solo" "cast"
- if test -f $SOLO && grep -q "^$SPELL$" $SOLO ||
+ if test -f $SOLO && grep -q "^$SPELL$" $SOLO ||
[ -f $SCRIPT_DIRECTORY/SOLO ]
then #SOLO spell
message -n "${MESSAGE_COLOR}Waiting for${DEFAULT_COLOR} ${SPELL_COLOR}" \
@@ -712,8 +712,8 @@ function show_downloading() {
debug "cast" "Started show_downloading() on $SPELL from $download_log"

# poke around waiting for downloading to start
- while ! ( [[ $download_log ]] &&
- [ -e "$download_log" ] )
+ while ! ( [[ $download_log ]] &&
+ [ -e "$download_log" ] )
do
sleep 1
done
@@ -723,14 +723,14 @@ function show_downloading() {
show_download_progress $download_log
sleep 1
done
-
+
show_download_progress $download_log
debug "libcast" "Out of show_downloading"
}

#---------------------------------------------------------------------
## Gets the filename of the download log file
-## @param Spell
+## @param Spell
## @Stdout file name
#---------------------------------------------------------------------
function get_spell_dl_log() {
diff --git a/var/lib/sorcery/modules/libcodex
b/var/lib/sorcery/modules/libcodex
index a7d8450..4ef82f9 100755
--- a/var/lib/sorcery/modules/libcodex
+++ b/var/lib/sorcery/modules/libcodex
@@ -8,8 +8,8 @@
## for listing the available grimiores, listing spells in a grimoire,
## listing sections in a grimoire, etc.
##
-## Note: Each of the functions that returns a spell, section, or
-## grimoire returns the full path. Functions that explicitly return
+## Note: Each of the functions that returns a spell, section, or
+## grimoire returns the full path. Functions that explicitly return
## a spell I<name> or section I<name> do not return the full
## path.
##
@@ -19,26 +19,26 @@
##
## <br>Grimoire Layout<br>
## The codex functions expect each grimoire to be a directory.
-## Each directory entry in a grimoire directory is considered
-## to be a section. All directory entries in a section are
+## Each directory entry in a grimoire directory is considered
+## to be a section. All directory entries in a section are
## considered to be a spell if they included an executable file
## named F<DETAILS>.
##
## <br>Multiple grimoires<br>
-##
+##
## Multiple grimoires are specified by setting entries in the
-## I<GRIMOIRE_DIR> array. For example, to set two additional
-## grimoires, you would put something like the following in
+## I<GRIMOIRE_DIR> array. For example, to set two additional
+## grimoires, you would put something like the following in
## your local SMGL grimoire file (F</etc/sorcery/local/grimoire>).
## <pre>
## GRIMOIRE_DIR[1]=/path/to/alternate/grimoire
## GRIMOIRE_DIR[2]=/path/to/other/alternate/grimoire
## </pre>
-## Grimoires are processed/searched in increasing order starting
+## Grimoires are processed/searched in increasing order starting
## at index 0. The SMGL configuration file provides the value for
## the default grimoire as I<GRIMOIRE_DIR[0]> or simply I<GRIMOIRE_DIR>.
##
-## The following two lines show how to reorder the default
+## The following two lines show how to reorder the default
## grimoire so that it's not searched first (in this example
## it will be searched second).
## <pre>
@@ -48,7 +48,7 @@
## There is no limitation on the number of grimoires that can be
## specified.
##
-## It is also possible to add and remove grimoires using the
+## It is also possible to add and remove grimoires using the
## codex_add_grimoire and codex_remove_grimoire functions.
##
## @Copyright
@@ -60,7 +60,7 @@

#####################GRIMOIRE FUNCTIONS###############################
#---------------------------------------------------------------------
-## @param grimoire
+## @param grimoire
## @param lookup (optional)
## @return 0 if grimoire can be canonicalized
##
@@ -148,11 +148,11 @@ function codex_find_grimoire() {
}

#---------------------------------------------------------------------
-## @param grimoire
-## @param [position]
+## @param grimoire
+## @param [position]
## @param [overwrite]
-##
-## Adds the specified grimoire to the list of grimoires. If no
+##
+## Adds the specified grimoire to the list of grimoires. If no
## position is given, the grimoire is added to the end of the list.
## Position is 0 based. Adding a grimoire to position 0 places it as
## the first grimoire in the list, and moves all other grimoires down
@@ -224,7 +224,7 @@ function codex_add_grimoire() {
touch $GRIMOIRE_LIST
tGRIMOIRE_LIST=`lock_start_transaction $GRIMOIRE_LIST`
rm $tGRIMOIRE_LIST
- for ((i=0; i<$GRIMOIRE_COUNT;i++)); do
+ for ((i=0; i<$GRIMOIRE_COUNT;i++)); do
echo GRIMOIRE_DIR[$i]=${GRIMOIRE_DIR[$i]} >> $tGRIMOIRE_LIST
done
lock_commit_transaction $GRIMOIRE_LIST
@@ -234,8 +234,8 @@ function codex_add_grimoire() {

#---------------------------------------------------------------------
## @param grimoire
-##
-## Removes the specified grimoire from the list of grimoires.
+##
+## Removes the specified grimoire from the list of grimoires.
##
#---------------------------------------------------------------------
function codex_remove_grimoire() {
@@ -248,21 +248,21 @@ function codex_remove_grimoire() {
tGRIMOIRE_LIST=`lock_start_transaction $GRIMOIRE_LIST`
touch $GRIMOIRE_LIST
cp $GRIMOIRE_LIST $GRIMOIRE_LIST_BACKUP
- rm -f $tGRIMOIRE_LIST
- touch $tGRIMOIRE_LIST
+ rm -f $tGRIMOIRE_LIST
+ touch $tGRIMOIRE_LIST

local CURRENT_GRIMOIRE
local GRIMOIRE_COUNT=0
for CURRENT_GRIMOIRE in $GRIMOIRES ; do
if [ "$CURRENT_GRIMOIRE" != "$GRIMOIRE_TO_DELETE" ]; then
echo GRIMOIRE_DIR[$GRIMOIRE_COUNT]=$CURRENT_GRIMOIRE >>
$tGRIMOIRE_LIST
- fi
+ fi
let GRIMOIRE_COUNT++
done

lock_commit_transaction $GRIMOIRE_LIST
unset GRIMOIRE_DIR
- . $GRIMOIRE_LIST
+ . $GRIMOIRE_LIST
}

#---------------------------------------------------------------------
@@ -280,10 +280,10 @@ function codex_remove_duplicates() {
local SEEN_GRIMOIRES=""
local ALREADY_SEEN=""

-
+
touch $GRIMOIRE_LIST
tGRIMOIRE_LIST=`lock_start_transaction $GRIMOIRE_LIST`
- rm -f $tGRIMOIRE_LIST
+ rm -f $tGRIMOIRE_LIST


for CURRENT_GRIMOIRE in $GRIMOIRES; do
@@ -301,13 +301,13 @@ function codex_remove_duplicates() {
lock_commit_transaction $GRIMOIRE_LIST

unset GRIMOIRE_DIR
- . $GRIMOIRE_LIST
+ . $GRIMOIRE_LIST

}

#---------------------------------------------------------------------
## @param grimoire name | grimoire dir ....
-##
+##
## Unsets the list of grimoires that existed before the call, then
## sets the lists of grimoires to be equal to the list of grimoires
## in the argument list. Grimoire names need not be canonicalized
@@ -336,7 +336,7 @@ function codex_set_grimoires() {

#---------------------------------------------------------------------
##
-## @Stdout all grimoires in the codex.
+## @Stdout all grimoires in the codex.
##
#---------------------------------------------------------------------
function codex_get_all_grimoires() {
@@ -355,15 +355,15 @@ function codex_get_all_grimoires() {
## @return 1 if section is not found
##
## @Stdout full path to the section
-## Given a valid section name, this function lists the full path to
-## the section. If an invalid section name is provided, nothing is
+## Given a valid section name, this function lists the full path to
+## the section. If an invalid section name is provided, nothing is
## listed.
##
#---------------------------------------------------------------------
function codex_find_section_by_name() {
local SECTION_NAME="$1"
local GRIMOIRE=''
-
+
for GRIMOIRE in `codex_get_all_grimoires`; do
if [ -d "$GRIMOIRE/$SECTION_NAME" ] ; then
debug "libcodex" "codex_find_section_by_name() - found section
$GRIMOIRE/$SECTION_NAME"
@@ -401,7 +401,7 @@ function codex_get_all_sections() {

#---------------------------------------------------------------------
## @param grimoire
-##
+##
## @Stdout Lists all section names in the specified grimoire.
## Relies on a wider-scope function <@function codex_get_sections>.
##
@@ -417,7 +417,7 @@ function codex_get_section_names() {
## @Stdout Lists all sections in the specified grimoire directories.
##
#---------------------------------------------------------------------
-function codex_get_sections() {
+function codex_get_sections() {
debug "libcodex" "codex_get_sections() - $@"
local GRIMOIRE

@@ -433,7 +433,7 @@ function codex_get_sections() {
# spellname /path/to/section
cut -d' ' -f2 "$GRIMOIRE/$SPELL_INDEX_FILE" | sort | uniq
shift
- done
+ done
}


@@ -452,7 +452,7 @@ function codex_is_directory_a_spell() {


#---------------------------------------------------------------------
-## @param spell
+## @param spell
## @param [spell ...]
##
## @return 0 if all the specified spells exist
@@ -480,16 +480,16 @@ function codex_does_spell_exist() {
#---------------------------------------------------------------------
## @param spell name
## @Stdout spell name
-## Given a valid spell name, this function lists the full path to the
+## Given a valid spell name, this function lists the full path to the
## spell. If an invalid spell name is provided, nothing is listed.
##
#---------------------------------------------------------------------
function codex_find_spell_by_name() {

debug "libcodex" "codex_find_spell_by_name - $*"
-
+
codex_cache_spell_lookup $1 `codex_get_all_grimoires`
-
+
}

#---------------------------------------------------------------------
@@ -517,10 +517,10 @@ function codex_get_spells_in_section() {
#---------------------------------------------------------------------
## @param path/section
##
-## @Stdout spells
-## Lists all spell names in the specified section. Nothing is listed
+## @Stdout spells
+## Lists all spell names in the specified section. Nothing is listed
## if the section doesn't include any spells.
-##
+##
#---------------------------------------------------------------------
function codex_get_spell_names() {
codex_get_spells_in_section "$1" | get_basenames
@@ -531,11 +531,11 @@ function codex_get_spell_names() {
## @param grimoire-pathes (optional)
##
## @Stdout spells
-## Lists all spells in all grimoires or only from the specified
-## grimoires. Nothing is listed if no spells exist in any of grimoires.
+## Lists all spells in all grimoires or only from the specified
+## grimoires. Nothing is listed if no spells exist in any of grimoires.
##
##
-## NOTE: This should be fixed so only the first of duplicate spells
+## NOTE: This should be fixed so only the first of duplicate spells
## are listed.
##
#---------------------------------------------------------------------
@@ -550,7 +550,7 @@ function codex_get_all_spells() {
## @param spell name
##
## @Stdout spell name
-## Lists the section of the given spell name. Nothing is listed if
+## Lists the section of the given spell name. Nothing is listed if
## there are no spells with the given name.
##
#---------------------------------------------------------------------
@@ -575,9 +575,9 @@ function codex_get_spell_section_name() {


#---------------------------------------------------------------------
-##
+##
## @Globals GRIMOIRE SECTION SECTION_DIRECTORY SPELL SPELL_DIRECTORY
SCRIPT_DIRECTORY SPELL_DESCRIPTION VERSION SHORT UPDATED SOURCE WEB_SITE
ENTERRED MAINTAINER MD5 LICENSE
-## Unets all these global variables.
+## Unets all these global variables.
##
#---------------------------------------------------------------------
function codex_clear_current_spell() {
@@ -590,8 +590,8 @@ function codex_clear_current_spell() {
#---------------------------------------------------------------------
## @param spell directory
## @Globals All vars set in a spell
-## Sets the GRIMOIRE, SECTION, SECTION_DIRECTORY, SPELL_DIRECTORY,
-## SCRIPT_DIRECTORY, and SPELL_DESCRIPTION global variables for the
+## Sets the GRIMOIRE, SECTION, SECTION_DIRECTORY, SPELL_DIRECTORY,
+## SCRIPT_DIRECTORY, and SPELL_DESCRIPTION global variables for the
## given spell directory.
##
## Assumes the directory passed in is a valid spell directory.
@@ -604,7 +604,7 @@ function codex_set_current_spell() {
codex_clear_current_spell

codex_get_spell_paths $1
-
+
if [ -f $SPELL_CONFIG ]; then
. $SPELL_CONFIG > /dev/null 2> /dev/null
fi
@@ -674,10 +674,10 @@ function codex_get_spell_paths() {

#---------------------------------------------------------------------
## @param spell name
-## Sets the GRIMOIRE, SECTION, SECTION_DIRECTORY, SPELL_DIRECTORY,
-## SCRIPT_DIRECTORY, and SPELL_DESCRIPTION global variables for the
+## Sets the GRIMOIRE, SECTION, SECTION_DIRECTORY, SPELL_DIRECTORY,
+## SCRIPT_DIRECTORY, and SPELL_DESCRIPTION global variables for the
## given spell name.
-##
+##
## @return 1 if the given name is not a spell.
##
#---------------------------------------------------------------------
@@ -693,7 +693,7 @@ function codex_set_current_spell_by_name() {
##############################CACHE FUNCTIONS#########################
#---------------------------------------------------------------------
## @param spell name
-## @param grimoire-path
+## @param grimoire-path
## @param [grimoire-path ...]
## @return 0 Spell found
## @return 1 Spell not found
@@ -803,7 +803,7 @@ function codex_create_in_memory_cache_all() {
###########################MISC FUNCTIONS#############################

#---------------------------------------------------------------------
-## @param grimoire-path
+## @param grimoire-path
## @param file-name
##
## @Stdout file names
@@ -820,14 +820,14 @@ function codex_find_in_grimoire () {
## Lists all providers in grimoire in the form of "provides spell"
## for instance: <br>
## shell /home/martin/p4/grimoire/shell-term-fm/sash
-##
+##
#---------------------------------------------------------------------
function codex_list_provides () {
grimoire=$1

for file in $(codex_find_in_grimoire $grimoire "PROVIDES"); do
spell=$(dirname $file)
- for provides in $(gawk '{if (/provides/) { print $2 }
+ for provides in $(gawk '{if (/provides/) { print $2 }
else { print $1 }}' $file); do
echo "$provides $spell"
done
@@ -837,7 +837,7 @@ function codex_list_provides () {
#---------------------------------------------------------------------
## @param grimoire-path
## Creates keyword index
-##
+##
#---------------------------------------------------------------------
function codex_create_keyword_cache () { (
grimoire=$1
@@ -857,11 +857,11 @@ function codex_create_keyword_cache () { (
#---------------------------------------------------------------------
function codex_does_service_exist()
{
- local SERVICE="$@"
+ local SERVICE="$@"
for GRIMOIRE in $(codex_get_all_grimoires); do
grep -qE '^'$SERVICE' ' "$GRIMOIRE/$PROVIDE_INDEX_FILE" && return 0
done
-}
+}


#---------------------------------------------------------------------
@@ -890,7 +890,7 @@ function codex_find_spell_or_section_by_name() {

#---------------------------------------------------------------------
## @param spell directory
-## @Stdout spell description
+## @Stdout spell description
## Echos the long description of the given spell. Returns an
## empty string if the directory is not a valid spell.
##
diff --git a/var/lib/sorcery/modules/libcrossinstall
b/var/lib/sorcery/modules/libcrossinstall
index cff02cb..2c3f179 100755
--- a/var/lib/sorcery/modules/libcrossinstall
+++ b/var/lib/sorcery/modules/libcrossinstall
@@ -3,7 +3,7 @@
## Library for doing install_root stuff. It is home to menu's for
## install_root and related variables. Future install_root specific
## and cross install related code might live here.
-## @Copyright Copyright (C) 2004 The Source Mage Team
+## @Copyright Copyright (C) 2004 The Source Mage Team
## @Note The description may be wrong.
#--------------------------------------------------------------------

@@ -65,7 +65,7 @@ function set_install_cache_menu() {
then
INSTALL_CACHE=${NEW_INSTALL_CACHE%/}
remove_config $LOCAL_CONFIG "INSTALL_CACHE"
- modify_config $LOCAL_ROOTS_CONFIG "INSTALL_CACHE" "$INSTALL_CACHE"
+ modify_config $LOCAL_ROOTS_CONFIG "INSTALL_CACHE" "$INSTALL_CACHE"
fi
}

@@ -85,7 +85,7 @@ function set_install_root_menu() {
then
INSTALL_ROOT=${NEW_INSTALL_ROOT%/}
remove_config $LOCAL_CONFIG "INSTALL_ROOT"
- modify_config $LOCAL_ROOTS_CONFIG "INSTALL_ROOT" "$INSTALL_ROOT"
+ modify_config $LOCAL_ROOTS_CONFIG "INSTALL_ROOT" "$INSTALL_ROOT"
fi
}

diff --git a/var/lib/sorcery/modules/libdepends
b/var/lib/sorcery/modules/libdepends
index a631e5d..d0e11b6 100755
--- a/var/lib/sorcery/modules/libdepends
+++ b/var/lib/sorcery/modules/libdepends
@@ -56,9 +56,9 @@
# SPELL: this is actually locally defined somewhere up the call stack
# but from most function's point of view it should be there...
# COMPILE: set in cast. It means that the main spells should be recompiled
-# RECONFIGURE: set in cast. I means that the info in the state depends
should
+# RECONFIGURE: set in cast. I means that the info in the state depends should
# be disregarded and replaced.
-# PRETEND_NOT_INSTALLED: set here. It is a list of spells that are to be
+# PRETEND_NOT_INSTALLED: set here. It is a list of spells that are to be
# recompiled, so they should not be treated as installed.
# CAST_HASH: The name of the hast table to put spells and dependencies
# that are to be cast (only used in this lib)
@@ -76,12 +76,12 @@
## @param Spell to prepare
## @Globals SCRIPT_DIRECTORY
#---------------------------------------------------------------------
-function run_prepare()
+function run_prepare()
{
local SPELL=$1

debug "cast" "run_prepare() - SPELL = $SPELL SCRIPT_DIRECTORY =
$SCRIPT_DIRECTORY"
-
+
depends_message "${SPELL}" "preparing environment..."

# these are here so you can source section/grimoire level scripts in
@@ -135,14 +135,14 @@ function run_configure() {
## Run a spell's DEPENDS if it exists
## @param Spell
#---------------------------------------------------------------------
-function run_depends() {
+function run_depends() {
local SPELL=$1
debug "cast" "run_depends() - SCRIPT_DIRECTORY = $SCRIPT_DIRECTORY"

function run_depends_msg() {
depends_message "${SPELL}" "checking dependencies..."
}
-
+
local PROTECT_SORCERY=yes
run_spell_file DEPENDS depends run_depends_msg
rc=$?
@@ -368,8 +368,8 @@ 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()
-{
+function compute_uninstalled_depends()
+{

# $1=table to place spells in
# $2=table to put problem spells in, $* = root spells
@@ -386,10 +386,10 @@ function compute_uninstalled_depends()
PRETEND_NOT_INSTALLED=" $@ "

local _idx
-
- # All specified spells are assumed to be not installed, or else -c and -r
+
+ # All specified spells are assumed to be not installed, or else -c and -r
# would have to be specified all the time.
-
+
for (( _idx=0 ; _idx<${#spells[*]} ; _idx++ )) ; do
if [[ ! `hash_get depends_looked_at ${spells[$_idx]}` ]]; then
if ! private_run_depends ${spells[$_idx]} ; then
@@ -440,14 +440,14 @@ function private_run_depends()
local base_deps
base_deps=$(search_depends_status $DEPENDS_STATUS basesystem|cut -f2 -d:)

-
+
# We only need to run the stuff if we are going to be casting.
# It only needs to be added to the casting hash table if we are
# really casting it
if private_should_cast $SPELL ; then

# this cant go in private_should_cast because then the dependee wont
- # have a chance at being fixed, ideally we should check in
+ # have a chance at being fixed, ideally we should check in
# depends/optional_depends and fail there
if spell_exiled $1; then
depends_message "${SPELL}" "is exiled and will not be cast."
@@ -467,8 +467,8 @@ function private_run_depends()
run_details &&
run_configure $SPELL &&
run_other $SPELL &&
- run_depends $SPELL &&
- run_up_triggers $SPELL &&
+ run_depends $SPELL &&
+ run_up_triggers $SPELL &&
run_our_sub_depends $SPELL &&

# possibly recast things that depend on us if option is set (-B)
@@ -489,7 +489,7 @@ function private_run_depends()
# has already been processed, so we must process them on their behalf
# this must be done after everything else!
run_other_sub_depends "$SPELL" || return 1
- else
+ else
depends_message "${SPELL}" "No work to do."
hash_put "depends_looked_at" "$SPELL" "ignore"
fi
@@ -535,7 +535,7 @@ function private_should_cast()
# returns success if want to cast
want_lazy_update $1 && return 0 || return 1
fi
-
+
# we must need to install this as we know nothing else about it
return 0
}
@@ -889,7 +889,7 @@ function work_depends_provider()
else
depends_message "$SPELL" "has $article $query_term on some" "${1}."
fi
-
+
local CANDIDATES=$( find_providers $1)
if [[ ! $CANDIDATES ]] ; then
message "${PROBLEM_COLOR}No providers of${DEFAULT_COLOR}" \
@@ -1001,7 +1001,7 @@ function work_optional_depends_provider()
else
depends_message "${SPELL}" "has $article $query_term on some" "${1}."
fi
-
+
local CANDIDATES=$( find_providers $1)
# if not reconfiguring check if theres already an answer in DEPENDS_STATUS
if [[ ! $RECONFIGURE ]]; then
@@ -1043,7 +1043,7 @@ function work_optional_depends_provider()
tmp=${status[0]}
if [[ ${status[2]} == on ]] ; then
# if the user said "on" use the default rather than none
- # unless theres something wrong with the provider they chose
+ # unless theres something wrong with the provider they chose
# in which case fall back to none
[[ $tmp ]] && echo "$CANDIDATES" | grep -x -q "$tmp" &&
default=$tmp || default=none
@@ -1095,18 +1095,18 @@ function work_optional_depends_spell()
local query_term=$3
local database_term=$4
shift 4
-
+
# if $1 optionally depends on something exiled we always say no
- if spell_exiled $1 ; then
+ if spell_exiled $1 ; then
depends_message "${1}" "has been exiled! not using as $article
$query_term"
hash_put $CANNOT_CAST_HASH "$1" "Exiled"
private_common_depends "$1" "off" "$database_term" "$2" "$3"
return 0
fi
-
-
+
+
if [[ ! $RECONFIGURE ]] ; then
- # See if there are preferences already in DEPENDS_STATUS, but only if
+ # See if there are preferences already in DEPENDS_STATUS, but only if
# not reconfiguring...
# example: icewm:imlib:off:optional:--with-imlib:--with-xpm
local status=()
@@ -1180,10 +1180,10 @@ function work_optional_depends_spell()
[[ $default == off ]] && stuff=n || stuff=y

if spell_ok $1 ; then
- query "Do you want to use ${SPELL_COLOR}$1${DEFAULT_COLOR}?" "$stuff"
&&
+ query "Do you want to use ${SPELL_COLOR}$1${DEFAULT_COLOR}?" "$stuff" &&
install="on"
else
- query "Do you want to cast ${SPELL_COLOR}$1${DEFAULT_COLOR}?" "$stuff"
&&
+ query "Do you want to cast ${SPELL_COLOR}$1${DEFAULT_COLOR}?" "$stuff" &&
install="on"
fi

@@ -1229,7 +1229,7 @@ function select_provider()
for each in $@; do
char=${stuff[$i]}
hash_put CHAR_TO_SPELL $char $each
-
+
[[ $each == $default ]] && default_char=$char
if spell_ok $each ; then
message
"\t${DEFAULT_COLOR}($char)\t${SPELL_COLOR}$each${DEFAULT_COLOR}\t (installed)"
@@ -1281,7 +1281,7 @@ function private_up_trigger() {

# afk 6-7-06 Im not sure this line is correct, it seems to only
# make a circular depends, instead we want $TARGET to depend on $SPELL
- echo " ${NEW_DEPENDS[@]} " | grep -q " $TARGET " ||
+ echo " ${NEW_DEPENDS[@]} " | grep -q " $TARGET " ||
NEW_DEPENDS=( ${NEW_DEPENDS[*]} $spell)

triggerees=( ${triggerees[*]} $TARGET )
@@ -1377,7 +1377,7 @@ function real_force_depends() {
## all the depends callbacks eventually bottom out here
## if a spell depends or doesnt depend on some other spell
## @param Spell
-## @param on/off
+## @param on/off
#---------------------------------------------------------------------
function private_common_depends()
{
@@ -1389,13 +1389,13 @@ function private_common_depends()
# ${1%(*} = spell name (strips potential provider name)
local spell_name=${1%(*}
case $3 in
- runtime|suggest)
+ runtime|suggest)
NEW_RUNTIME_DEPENDS=( ${NEW_RUNTIME_DEPENDS[*]} $spell_name ) ;;
*) NEW_DEPENDS=( ${NEW_DEPENDS[*]} $spell_name ) ;;
esac
fi
-
-
+
+
return 0
}

@@ -1440,7 +1440,7 @@ function private_add_triggerees() {

for ACTION in cast_self check_self dispel_self run_script; do
for TARGET in $(get_triggerees $SPELL on_cast $ACTION); do
- spell_ok $TARGET || continue
+ spell_ok $TARGET || continue
if [[ $ACTION == run_script ]] ; then
iterate private_add_triggerees_sub2 $'\n' \
"$(get_run_script_triggers $SPELL on_cast $TARGET)"
@@ -1454,7 +1454,7 @@ function private_add_triggerees() {


#---------------------------------------------------------------------
-## Adds the dependency to the hastable
+## Adds the dependency to the hastable
#---------------------------------------------------------------------
function private_add_depends()
{
@@ -1474,7 +1474,7 @@ function private_add_depends()
fi

spells=( ${spells[*]} ${NEW_DEPENDS[*]}
- ${NEW_SUB_DEPENDEES[*]}
+ ${NEW_SUB_DEPENDEES[*]}
${NEW_RUNTIME_DEPENDS[*]} )

RUNTIME_DEPENDS=( ${RUNTIME_DEPENDS[*]} ${NEW_RUNTIME_DEPENDS[*]} )
@@ -1542,14 +1542,14 @@ function private_remove_dependees()

#---------------------------------------------------------------------
## Sets a spell's aux. config info.
-## @Globals SPELL
+## @Globals SPELL
#---------------------------------------------------------------------
-function run_spell_config()
+function run_spell_config()
{

SPELL_CONFIG=$DEPENDS_CONFIG/$SPELL
- debug "libdepends" "run_spell_config() - DEPENDS_CONFIG=$DEPENDS_CONFIG
SPELL=$SPELL, SPELL_CONFIG=$SPELL_CONFIG DEPENDS_STATUS=$DEPENDS_STATUS"
-
+ debug "libdepends" "run_spell_config() - DEPENDS_CONFIG=$DEPENDS_CONFIG
SPELL=$SPELL, SPELL_CONFIG=$SPELL_CONFIG DEPENDS_STATUS=$DEPENDS_STATUS"
+
if [ -x $SPELL_CONFIG ]; then
debug "libdepends" "run_spell_config() - found $SPELL_CONFIG"
. $SPELL_CONFIG
@@ -1562,7 +1562,7 @@ function run_spell_config()
## @Param depth (optional)
## @Param fast -- if set only show spells, not full depends db entries
#---------------------------------------------------------------------
-function real_show_up_depends()
+function real_show_up_depends()
{
local i=0
local MAX_DEPTH=$2
@@ -1588,7 +1588,7 @@ function real_show_up_depends()
show_up_depends_sub "$1"|while read line; do
grep "$line" "$DEPENDS_STATUS"
done
- else
+ else
show_up_depends_sub "$1"|cut -f1 -d:
fi|sort|uniq
hash_reset foo
diff --git a/var/lib/sorcery/modules/libdepengine
b/var/lib/sorcery/modules/libdepengine
index 3d240a5..c7a7571 100755
--- a/var/lib/sorcery/modules/libdepengine
+++ b/var/lib/sorcery/modules/libdepengine
@@ -126,7 +126,7 @@ function depengine_cast_engine() {
# despite the fact that we failed
execute_triggers $spell 1
fi
-
+
dpgn_set_spell_color $spell black:$rc

return $rc
diff --git a/var/lib/sorcery/modules/libdispel
b/var/lib/sorcery/modules/libdispel
index ea078cc..704c092 100755
--- a/var/lib/sorcery/modules/libdispel
+++ b/var/lib/sorcery/modules/libdispel
@@ -81,7 +81,9 @@ function reap_depends() {
# save the old depends data as abandoned stuff so its seen later on
# recasts as the default
mkdir -p $ABANDONED_DEPENDS
- search_depends_status $DEPENDS_STATUS $SPELL > $ABANDONED_DEPENDS/$SPELL
+ t_file=$(lock_start_transaction "$ABANDONED_DEPENDS/$SPELL")
+ search_depends_status $DEPENDS_STATUS $SPELL > $t_file
+ lock_commit_transaction "$ABANDONED_DEPENDS/$SPELL"

# This conditional is here because the iso team wants to be able to
# save dependencies after dispel (bug 8109), average users are expected
diff --git a/var/lib/sorcery/modules/libdownload
b/var/lib/sorcery/modules/libdownload
index 953ff06..7c721ae 100755
--- a/var/lib/sorcery/modules/libdownload
+++ b/var/lib/sorcery/modules/libdownload
@@ -82,7 +82,7 @@ function dl_get_bucket() {
message "$handler is not a valid handler, this is probably a sorcery bug"
return 255
fi
-
+
dl_${handler}_get "$target" "$url_list" "$hints" "$dl_target" "$dl_type"
rc=$?
if [[ $rc == 0 ]] ; then
@@ -95,7 +95,7 @@ function dl_get_bucket() {

function dl_command_check() {
local cmd
- smgl_which $1 cmd
+ smgl_which $1 cmd
if ! [[ $cmd ]] || ! test -x $cmd ; then
message "${PROBLEM_COLOR}$cmd is not installed, please cast it..." \
"${DEFAULT_COLOR}"
@@ -134,7 +134,7 @@ function dl_connect() {
message "Try netconf if you use ethernet (with dsl), or see man pppd"
message "for dialup.\n"
message "If you still have trouble and have another way of getting"
- message "online, please come by #sourcemage on irc.freenode.net and"
+ message "online, please come by #sourcemage on irc.freenode.net and"
message "someone will help you."
return 1
fi
diff --git a/var/lib/sorcery/modules/libgcc2 b/var/lib/sorcery/modules/libgcc2
index 599911b..41f7685 100755
--- a/var/lib/sorcery/modules/libgcc2
+++ b/var/lib/sorcery/modules/libgcc2
@@ -1,7 +1,7 @@
#!/bin/bash
#---------------------------------------------------------------------
##
-## @Synopsis Set of functions for dealing with the problem (hopefully a
+## @Synopsis Set of functions for dealing with the problem (hopefully a
## @Synopsis temporary problem) of having to use both the gcc2 and gcc3
## @Synopsis compilers.
##
@@ -12,13 +12,13 @@
## - The gcc spell will have gcc2 as a dependency.
## - Spells that will only compile with gcc3 will have a USEGCC2 file
## in the spell directory.
-## - Sorcery will test for the existance of the USEGCC2 flag in a
+## - Sorcery will test for the existance of the USEGCC2 flag in a
## spell's directory. If it's there, it will alter the environment
## so that gcc2 is used for building the spell.
## </pre>
##
-## @Implementation These functions were added to allow the use of both the
gcc2 and
-## @Implementation gcc3 compiler at the same time within sorcery. The code
can be
+## @Implementation These functions were added to allow the use of both the
gcc2 and
+## @Implementation gcc3 compiler at the same time within sorcery. The code
can be
## @Implementation removed once only one compiler is supported.
##
##
@@ -70,7 +70,7 @@ function gcc2_add_paths() {
#---------------------------------------------------------------------
##
## Determines if gcc2 should be used for a spell. If so, it alters
-## the environment so that gcc2 is used for compilation.
+## the environment so that gcc2 is used for compilation.
##
#---------------------------------------------------------------------
function invoke_gcc2() {
diff --git a/var/lib/sorcery/modules/libgpg b/var/lib/sorcery/modules/libgpg
index 2056470..1e9138e 100755
--- a/var/lib/sorcery/modules/libgpg
+++ b/var/lib/sorcery/modules/libgpg
@@ -247,7 +247,7 @@ function gpg_verify_common() {
local SOURCE=$(basename $FILENAME)

local SIG_FILE=${SOURCE}.${GPG_SIG_EXT}
- pushd $TMP_DIR &>/dev/null ||
+ pushd $TMP_DIR &>/dev/null ||
{ message "Failed to cd to $TMP_DIR!!"; return 2;}
if test -z "$SIGNATURE" ; then
local SIG_URL=$SOURCE_URL/$SIG_FILE
@@ -429,7 +429,7 @@ function grimoire_tree_user_query() {
esac
return 1
}
-
+
#---------------------------------------------------------------------
## This software is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
diff --git a/var/lib/sorcery/modules/libgrimoire
b/var/lib/sorcery/modules/libgrimoire
index e17d365..ab3a635 100755
--- a/var/lib/sorcery/modules/libgrimoire
+++ b/var/lib/sorcery/modules/libgrimoire
@@ -17,7 +17,7 @@

#---------------------------------------------------------------------
## @Type API
-## @param directory name
+## @param directory name
## @param [size]
## Creates a tmpfs filesystem. By default, the size is 1GB.
## The caller may optionally supply a size argument.
@@ -162,10 +162,10 @@ function make() {

#---------------------------------------------------------------------
## Install files in a spells "desktop" subdirectory for .desktop
-## @param Spell
+## @param Spell
## @Stdout file name
#---------------------------------------------------------------------
-function install_desktop_files() {
+function install_desktop_files() {
debug "libgrimoire" "Running install_desktop_files() on $SPELL"
local each file
local target_dir="/usr/share/applications"
@@ -186,7 +186,7 @@ function install_desktop_files() {
#---------------------------------------------------------------------
## @Type API
## @param spell
-##
+##
## Returns the current version of the given spell
##
#---------------------------------------------------------------------
diff --git a/var/lib/sorcery/modules/libhash b/var/lib/sorcery/modules/libhash
index 2b5c35e..8fabad7 100755
--- a/var/lib/sorcery/modules/libhash
+++ b/var/lib/sorcery/modules/libhash
@@ -9,7 +9,7 @@
## values into fields of a table. The 'hash_put' function takes the
## name of the table, a field name in the table, and the value to be
## stored in the table. The 'hash_get' function retrieves a value from
-## the table given the table and field name.
+## the table given the table and field name.
##
## <pre>
## To store a value into a field of a table, use hash_put:
@@ -25,12 +25,12 @@
## <br>
## <p>IMPLEMENTATION NOTE</p>
## <br>
-## Bash does not provide direct support for hash tables. These
+## Bash does not provide direct support for hash tables. These
## functions are implemented by first building a variable using the
## table name and field name, then using the eval function to store
## (retrieve) value into (from) the variable.
##
-## The idea for the hash data structure in bash was inspired by a
+## The idea for the hash data structure in bash was inspired by a
## short example by Phil Howard which shows the use of hashes in bash.
## Phil Howard's original example can be found here:
##
@@ -65,8 +65,8 @@ function hash_build_variable_name() {
___TABLE=${___TABLE//\:/_CLN_}
___TABLE=${___TABLE// /_SPC_}
___TABLE=${___TABLE//[/_OSB_}
- ___TABLE=${___TABLE//]/_CSB_}
-
+ ___TABLE=${___TABLE//]/_CSB_}
+
if [[ $___FIELD ]] ; then
___FIELD=${___FIELD//\+/_P_}
___FIELD=${___FIELD//\-/_M_}
@@ -98,7 +98,7 @@ function hash_unbuild_field_name() {
local ___FIELD=${1#$___TABLE}
___FIELD=${___FIELD%_*}
# `echo "$1" | sed -n "s/^$2\(.*\)_$/\1/p"`
-
+
# debug "libhash" "hash_unbuild_field_name() -
TABLE=$___TABLE:FIELD=$___FIELD"

___FIELD=${___FIELD//_P_/\+}
@@ -117,7 +117,7 @@ function hash_unbuild_field_name() {
## @param table name
## @param field name
## @param value
-##
+##
## Saves the value in the specified table/field.
##
#---------------------------------------------------------------------
@@ -132,10 +132,10 @@ function hash_put() {
#---------------------------------------------------------------------
## @param table name
## @param field name
-##
+##
## @Stdout Value stored in table/field
-## Echos the value stored in the table/field. If no value was
-## previously stored in the table/field, this function echos an empty
+## Echos the value stored in the table/field. If no value was
+## previously stored in the table/field, this function echos an empty
## string.
##
#---------------------------------------------------------------------
@@ -149,7 +149,7 @@ function hash_get() {
## @param table name
## @param field name
## @param upvar name
-##
+##
## @Stdout none
## Returns the value stored in the table/field through the upvar variable
## name. If no value was previously stored in the table/field, then an
@@ -166,7 +166,7 @@ function hash_get_ref() {
## @param table name
## @param field name
## @param value
-##
+##
## Appends the value to the specified table/field.
##
#---------------------------------------------------------------------
@@ -178,14 +178,14 @@ function hash_append() {
old_value=${!VARIABLE_NAME}
if [[ -n $old_value ]] ; then
eval "${VARIABLE_NAME}=\"$old_value${sep}${3}\""
- else
+ else
eval "${VARIABLE_NAME}=\"$3\""
fi
}

#---------------------------------------------------------------------
## @param table name
-##
+##
## 'export' all the values in the table. This is useful for getting
## hash table data from cast's pass_one/two into pass_three/pass_four
## which are run through make. Essentially exporting lets us pass
@@ -203,7 +203,7 @@ function hash_export() {
#---------------------------------------------------------------------
## @param table name
## @param field name
-##
+##
## Unsets field. Deletes value.
##
#---------------------------------------------------------------------
@@ -216,7 +216,7 @@ function hash_unset() {

#---------------------------------------------------------------------
## @param table name
-##
+##
## Unsets all fields in a table.
##
#---------------------------------------------------------------------
@@ -224,7 +224,7 @@ function hash_reset() {
local TABLE_NAME
hash_build_variable_name "$1" '' TABLE_NAME
local VARIABLES=`eval 'echo ${!'${TABLE_NAME}'*}'`
- unset $VARIABLES
+ unset $VARIABLES

}

@@ -232,7 +232,7 @@ function hash_reset() {
## @param table name
## @param opt delimiter
## @Stdout table data
-## Outputs the entire table data, with fields separated by the
+## Outputs the entire table data, with fields separated by the
## optional delimiter. If no delimiter is give, \n will be used.
##
#---------------------------------------------------------------------
@@ -244,11 +244,11 @@ function hash_get_table() {
local separator="$2"
separator=${separator:-$'\n'}
VARIABLES=`eval 'echo ${!'${TABLE_NAME}'*}'`
-
+
for i in $VARIABLES; do
echo -n "${!i}${separator}"
done
-
+
}


@@ -256,8 +256,8 @@ function hash_get_table() {
## @param table name
## @param opt delimiter
## @Stdout Fields in table
-## Outputs all of the fields in the table , with fields separated
-## by the optional delimiter. If no delimiter is give, \n wil be
+## Outputs all of the fields in the table , with fields separated
+## by the optional delimiter. If no delimiter is give, \n wil be
## used.
##
#---------------------------------------------------------------------
@@ -269,13 +269,13 @@ function hash_get_table_fields() {
local separator="$2"
separator=${separator:-$'\n'}
VARIABLES=`eval 'echo ${!'${TABLE_NAME}'*}'`
-
+
local FIELD
for i in $VARIABLES ; do
hash_unbuild_field_name "$i" "$TABLE_NAME" FIELD
echo -n "${FIELD}${separator}"
done
-
+
}

#---------------------------------------------------------------------
diff --git a/var/lib/sorcery/modules/libinitd
b/var/lib/sorcery/modules/libinitd
index e3fdbce..5cb2003 100755
--- a/var/lib/sorcery/modules/libinitd
+++ b/var/lib/sorcery/modules/libinitd
@@ -135,7 +135,7 @@ function _init_install_conf_files()
local file=$SCRIPT_DIRECTORY/init.d/$file.conf

if [ ! -f "$file" ] ; then
- [ ! -f "$target_file" ] &&
+ [ ! -f "$target_file" ] &&
message "${PROBLEM_COLOR}Unable to find file
$file...${DEFAULT_COLOR}"
continue
fi
@@ -217,7 +217,7 @@ function init_install()

# /etc/sysconfig/init might not exist yet so we define this in case
RUNLEVELS_DIR=${INSTALL_ROOT}${RUNLEVELS_DIR:-/etc/init.d/runlevels}
-
+
local runlevel_dir="$RUNLEVELS_DIR/%$script_runlevel"

if [ ! -d "$runlevel_dir" ] ; then
diff --git a/var/lib/sorcery/modules/liblock b/var/lib/sorcery/modules/liblock
index 0006fc9..ad73bc5 100755
--- a/var/lib/sorcery/modules/liblock
+++ b/var/lib/sorcery/modules/liblock
@@ -10,7 +10,7 @@
## locks. Therefor, we need a list of locks for the current
## process. And we need to update this list at the same time we got the
## lock.
-## liblock is used to lock and unlock resources. It should be deadlock
+## liblock is used to lock and unlock resources. It should be deadlock
## free, and clean up locks after processes that had locks die without
## unlocking the files. It uses the directory $LOCK_DIR defined in
## /etc/sorcery/config
@@ -26,13 +26,13 @@
## lock_resources
## @param Type of resource
## @param Name of resource
-##
+##
## Type of resource | Name of resource | Usage
## cast | spell name | when casting a spell
## file | file name | to lock a file
## summon | spell name | when downloading a spell
## network | network | ?
-## solo | resource name | when using a resource exclusively
+## solo | resource name | when using a resource exclusively
## libgrimoire | install | when a spell is in the install stage
## locking solo will not cause these routines to behave any different.
## catching it has to be done externally (see cast for an example)
@@ -62,7 +62,7 @@ lock_resources()
## @param Type of resource
## @param Name of resource
##
-## this function tries to lock the specified resource. On success, it
+## this function tries to lock the specified resource. On success, it
## immediately returns 0 (true). On failure (the lock cannot be
## acquired), it returns 1 (false).
#---------------------------------------------------------------------
@@ -72,7 +72,7 @@ trylock_resources()
# echo "usage: trylock_resources type_of_resource name_of_resource"
# exit -1
# fi
-
+
local lockfile="$1.$2"
# we replace / with ^
lockfile="${LOCK_DIR}/${lockfile//\//^}"
@@ -111,12 +111,12 @@ excllock_resources()
# fi

while find $LOCK_DIR -mindepth 1 -maxdepth 1 -name "$1.*" | grep -q '';
- do
+ do
#^^^ look if a lock exists of the given type (ugly code)
global_clean_resources
local SLEEP=$(( ${RANDOM} % ${MAX_SLEEP} ))
sleep "$SLEEP"
- done
+ done
#theoretically, someone could create a lock now... tiny race
trylock_resources "$@"
}
@@ -129,7 +129,7 @@ excllock_resources()
## this function unlocks the specified resource and returns immediately
## if the specified resource is :
## - unlocked : nothing is done
-## - locked by this process : it's unlocked
+## - locked by this process : it's unlocked
## - locked by another process : it's kept locked.
## In all cases and for compatibility reasons with the old liblock, we
## return true
@@ -186,7 +186,7 @@ global_clean_resources()

# we remove locks that are owned by dead processes
find "${LOCK_DIR}" -maxdepth 2 -mindepth 2 | \
-
+
while read file; do
# check if the process still exist (we use procfs mounted on /proc)
if [ ! -d "${file}" ]; then
@@ -202,10 +202,10 @@ global_clean_resources()
## @param Name of file to lock
## @param <file> ... (optional)
##
-## Locks files for access to only this PID. Will cause attempts by
+## Locks files for access to only this PID. Will cause attempts by
## other processes that want to lock the file(s) to block until this
## PID unlocks the file, or this PID dies.
-## It cannot prevent bad programs from modifying the file w/o
+## It cannot prevent bad programs from modifying the file w/o
## permission.
## Note: Files with funky chars may break things. No colons or stuff.
## @Blocking
@@ -215,7 +215,7 @@ function lock_file()
{
debug "liblock" "$FUNCNAME - $*"
local FILE
- lock_resources $(
+ lock_resources $(
for FILE in "$@" ; do
echo file $FILE
done
@@ -247,10 +247,10 @@ function unlock_file()
##
## A transaction locks a file and ensures that changes made to the
## file are all made at once. No changes are made to the file until
-## the transaction is commited. Furthermore, a transaction can be
-## killed before it is commited, ending the transaction and not
-## making any changes to the files. All files are locked at once.
-## If not all can be locked, they will be unlocked, and another try
+## the transaction is commited. Furthermore, a transaction can be
+## killed before it is commited, ending the transaction and not
+## making any changes to the files. All files are locked at once.
+## If not all can be locked, they will be unlocked, and another try
## will be made.
##
## @return The name of a temporary file that should be written to
@@ -261,32 +261,32 @@ function lock_start_transaction()
{
debug "liblock" "$FUNCNAME - $*"
local i TRANSNAME NUMTRANS RET=""
-
+
if lock_file "$@" ; then
-
+
lock_file $LOCK_TRANSACTIONS
[ -s $LOCK_TRANSACTIONS ] || echo "0:::" > $LOCK_TRANSACTIONS
-
+
NUMTRANS=`tail -n 1 $LOCK_TRANSACTIONS | cut -d : -f 1`
NUMTRANS=${NUMTRANS:-1}
RET=()
-
+
for i in $* ; do
let NUMTRANS++
# cp file to temp file, if doesn't exist, create empty file.
if [ -e "$i" ] ; then
- cp "$i" "$LOCK_TRANSACTIONS.$NUMTRANS"
+ cp "$i" "$LOCK_TRANSACTIONS.$NUMTRANS"
else
echo -n "" > $LOCK_TRANSACTIONS.$NUMTRANS
fi
echo "$NUMTRANS:$i:$$" >$LOCK_TRANSACTIONS
RET[$NUMTRANS]="${LOCK_TRANSACTIONS}.${NUMTRANS}"
done
-
+
unlock_file $LOCK_TRANSACTIONS
echo ${RET[*]}
return 0
-
+
else
return 1
fi
@@ -304,7 +304,7 @@ function lock_commit_transaction()
{
debug "liblock" "$FUNCNAME - $*"
local TMP_FILE unlockList=""
-
+
lock_file $LOCK_TRANSACTIONS
for i in $* ; do
TMP_FILE=${LOCK_TRANSACTIONS}.$(grep ".*:$i:$$" $LOCK_TRANSACTIONS | cut
-d : -f 1)
@@ -317,7 +317,7 @@ function lock_commit_transaction()
exit 1
fi
else
- rm $TMP_FILE
+ rm $TMP_FILE
fi
unlock_file $i
cp $LOCK_TRANSACTIONS $LOCK_TRANSACTIONS.new
@@ -333,7 +333,7 @@ function lock_commit_transaction()
{ rm $LOCK_TRANSACTIONS.new ||
message "${PROBLEM_COLOR}Very odd case. Quitting."; exit 1; }
done
- unlock_file $LOCK_TRANSACTIONS
+ unlock_file $LOCK_TRANSACTIONS

}

@@ -349,7 +349,7 @@ function lock_kill_transaction()
{
debug "liblock" "$FUNCNAME - $*"
local TMP_FILE
-
+
lock_file $LOCK_TRANSACTIONS
for i in $* ; do
TMP_FILE=$(grep `esc_str ".*:$i:$$"` $LOCK_TRANSACTIONS | cut -d : -f 1)
@@ -357,7 +357,7 @@ function lock_kill_transaction()
cp $LOCK_TRANSACTIONS $LOCK_TRANSACTIONS.1
grep -v `esc_str ".*:$i:$$"` $LOCK_TRANSACTIONS.1 >$LOCK_TRANSACTIONS
done
- unlock_file $LOCK_TRANSACTIONS
+ unlock_file $LOCK_TRANSACTIONS
}

#---------------------------------------------------------------------
@@ -444,7 +444,7 @@ function counter_check() {
}

#---------------------------------------------------------------------
-##
+##
## @Internal
## @param counter file
##
@@ -460,8 +460,8 @@ function counter_clean() {

#---------------------------------------------------------------------
##=item SYNCHRONIZE
-##
-## Prevents more than one process from entering a section of code
+##
+## Prevents more than one process from entering a section of code
## at a time
## NOTE: This assumes that two functions of the same name will
## not havethe SYNCHRONIZE command on the same line in different
@@ -476,7 +476,7 @@ function counter_clean() {
## } && eval "$UNSYNCHRONIZE"
## echo "PID $$ done."
##
-## Note: SYNCHRONIZE and UNSYNCHRONIZE must be in the same local
+## Note: SYNCHRONIZE and UNSYNCHRONIZE must be in the same local
## scope. Nested SYNCHs are not allowed in the same local scopes.
## Local scope usualy being a function.
## (Blocking)
diff --git a/var/lib/sorcery/modules/libmedia
b/var/lib/sorcery/modules/libmedia
index 77806cc..e454419 100755
--- a/var/lib/sorcery/modules/libmedia
+++ b/var/lib/sorcery/modules/libmedia
@@ -83,11 +83,11 @@ function media_init() {
#---------------------------------------------------------------------
##
## Setup sound menu from existing installed sorcery sound spells.
-## Currently no check done for installed sound schemes, just message
-## to user.
+## Currently no check done for installed sound schemes, just message
+## to user.
##
## Passes name of chosen scheme to the set_sound_scheme funtion.
-##
+##
#---------------------------------------------------------------------
function sound_schemes_menu() {

@@ -116,8 +116,8 @@ function sound_schemes_menu() {
case $CHECK in
OFF) remove_config $LOCAL_CONFIG "SOUND"
modify_config $LOCAL_MEDIA_CONFIG "SOUND" "off" &&
- SOUND=off
- eval $DIALOG '--msgbox "Sorcery sounds have been turned off."
0 0'
+ SOUND=off
+ eval $DIALOG '--msgbox "Sorcery sounds have been turned off."
0 0'
;;
FER) set_sound_theme ferris ;;
MIS) set_sound_theme misc ;;
@@ -132,9 +132,9 @@ function sound_schemes_menu() {


#---------------------------------------------------------------------
-## @param sound scheme name
+## @param sound scheme name
##
-## Here the passed scheme is set as default sound scheme.
+## Here the passed scheme is set as default sound scheme.
## If the sound spell is not installed it will be cast for the user.
##
#---------------------------------------------------------------------
@@ -146,18 +146,18 @@ function set_sound_theme() {
modify_config $LOCAL_MEDIA_CONFIG "SOUND" "on" &&
modify_config $LOCAL_MEDIA_CONFIG "SOUND_THEME" "$1" &&
SOUND=on &&
- SOUND_THEME=$1
+ SOUND_THEME=$1
+

-
if ! spell_ok sorcery-sound-$SOUND_THEME
- then
+ then
eval $DIALOG '--msgbox "Sorcery has determined that the $SOUND_THEME \
theme must be installed to work. It will now \
- be cast for you!" 0 0'
+ be cast for you!" 0 0'
cast sorcery-sound-$SOUND_THEME
else
eval $DIALOG '--msgbox "The $SOUND_THEME theme is installed and ready \
- for you to enjoy your new sounds!" 0 0'
+ for you to enjoy your new sounds!" 0 0'
fi

}
diff --git a/var/lib/sorcery/modules/libmisc b/var/lib/sorcery/modules/libmisc
index 87472e3..a7450b7 100755
--- a/var/lib/sorcery/modules/libmisc
+++ b/var/lib/sorcery/modules/libmisc
@@ -47,11 +47,11 @@ function explode()
## @param sed command
## @param file
##
-## First argument is a sed command. Second argument is a file.
-## sedit performs the sed command on the file, modifiying the
-## original file. For example,
+## First argument is a sed command. Second argument is a file.
+## sedit performs the sed command on the file, modifiying the
+## original file. For example,
## <br>sedit "s/foo/bar/g" /tmp/somefile <br>
-## will replace all occurances of foo with bar in /tmp/somefile.
+## will replace all occurances of foo with bar in /tmp/somefile.
## This function is often used in spells to make changes to source
## files before compiling. See the sed man page for more information.
##
@@ -85,7 +85,7 @@ function isalpha() {

#---------------------------------------------------------------------
## @Type API
-## @param question
+## @param question
## @param default answer
##
## @return 0 on yes
@@ -93,7 +93,7 @@ function isalpha() {
##
## Asks the user a yes/no question. First argument is the question to
## ask, second argument is the default answer. If a timeout occurs
-## before the question is answered, the given default answer is
+## before the question is answered, the given default answer is
## applied. Pressing spacebar or enter applies the default answer
## immediatelly without waiting for timeout.
## Returns true or false based on the answer given.
@@ -102,15 +102,15 @@ function isalpha() {
function real_query() { (

debug "libmisc" "Running query() with the following arguments: '$1' and
'$2'"
-
+
while true ; do
-
+
RESPONSE=""

if [ -z "$SILENT" ]; then

echo -e -n "${QUERY_COLOR}$1 [$2] ${DEFAULT_COLOR}"
-
+
read -t $PROMPT_DELAY -n 1 RESPONSE
echo
fi
@@ -120,7 +120,7 @@ function real_query() { (
n|N) return 1 ;;
y|Y) return 0 ;;
esac
-
+
done

) }
@@ -137,28 +137,28 @@ function real_query() { (
##
#---------------------------------------------------------------------
function real_query_string () {
-
+
debug "libmisc" "Running question() with the following arguments: '$1'
and '$2'"
-
+
local RESPONSE=""
local RETURN=0
local ANSWER_first ANSWER_rest
-
+
local DEFAULT=""
[ -n "$3" ] && DEFAULT=" [$3] "
-
+
if [ -z "$SILENT" ]; then
echo -e -n "${QUERY_COLOR}$2${DEFAULT}${DEFAULT_COLOR}"
read -t $PROMPT_DELAY -n 1 ANSWER_first
- if [[ $ANSWER_first ]] ; then
+ if [[ $ANSWER_first ]] ; then
read ANSWER_rest
fi
RESPONSE="${ANSWER_first}${ANSWER_rest}"
echo
fi
-
+
[ -z "$RESPONSE" ] && RETURN=1 && RESPONSE="$3"
-
+
eval $1=\"${RESPONSE}\"
return $RETURN
}
@@ -196,7 +196,7 @@ function real_message() {
function debug() {

[[ $DEBUG ]] || return 0
-
+
local debugVar="DEBUG_${1}"
local i
if [[ ${!debugVar} != "no" ]] ; then
@@ -217,7 +217,7 @@ function debug() {
##
#---------------------------------------------------------------------
function progress_spinner() {
- let PROGRESS_SPINNER=$PROGRESS_SPINNER+1
+ let PROGRESS_SPINNER=$PROGRESS_SPINNER+1
if (( PROGRESS_SPINNER > ${#PROGRESS_SPINNER_CHARS}-1 )); then
PROGRESS_SPINNER=0;
fi
@@ -245,19 +245,19 @@ debug "libmisc" "progress_bar - $*"
else
len=${3:-${COLUMNS:-70}}
fi
-
+
# Can't make a bar because there's no total, or the length isn't
- # long enough, or if there is no length
+ # long enough, or if there is no length
if [ $# -lt 2 ] || [ $len -lt 8 ] ; then
message -n "."
return 0
fi
-
+
if [ $1 -lt 1 ] || [ $2 -lt 1 ] ; then return 1 ; fi
-
+
percent=$((100*$1/$2))
percent=`printf "%.0f" $percent`
-
+
if [[ $LAST_PERCENT == $percent ]] ; then
progress_spinner
return 0
@@ -319,7 +319,7 @@ function clear_line() {
#---------------------------------------------------------------------
##
## @Globals SOUND
-## Plays a given soundfile if sounds are on and the file exists in
+## Plays a given soundfile if sounds are on and the file exists in
## the chosen theme.
##
#---------------------------------------------------------------------
@@ -430,24 +430,24 @@ function get_dirnames() {
## @param The string to itterate over. (optional)
## @Stdin is used when $3 isn't given.
##
-## $3 is optional, when it isn't used,
+## $3 is optional, when it isn't used,
## stdin is used and only the first letter in $2 is used. Note, using stdin
## can have odd side effects when your function uses read and stdin itself.
##
-## Special vars:
+## Special vars:
## BREAK: Use this to break out of the loop prematurely, also causes a
return of 1.
##
## If the function returns the value of the last return
## Notes:
-## In stdin mode, if the string does not terminate with the delimiter, the
last
+## In stdin mode, if the string does not terminate with the delimiter, the
last
## token will be ignored.
#----------------------------------------------------------------------
function iterate()
{ # $1=callback+args, $2=separator, $3=(opt)string
# debug "libmisc" "iterate - $@"
-
+
[ $# -lt 2 ] && return 2
-
+
local oldIFS="$IFS"
local token
local func="$1"
@@ -457,10 +457,10 @@ function iterate()
shift 2
for token in $* ; do
IFS="$oldIFS"
-
+
eval "$func \"$token\""
[[ $BREAK ]] && break
-
+
done
IFS="$oldIFS"
else
@@ -470,7 +470,7 @@ function iterate()
done
# debug "leftover token: $token"
fi
-
+
returnValue=$?
[[ $BREAK ]] && debug "libmisc" "iterate - I was BREAKed."
unset BREAK
@@ -481,7 +481,7 @@ function iterate()
## @param return_var (must not be i, foo, temp, number, returnvar, stuff,
msgstr or hashname)
## @param default choice
## @param elements, ..
-##
+##
## gives the user some nice select list and puts the selected
## item in return_var
##
@@ -499,7 +499,7 @@ function select_list()
hash_unset select_list_hash
# see note in select_provider
stuff=(0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w
x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z)
-
+
let i=0
for foo in "$@"; do
message "\t$DEFAULT_COLOR(${stuff[$i]})
$SPELL_COLOR$foo$DEFAULT_COLOR"
@@ -542,7 +542,7 @@ function select_list_sub() {

#---------------------------------------------------------------------
## @param title
-##
+##
## sets the terminal title if TERM=xterm|rxvt or the window title if
## TERM=screen
##
@@ -571,9 +571,9 @@ function set_term_title()
function real_list_remove () {
local var=$1
shift
-
+
local i
-
+
for i in $@; do
eval "$var=\`echo \" \$$var \" | sed \
-e \"s/[[:space:]]\\+/ /g\" \
@@ -620,12 +620,12 @@ function real_list_add () {
## return 1 none of supplied elements is not in list
##
## Finds if at least one of the given elements is in the string. They
-## can be delimited by spaces, tabs or newlines. The search elements
+## can be delimited by spaces, tabs or newlines. The search elements
## must not contain any of these or they won't match. The matching is
## exact, regular expressions and globbing patterns are not supported.
##
-## Warning, this function takes a real string, not a variable name as
-## other list_* functions.
+## Warning, this function takes a real string, not a variable name as
+## other list_* functions.
##
#---------------------------------------------------------------------
function real_list_find () {
@@ -883,7 +883,7 @@ function real_config_query () {
if config_get_option "$1" ANSWER; then
# option allready ANSWERed in config
echo -e "[[ ${QUERY_COLOR}$2${DEFAULT_COLOR} ->
${QUERY_COLOR}$ANSWER${DEFAULT_COLOR} ]]"
-
+
# already have a reasonable value...
[ "$ANSWER" == "y" ] || [ "$ANSWER" == "n" ] && return 0
fi
@@ -919,7 +919,7 @@ function real_config_query () {
#---------------------------------------------------------------------
function real_config_query_option () {
local ANSWER key
-
+
# If the option exists
# If the option contains option_yes or option_no
if config_get_option "$1" ANSWER && list_find "$ANSWER" $4 $5; then
@@ -940,7 +940,7 @@ function real_config_query_option () {
# Find out if the option was 'y' or 'n'
list_find "$last_answer" $4 && default=y
list_find "$last_answer" $5 && default=n
-
+
if query "$2" "$default"; then
list_add ANSWER $4
else
@@ -965,7 +965,7 @@ function real_config_query_option () {
#---------------------------------------------------------------------
function real_config_query_string () {
local ANSWER
-
+
if config_get_option "$1" ANSWER; then
# option allready answered in config
echo -e "[[ ${QUERY_COLOR}$2${DEFAULT_COLOR} ->
'${QUERY_COLOR}$ANSWER${DEFAULT_COLOR}' ]]"
@@ -1084,7 +1084,7 @@ function remove_files_and_dirs() {
#---------------------------------------------------------------------
## Safely creates $TMP_DIR and exports the variable so we can use it
## even in subprocesses called through make.
-## @param name of the script needing the tmp dir
+## @param name of the script needing the tmp dir
#---------------------------------------------------------------------
function mk_tmp_dirs() {
debug "$FUNCNAME" "Making tmp dirs for $$"
@@ -1272,20 +1272,20 @@ function complain_sorcery_var() {
## @param (optional) Architecture to use
## Sets the SPECFILE glocal variable and the SMGL_COMPAT_ARCHS global array
## SPECFILE contains the compiler and other arch specifications
-## SMGL_COMPAT_ARCHS is an array that holds architectures which are
compatible
-## with the desired architecture. The desired architecture is determined as
+## SMGL_COMPAT_ARCHS is an array that holds architectures which are
compatible
+## with the desired architecture. The desired architecture is determined as
## follows:
## 1) If function is gien an argument, the argument is used, or
## 2) If cross-install is on, the TARGET architecture is used, or
## 3) The local ARCHITECTURE is used
##
-## The least specific arch is in SMGL_COMPAT_ARCHS[0],
+## The least specific arch is in SMGL_COMPAT_ARCHS[0],
## SMGL_COMPAT_ARCHS[1] is more specific, et cetera. For example:
## desired architecture="athlon-xp" might result in:
## SPECFILE=/usr/share/archspecs/ia32/amd/athlon-xp
## SMGL_COMPAT_ARCHS=("ia32" "amd" "athlon-xp")
##
-## ARCHITECTURE is also modified to be an array, the reverse of
+## ARCHITECTURE is also modified to be an array, the reverse of
## SMGL_COMPAT_ARCHS. The result is an array from most specific arch to least
## specific. $ARCHITECTURE does not change meaning since $A == ${A[0]}.
#-------------------------------------------------------------------
@@ -1298,8 +1298,8 @@ function set_architecture() {

# If given an argument, treat as the architecture to use
local arch=${1}
-
- # If no arch is specified, see if this is a cross-install, if so, set arch
to
+
+ # If no arch is specified, see if this is a cross-install, if so, set arch
to
# the target arch
if [[ ! $arch ]] &&
[[ $CROSS_INSTALL == on ]] &&
@@ -1308,12 +1308,12 @@ function set_architecture() {
debug "libmisc" "set_architecture: using cross-install's target arch"
arch=${arch:-$TARGET}
fi
-
+
# If no arch given and this isn't a cross-install, then default to the
ARCHITECTURE var
if ! [[ $arch ]] ; then
arch=$ARCHITECTURE
fi
-
+
# Find the specfile to use
local find_compat=0
find --version|grep -q 'version 4\.1\(\.\|$\)' && find_compat=1
@@ -1328,14 +1328,14 @@ function set_architecture() {
fi
[ $SPECFILE ] && break
done
- if [[ ! $SPECFILE ]] ; then
+ if [[ ! $SPECFILE ]] ; then
message "${PROBLEM_COLOR}Cannot find arch spec for $arch!$DEFAULT_COLOR"
return 1
fi
debug "libmisc" "set_architecture: SPECFILE=$SPECFILE"
-
+
# turn the path into an array, but remove $specdir from the start first
- unset SMGL_COMPAT_ARCHS
+ unset SMGL_COMPAT_ARCHS
explode "${SPECFILE#$specdir/}" '/' SMGL_COMPAT_ARCHS

unset ARCHITECTURE
@@ -1344,7 +1344,7 @@ function set_architecture() {
for(( i=${#SMGL_COMPAT_ARCHS[@]}-1; i>=0; i--)) ; do
ARCHITECTURE[j++]=${SMGL_COMPAT_ARCHS[i]}
done
-
+
source "$SPECFILE"
}

@@ -1353,9 +1353,9 @@ function set_architecture() {
## @param Function name
## @param (optional) Function name
## @param ...
-## Creates functions with identical bodies. It is useful if you need
+## 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() {
local funcName
local funcContent="$1"
@@ -1385,7 +1385,7 @@ function define_functions() {
## read -p "enter value (default $2)" y
## upvar $var $y
## }
-##
+##
#---------------------------------------------------------------------
function upvar() {
# This makes eval see things as name=$2,
@@ -1467,7 +1467,7 @@ function smgl_basename() {
## @param old path
## @Stdout new path
##
-## TODO: remove grimoire functions libgcc gcc_prepend_path and use
+## TODO: remove grimoire functions libgcc gcc_prepend_path and use
## this one
#--------------------------------------------------------------------
function envar_prepend_path()
@@ -1483,7 +1483,7 @@ function envar_prepend_path()

# Standard debug line:
# file "function@line" "all" "args"
-STD_DEBUG='eval local _stddbg_file=${BASH_SOURCE[0]} ;
+STD_DEBUG='eval local _stddbg_file=${BASH_SOURCE[0]} ;
_stddbg_file=${_stddbg_file##*/};
debug "${_stddbg_file}" "${FUNCNAME[0]}@$LINENO" "$@"'

diff --git a/var/lib/sorcery/modules/libresurrect
b/var/lib/sorcery/modules/libresurrect
index 54fdeeb..b701923 100755
--- a/var/lib/sorcery/modules/libresurrect
+++ b/var/lib/sorcery/modules/libresurrect
@@ -19,7 +19,7 @@ function can_resurrect() {
debug "libresurrect" "can_resurrect - $*"
local SPELL=$1
local VERSION=$2
-
+
# FIXME accept files of other extensions
local file=$INSTALL_CACHE/$SPELL-$VERSION-$HOST.tar$EXTENSION &&
test -f $file &&
@@ -29,7 +29,7 @@ function can_resurrect() {
}

#------------------------------------------------------------------------
-# @param spell
+# @param spell
# @param version
#
# High level overview:
@@ -62,7 +62,7 @@ function can_resurrect() {
# remove regular files unique to the old spell
# remove unchanged config files
# ask about changed config files
-#
+#
# update state data
# call it a day
#
@@ -331,7 +331,7 @@ function resurrect_sub() {
# test -d so handle them specially
test -h ".$line" && echo .$line ||
test -d ".$line" || echo .$line
- done | sort | tar -cT - | tar -xvf - -C ${INSTALL_ROOT:-/} || {
+ done | sort | tar -cT - | tar -xvf - -C ${INSTALL_ROOT:-/} || {
debug "libresurrect" "Failed to install regular files"
resurrect_fail 1
return 1
@@ -412,7 +412,7 @@ function real_install_config_file() {
"$DEFAULT_COLOR"
return 1
fi
-
+
local old_md5_log
if [[ $OLD_SPELL_VERSION ]] ; then
old_md5_log=$MD5SUM_LOGS/$SPELL-$OLD_SPELL_VERSION
@@ -451,7 +451,7 @@ function internal_install_config_file() {
return $?
fi

- # if the file does not exist, or stage root is invoked
+ # if the file does not exist, or stage root is invoked
if ! test -e "$to" || [[ "$STAGED_INSTALL" != "off" ]] ; then
# copy the new one in (plus leading directories)
mkdir -p "$(dirname "$to")" &&
@@ -580,7 +580,7 @@ function resurrect_success() {
cat $spell_depends >> $t_DEPENDS_STATUS
fi
lock_commit_transaction $DEPENDS_STATUS
-
+
# if theres a tablet dir, store it with a new timestamp
if new_tablet=$(tablet_get_path $SPELL) ; then
cp -Rp $OLD_TABLET_DIR/* $new_tablet
@@ -597,7 +597,7 @@ function resurrect_success() {
echo $COMPILE_LOG >> $TMP_INSTALL_LOG_STATE
echo $INSTALL_LOG >> $TMP_INSTALL_LOG_STATE
echo $MD5_LOG >> $TMP_INSTALL_LOG_STATE
-
+
# Use the cache's listing of files in filterable form
# dont use root form because it may be different
log_adjuster $NEW_DATA_F $TMP_INSTALL_LOG_DATA filterable root
@@ -621,14 +621,14 @@ function resurrect_success() {
activity_log "resurrect" "$SPELL" "$VERSION" "success"
message "${RESURRECT_COLOR}Resurrected spell: ${SPELL_COLOR}${SPELL}" \
"${DEFAULT_COLOR} version ${VERSION_COLOR}${VERSION}" \
- "${DEFAULT_COLOR}"
+ "${DEFAULT_COLOR}"
}


function resurrect_fail() {
message "${PROBLEM_COLOR}Resurrect failed for spell:" \
"${SPELL_COLOR}${SPELL}${DEFAULT_COLOR} version" \
- "${VERSION_COLOR}${VERSION}${DEFAULT_COLOR}"
+ "${VERSION_COLOR}${VERSION}${DEFAULT_COLOR}"

#if [[ $1 == 1 ]] ; then
#TODO evaluate the usefulness of a backup/rollback scheme
@@ -642,7 +642,7 @@ function resurrect_fail() {
unlock_resources "solo" "cast"

[[ $CLEAN_SOURCE == on ]] && rm_source_dir $RESURRECT_DIR 2>/dev/null
-
+
echo $SPELL >> $FAILED_LIST
}

diff --git a/var/lib/sorcery/modules/libscreen
b/var/lib/sorcery/modules/libscreen
index db635e5..913a536 100755
--- a/var/lib/sorcery/modules/libscreen
+++ b/var/lib/sorcery/modules/libscreen
@@ -33,7 +33,7 @@ function screen_start() {

#-----
## @param Screen session name
-## This function is not used, and probably won't be. It is a way to run
+## This function is not used, and probably won't be. It is a way to run
## a command in a screen.
## The .!!| args to exec were determined by trial and error. ::: didn't work.
#-----
@@ -75,7 +75,7 @@ function screen_new_window() {

#-----
## @param Screen session name
-## Attaches the named screen session to the tty.
+## Attaches the named screen session to the tty.
## Doesn't work properly since screen doesn't like being run in the bg.
## Default escape code is ^A.
#-----
@@ -86,7 +86,7 @@ function screen_attach() {

#-----
## @param Screen session name
-## Detaches the named screen session from the tty.
+## Detaches the named screen session from the tty.
#-----
function screen_detach() {
$STD_DEBUG
@@ -122,7 +122,7 @@ function screen_name_window() {
#-----
## @param Screen session name
## Give aname to the current window.
-## There are race conditions aplenty if you're not careful
+## There are race conditions aplenty if you're not careful
#-----
function screen_name_curr_window() {
$STD_DEBUG
diff --git a/var/lib/sorcery/modules/libsecurity
b/var/lib/sorcery/modules/libsecurity
index 9325ea5..c5a035e 100755
--- a/var/lib/sorcery/modules/libsecurity
+++ b/var/lib/sorcery/modules/libsecurity
@@ -46,7 +46,7 @@ function gaze_checkmd5 () {
fi

REALSOURCE=
- if test "$SOURCE" != ''
+ if test "$SOURCE" != ''
then
if [ -f $SOURCE_CACHE/$SOURCE ]
then
@@ -65,14 +65,14 @@ function gaze_checkmd5 () {
APPEND=
REALSOURCE="$OLDESTSOURCE"
fi
- else
+ else
APPEND=
SOURCE="$OLDESTSOURCE"
fi
fi
if test -z "$PRECACHEDF"
then
- if test `guess_compressor $SOURCE_CACHE/$SOURCE` != 'gzip' &&
+ if test `guess_compressor $SOURCE_CACHE/$SOURCE` != 'gzip' &&
test `guess_compressor $SOURCE_CACHE/$SOURCE` != 'bzip2' &&
test `guess_compressor $SOURCE_CACHE/$SOURCE` != 'compress'"'"'d' &&
test `guess_compressor $SOURCE_CACHE/$SOURCE` != 'Zip' &&
@@ -83,7 +83,7 @@ function gaze_checkmd5 () {
else
fMD5=$(
uncompress $SOURCE_CACHE/$SOURCE `
- guess_compressor $SOURCE_CACHE/$SOURCE` |
+ guess_compressor $SOURCE_CACHE/$SOURCE` |
md5sum | cut -d' ' -f1
)
fi
@@ -117,7 +117,7 @@ function gaze_checkmd5 () {
if test "$tMD5" == ""
then
echo -en "${YELLOW}${BOLD}UNCHECKED $SRCDATA INSERT
MD5[$MD5num]=$fMD5 or MD5[$MD5num]=IGNORE"
- else
+ else
if test "$tMD5" == "IGNORE"
then
echo -en "${YELLOW}IGNORED $SRCDATA"
@@ -126,7 +126,7 @@ function gaze_checkmd5 () {
then
bMD5="`md5sum $SOURCE_CACHE/$SOURCE | cut -d' ' -f1` | head -n
1"
else
- bMD5="`grep " $SOURCE\$" $PRECACHEDB | grep -Ev '\.[0-9]{14}$'
| grep -v '\.asc$'`"
+ bMD5="`grep " $SOURCE\$" $PRECACHEDB | grep -Ev '\.[0-9]{14}$'
| grep -v '\.asc$'`"
fi
if test "$tMD5" == "$bMD5"
then
@@ -155,7 +155,7 @@ function gaze_checkmd5 () {
fi
fi
fi
- fi
+ fi
echo -n " $APPEND"
if test "$tMD5" != "IGNORE" ; then
gaze_checkmd5syntax "$1" "$2"
@@ -174,7 +174,7 @@ function gaze_checkmd5 () {
##
## spelldirectory is the spell's directory
## sourcenumber is '' or '2', '3', '4', etc.
-## Checks the syntax related to md5 checking of a single source file
+## Checks the syntax related to md5 checking of a single source file
## sourcenumber in spelldirectory.
##
#---------------------------------------------------------------------
@@ -271,7 +271,7 @@ function gaze_checkmd5s() {
## @param [<item> ...]
##
## item is a spell or section name.
-## Checks the md5s of various spells, sections, or if called with no
+## Checks the md5s of various spells, sections, or if called with no
## arguments, the entire grimoire.
##
#---------------------------------------------------------------------
diff --git a/var/lib/sorcery/modules/libstage
b/var/lib/sorcery/modules/libstage
index 45fe1d5..fdfdb6a 100755
--- a/var/lib/sorcery/modules/libstage
+++ b/var/lib/sorcery/modules/libstage
@@ -104,13 +104,13 @@ function stage_install_file()
then
message "${MESSAGE_COLOR}Staging config to
$CONFIG_STAGE_DIRECTORY${DEFAULT_COLOR}"
mkdir -p "$(dirname $SAVE)" &&
- cp -dp "$STAGE_DIRECTORY/TRANSL/$FILE" "${INSTALL_ROOT}/$SAVE"
+ cp -dp "$STAGE_DIRECTORY/TRANSL/$FILE" "${INSTALL_ROOT}/$SAVE"
else
- cp -dp "$STAGE_DIRECTORY/TRANSL/$FILE" "${INSTALL_ROOT}/$FILE"
+ cp -dp "$STAGE_DIRECTORY/TRANSL/$FILE" "${INSTALL_ROOT}/$FILE"
fi
;;
*)
- cp -fdp "$STAGE_DIRECTORY/TRANSL/$FILE" "${INSTALL_ROOT}/$FILE"
+ cp -fdp "$STAGE_DIRECTORY/TRANSL/$FILE" "${INSTALL_ROOT}/$FILE"
;;
esac
}
@@ -126,13 +126,13 @@ function stage_install_symlink()
then
touch "${INSTALL_ROOT}/$FILE" &&
mkdir -p $(dirname $SAVE) &&
- ln -sfn $(readlink "$STAGE_DIRECTORY/TRANSL/$FILE")
"${INSTALL_ROOT}/$SAVE"
+ ln -sfn $(readlink "$STAGE_DIRECTORY/TRANSL/$FILE")
"${INSTALL_ROOT}/$SAVE"
else
- ln -sfn $(readlink "$STAGE_DIRECTORY/TRANSL/$FILE")
"${INSTALL_ROOT}/$FILE"
+ ln -sfn $(readlink "$STAGE_DIRECTORY/TRANSL/$FILE")
"${INSTALL_ROOT}/$FILE"
fi
;;
*)
- ln -sfn $(readlink "$STAGE_DIRECTORY/TRANSL/$FILE")
"${INSTALL_ROOT}/$FILE"
+ ln -sfn $(readlink "$STAGE_DIRECTORY/TRANSL/$FILE")
"${INSTALL_ROOT}/$FILE"
;;
esac
}
@@ -217,7 +217,7 @@ function stage_install_list()
stage_install_char_block "$@" c
elif [[ -p $STAGE_DIRECTORY/TRANSL/$1 ]]
then
- stage_install_fifo "$@"
+ stage_install_fifo "$@"
elif [[ ! -d $STAGE_DIRECTORY/TRANSL/$1 ]]
then
stage_install_file "$@"
diff --git a/var/lib/sorcery/modules/libsummon
b/var/lib/sorcery/modules/libsummon
index db07204..eaf0e2a 100755
--- a/var/lib/sorcery/modules/libsummon
+++ b/var/lib/sorcery/modules/libsummon
@@ -78,7 +78,7 @@ function get_spell_files_and_urls() {

#-------------------------------------------------------------------------
## @param none
-##
+##
## Call acquire_src for each SOURCEx_URL
##
#-------------------------------------------------------------------------
@@ -147,7 +147,7 @@ function is_downloaded() {

#-------------------------------------------------------------------------
## @param source number or '' for the first $SOURCE
-##
+##
## Expands $SOURCEx, $SOURCEx_URL[*] and $SOURCEx_HINTS
## then calls download_src_args with them.
##
@@ -292,7 +292,7 @@ function download_src_sub() {
local _summon_target=$5
local _summon_type=$6

- {
+ {
[[ $guess_type == file ]] &&
download_from_leapforward "$target" "$url_list" "$hints" \
"$_summon_target" "$_summon_type"
@@ -331,7 +331,7 @@ function download_from_leapforward() {
local hints="$3"
local _summon_target=$4
local _summon_type=$5
-
+
message "${MESSAGE_COLOR}Attempting to get file from" \
"leap-forward mirror ${DEFAULT_COLOR}${LEAPFORWARD_URL}"
# leap forwards dont need to be expanded or sorted
@@ -370,7 +370,7 @@ function download_from_fallback() {
idx=$[($i + $offset) % $FURLNUM]
FALL_BACKS="$FALL_BACKS ${FALLBACK_URL_MIRROR[$idx]}/$target"
done
- [ -n "$FALL_BACKS" ] &&
+ [ -n "$FALL_BACKS" ] &&
# dont order fall backs, above we use a random ordering
url_download "$target" "$FALL_BACKS" "$hints" "$_summon_target" \
"$_summon_type"
diff --git a/var/lib/sorcery/modules/libtablet
b/var/lib/sorcery/modules/libtablet
index 1caa2b5..a498612 100755
--- a/var/lib/sorcery/modules/libtablet
+++ b/var/lib/sorcery/modules/libtablet
@@ -39,7 +39,7 @@
## known defects pre tablet version 1 (and the functions that fix them) :
## no version file : tablet_0_repair_version
## no updated file : tablet_0_repair_updated
-## spell/<spellname>/<spell files>, should be spell/<spell files>
+## spell/<spellname>/<spell files>, should be spell/<spell files>
## tablet_0_repair_spell DONE
## no tb_version : tablet_0_repair (bumps to version 1)
##
@@ -348,7 +348,7 @@ function tablet_get_path() {
local tb_dir=$TABLET_PATH/$SPELL/$(date +%Y%m%d%H%M%S)
local sleep_time
local made
-
+
mkdir -p $TABLET_PATH/$SPELL &&
for (( i=0 ; $i < 20 ; i++ )) ; do
if mkdir $tb_dir > /dev/null; then
@@ -618,8 +618,8 @@ function tablet_import_repair_files_page() {
[[ -f "$repair_file" ]] || continue
name=$(smgl_basename "$repair_file"|cut -f3- -d^)
key=$(smgl_basename "$repair_file"|cut -f2 -d^)
- [[ $name ]] || continue
- [[ $key ]] || continue
+ [[ $name ]] || continue
+ [[ $key ]] || continue
tablet_check_repair_file spell
done

@@ -627,8 +627,8 @@ function tablet_import_repair_files_page() {
[[ -f "$repair_file" ]] || continue
name=$(smgl_basename "$repair_file"|cut -f3- -d^)
key=$(smgl_basename "$repair_file"|cut -f2 -d^)
- [[ $name ]] || continue
- [[ $key ]] || continue
+ [[ $name ]] || continue
+ [[ $key ]] || continue
tablet_check_repair_file section
done

@@ -636,8 +636,8 @@ function tablet_import_repair_files_page() {
[[ -f "$repair_file" ]] || continue
name=$(smgl_basename "$repair_file"|cut -f3- -d^)
key=$(smgl_basename "$repair_file"|cut -f2 -d^)
- [[ $name ]] || continue
- [[ $key ]] || continue
+ [[ $name ]] || continue
+ [[ $key ]] || continue
tablet_check_repair_file grimoire
done
}
@@ -681,9 +681,9 @@ function tablet_check_repair_file() {
replace=2
fi
fi
- if [[ $replace == 1 ]] ||
+ if [[ $replace == 1 ]] ||
{ [[ $replace == 2 ]] && [[ $codex_md5 != $tablet_md5 ]] ; } ; then
- message "${MESSAGE_COLOR}Tablet Repair: replacing${DEFAULT_COLOR}"
+ message "${MESSAGE_COLOR}Tablet Repair: replacing${DEFAULT_COLOR}"
message "$tablet_file\nwith repair file \n$repair_file"
cp $repair_file $tablet_file
else
@@ -777,7 +777,7 @@ function tablet_fix_duplicates() {
tablet_does_tablet_point_to_itself ${tablets[$i]} ||
tablet_backup_page ${tablets[$i]} $backup_dir
done
-
+
if ! [[ $(ls $tbc_dir) ]] ; then
message "Empty tablet chapter: $tbc_dir, removing it"
rmdir $tbc_dir
@@ -914,7 +914,7 @@ function tablet_0_repair() {

#---------------------------------------------------------------------
## @param tablet dir
-##
+##
## tablet may have either
## $tb_dir/spell/DETAILS or
## $tb_dir/spell/<spellname>/DETAILS
diff --git a/var/lib/sorcery/modules/libtrack
b/var/lib/sorcery/modules/libtrack
index ae3594b..a3dcd63 100755
--- a/var/lib/sorcery/modules/libtrack
+++ b/var/lib/sorcery/modules/libtrack
@@ -37,7 +37,7 @@ function exists() {
##
#---------------------------------------------------------------------
function real_track_manual() {
- if [[ -z "$STAGED_INSTALL" || $STAGED_INSTALL == off ]] &&
+ if [[ -z "$STAGED_INSTALL" || $STAGED_INSTALL == off ]] &&
[[ -z "$INSTALLWATCHFILE" ]] ; then
echo "Can't tell installwatch to manually track... installwatch isn't
running."
return 1
@@ -51,7 +51,7 @@ function real_track_manual() {

#--------------------------------------------------------------------
## Some simple castfs sanity checking
-## make a file, check to see if it exists, check to see if the
+## 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()
@@ -108,7 +108,7 @@ function real_invoke_stage_root()
for dir in /dev /dev/pts /proc /sys
do
mount -o bind "$dir" "${STAGE_DIRECTORY}/MOUNT$dir"
- done
+ done
}

#---------------------------------------------------------------------
@@ -118,7 +118,7 @@ function real_invoke_stage_root()
#---------------------------------------------------------------------
function real_devoke_stage_root()
{
- unset CASTFS_LOGFILE
+ unset CASTFS_LOGFILE
unset CASTFS_DBGLVL
for dir in /dev/pts /dev /proc /sys
do
@@ -136,7 +136,7 @@ function prepare_stage_root()
{
mk_source_dir "${STAGE_DIRECTORY}" &&
mk_source_dir "${STAGE_DIRECTORY}/TRANSL" &&
- mk_source_dir "${STAGE_DIRECTORY}/MOUNT"
+ mk_source_dir "${STAGE_DIRECTORY}/MOUNT"
}

#---------------------------------------------------------------------
@@ -174,12 +174,12 @@ function real_devoke_installwatch() {
function is_castfs_installed()
{
local loc
- if smgl_which castfs loc >/dev/null 2>&1 &&
+ if smgl_which castfs loc >/dev/null 2>&1 &&
(
- modprobe fuse > /dev/null 2>&1 ||
- grep -q '^nodev[[:space:]]*fuse$' /proc/filesystems
- ) &&
- [[ -c /dev/fuse ]]
+ modprobe fuse > /dev/null 2>&1 ||
+ grep -q '^nodev[[:space:]]*fuse$' /proc/filesystems
+ ) &&
+ [[ -c /dev/fuse ]]
then
message "${MESSAGE_COLOR}staging enabled${DEFAULT_COLOR}"
return 0
@@ -474,7 +474,7 @@ function log_adjuster() {
local TMP_SSF=$(make_safe_dir)
local TMP_DATA=$TMP_SSF/foo.data
local TMP_MDATA=$TMP_SSF/foo.mdata
-
+
seperate_state_files $input $TMP_DATA $TMP_MDATA
{
if [[ $cat_metadata ]] ; then
diff --git a/var/lib/sorcery/modules/libtriggers
b/var/lib/sorcery/modules/libtriggers
index 50a3c73..539ef97 100755
--- a/var/lib/sorcery/modules/libtriggers
+++ b/var/lib/sorcery/modules/libtriggers
@@ -25,12 +25,12 @@ function run_triggers() {
#---------------------------------------------------------------------
## @param spell
##
-## Remove's all of a spell's triggers from the list of registered
+## Remove's all of a spell's triggers from the list of registered
## triggers.
##
#---------------------------------------------------------------------
function remove_triggers ()
-{
+{
debug "libtriggers" "remove_triggers - $*"

[ -f $TRIGGER_LIST ] || return 0
@@ -48,12 +48,12 @@ function remove_triggers ()
##
## @Stdout Query and warnings
## @Stdin y/n
-## Triggers an event and performs necessary actions. Argument 2 is
+## Triggers an event and performs necessary actions. Argument 2 is
## optional. If omitted, the value of SPELL will be used.
##
#---------------------------------------------------------------------
function trigger ()
-{
+{
debug "libtriggers" "trigger - $*"

local spell TRIGGER action
@@ -94,7 +94,7 @@ function get_run_script_triggers() {
## @param causing-spell
## @param action
## @param subject-spell
-## Registers a trigger in the list of triggers. Also verifies that
+## Registers a trigger in the list of triggers. Also verifies that
## the trigger and action exist.
##
#---------------------------------------------------------------------
@@ -122,10 +122,10 @@ function set_trigger ()
;;
esac
#perhaps a check to make sure that $2 exists?
-
+
spell=${SPELL:-$4}
str="$spell:$2:$1:$3"
-
+
lock_file $TRIGGER_LIST
if ! test -f $TRIGGER_LIST || ! grep -q "$str" $TRIGGER_LIST ; then
echo "$str" >> $TRIGGER_LIST
diff --git a/var/lib/sorcery/modules/libunpack
b/var/lib/sorcery/modules/libunpack
index 4202ee7..073137e 100755
--- a/var/lib/sorcery/modules/libunpack
+++ b/var/lib/sorcery/modules/libunpack
@@ -104,11 +104,11 @@
## below) will silently fail over to the next check. The cascade order is:
## GPG, HASH, IGNORE, MISSING
##
-## The cascade setup allows you to place a higher bit checksum earlier
-## in the cascade and even if the binary doesn't work it will just print
-## out an abort query which can be said no to and it will continue to
-## fail over to the lower bit checksum that should be available in
-## coreutils (like sha1/md5). That's if you're not using gpg, which is
+## The cascade setup allows you to place a higher bit checksum earlier
+## in the cascade and even if the binary doesn't work it will just print
+## out an abort query which can be said no to and it will continue to
+## fail over to the lower bit checksum that should be available in
+## coreutils (like sha1/md5). That's if you're not using gpg, which is
## preferred. If multiple hashes are included of different ciphers, the
## user can abort on either that go bad, so it can be considered a
## security increase to have more than one, but only if the harder cipher
@@ -132,7 +132,7 @@ function real_unpack_file() {
1) return 1 ;; # verification failed
0) uncompress_unpack ${!SVAR}; return $? ;;
esac
-
+
if false; then # <------ here's the switch to disable oldworld -------
debug "libgrimoire" "falling back to missing verification"
unpack_missing "${!SVAR}"
@@ -185,8 +185,8 @@ function real_verify_file() {


#---------------------------------------------------------------------
-## @param filename
-## @param compressor
+## @param filename
+## @param compressor
## @Stdout uncompressed
##
## Just uncompresses the file, but does not expand it. i.e. bunzip
@@ -211,8 +211,8 @@ function uncompress_core() {


#---------------------------------------------------------------------
-## @param filename
-## @param compressor
+## @param filename
+## @param compressor
## @Stdout uncompressed
##
## unpack_core takes the uncompressed stream and turns it into the
@@ -282,7 +282,7 @@ function unpack_spell_required() {
if ! spell_ok "$1" && ! smgl_which $2 x &> /dev/null; then
query "This spell has an option to check its integrity via spell "\
"${SPELL_COLOR}${1}${QUERY_COLOR} with the $2 command for $3, you might
consider installing it. "\
-"Abort?" n &&
+"Abort?" n &&
return 1 ||
return 200
else
@@ -362,12 +362,12 @@ function is_allowed_hash() {
}

#---------------------------------------------------------------------
-## @param file to unpack
+## @param file to unpack
## @param gpg public key file (.gpg) ":" gpg signature file (.asc)
##
-## Given a file, unpack checks the gpg signature for that file, and, if
-## appropriate, runs the decompression program for that file, as well as
-## untar'ing the file. Note: zip is a special case because it doesn't
+## Given a file, unpack checks the gpg signature for that file, and, if
+## appropriate, runs the decompression program for that file, as well as
+## untar'ing the file. Note: zip is a special case because it doesn't
## work with streams.
##
#---------------------------------------------------------------------
@@ -409,10 +409,10 @@ function unpack_gpg() {
then
message "${PROBLEM_COLOR}AHHH!!! ${message_file} file not
found${DEFAULT_COLOR}"
fi
- if [ "$rc" -eq 200 ]; then
+ if [ "$rc" -eq 200 ]; then
return 200
fi
-
+
gpg_user_query $rc $SPELL spell || return 1
return 0

@@ -420,12 +420,12 @@ function unpack_gpg() {


#---------------------------------------------------------------------
-## @param file to unpack
+## @param file to unpack
## @param algorithm ":" hashsum
##
-## Given a file, unpack checks the hash for that file, and, if
-## appropriate, runs the decompression program for that file, as well as
-## untar'ing the file. Note: zip is a special case because it doesn't
+## Given a file, unpack checks the hash for that file, and, if
+## appropriate, runs the decompression program for that file, as well as
+## untar'ing the file. Note: zip is a special case because it doesn't
## work with streams.
##
#---------------------------------------------------------------------
@@ -448,13 +448,13 @@ function unpack_hash() {

if [[ "$ALGORITHM" == md5 ]] || [[ "$ALGORITHM" == sha1 ]] ; then
unpack_spell_required coreutils "${ALGORITHM}sum" "$ALGORITHM" ||
- return "$?"
+ return "$?"
HASH="$(${ALGORITHM}sum "$FILENAME" | cut -d' ' -f1)"
else
unpack_spell_required gnupg gpg "$ALGORITHM" || return "$?"
if list_find "$(gpg_get_hashes)" $ALGORITHM; then
HASH="$(gpg_hashsum "${ALGORITHM}" "$FILENAME" | cut -d' ' -f1)"
- else
+ else
message "${PROBLEM_COLOR}Algorithm $ALGORITHM is not"\
"known!${DEFAULT_COLOR}"
return 200
@@ -479,11 +479,11 @@ function unpack_hash() {

#--------------------------------------------------------------------
## @param return code from unpack_hash
-## @param spell name
-##
+## @param spell name
+##
## Does some basic output to tell the user what failed and how then calls
## unpack_file_user_query
-## Returns 0 if hash succeeded otherwise returns 1 if unpack_file_user_query
+## Returns 0 if hash succeeded otherwise returns 1 if unpack_file_user_query
## fails
##
#--------------------------------------------------------------------
@@ -491,7 +491,7 @@ function hash_user_query() {
local rc=$1
local spell=$2
case "$rc" in
- 0)
+ 0)
message "${MESSAGE_COLOR}hash verification succeeded${DEFAULT_COLOR}"
;;
*)
@@ -505,7 +505,7 @@ function hash_user_query() {
#--------------------------------------------------------------------
## @param return code from the unpack_gpg or unpack_hash
##
-## checks MD5SUM_DL to abort or not
+## checks MD5SUM_DL to abort or not
## Returns what query returns if it's called
##
#--------------------------------------------------------------------
@@ -526,12 +526,12 @@ function unpack_file_user_query() {
}

#---------------------------------------------------------------------
-## @param file to unpack
+## @param file to unpack
## @param reason to ignore it, one of: volatile unversioned signature
##
-## Given a file, unpack checks the ignore rules for that file, and, if
-## appropriate, runs the decompression program for that file, as well as
-## untar'ing the file. Note: zip is a special case because it doesn't
+## Given a file, unpack checks the ignore rules for that file, and, if
+## appropriate, runs the decompression program for that file, as well as
+## untar'ing the file. Note: zip is a special case because it doesn't
## work with streams.
##
#---------------------------------------------------------------------
@@ -560,12 +560,12 @@ ask_risky|ask_ignore) query "Abort?" "n" &&
return 1 || return 0 ;;


#---------------------------------------------------------------------
-## @param file to unpack
+## @param file to unpack
## @param reason to ignore it, one of: volatile unversioned signature
##
-## Given a file, unpack checks the ignore rules for that file, and, if
-## appropriate, runs the decompression program for that file, as well as
-## untar'ing the file. Note: zip is a special case because it doesn't
+## Given a file, unpack checks the ignore rules for that file, and, if
+## appropriate, runs the decompression program for that file, as well as
+## untar'ing the file. Note: zip is a special case because it doesn't
## work with streams.
##
#---------------------------------------------------------------------
@@ -591,10 +591,10 @@ function unpack_missing() {


#---------------------------------------------------------------------
-## @param file to unpack
+## @param file to unpack
##
-## Given a file, runs the decompression program for that file, as well as
-## untar'ing the file.
+## Given a file, runs the decompression program for that file, as well as
+## untar'ing the file.
##
#---------------------------------------------------------------------
function uncompress_unpack() {
@@ -617,7 +617,7 @@ function uncompress_unpack() {
}

#---------------------------------------------------------------------
-## @param file to unpack
+## @param file to unpack
##
## Interface to unpack a file without any verification.
##
@@ -660,7 +660,7 @@ function locate_spell_file() {

#---------------------------------------------------------------------
## @Type API
-## @param file to unpack
+## @param file to unpack
## @param md5sum
##
## Given a file, unpack runs the decompression program for that file,
@@ -748,13 +748,13 @@ ask_risky|ask_ignore) query "Abort?" "n" &&
return 1 || return 0 ;;


#---------------------------------------------------------------------
-## @param filename
-## @param compressor
-## @param md5
+## @param filename
+## @param compressor
+## @param md5
## @Stdout uncompressed
##
-## Uncompress_md5 dumps the expanded file via tee to md5_tar_check where it
-## is gobbled up by the bitbucket. It also dumps the main stream out to
+## Uncompress_md5 dumps the expanded file via tee to md5_tar_check where it
+## is gobbled up by the bitbucket. It also dumps the main stream out to
## stdout.
##
#---------------------------------------------------------------------
@@ -762,7 +762,7 @@ function uncompress_md5() {
debug "libgrimoire" "uncompress_md5 - $*"

# This is here so Duff's super debugging info doesn't screw the next step
up
- set +x
+ set +x

# Outer subshell is necessary to redirect stderr to stdout
(
diff --git a/var/lib/sorcery/modules/liburl b/var/lib/sorcery/modules/liburl
index 9465829..3d26356 100755
--- a/var/lib/sorcery/modules/liburl
+++ b/var/lib/sorcery/modules/liburl
@@ -18,14 +18,14 @@
##
## The F<url_download> function parses the url prefix (in this
## case, http) and passes the url to the http download handler
-## (F<url_http_download>). A similar approach is used for url
+## (F<url_http_download>). A similar approach is used for url
## verification.
##
## This file provides an infrastructure that makes it relatively easy
## to add new url handlers. In order to add new handlers, all that
## has to be done is add a new file to the sorcerer library directory
## with the new url handler functions defined in the file. This new
-## file will automatically be discovered and used by the sorcerer
+## file will automatically be discovered and used by the sorcerer
## scripts.
##
## The following section describes how to add new url handlers in
@@ -85,8 +85,8 @@
if ! [[ $URL_HANDLER_FILES ]] ; then
URL_HANDLER_FILES=`ls $SGL_LIBRARY_MODULES/url_handlers/url_*[^~]`
for url_handler_file in $URL_HANDLER_FILES; do
- [ -x $url_handler_file ] &&
- URL_PREFIX=`echo $url_handler_file | sed "s/.*\/url_//"` &&
+ [ -x $url_handler_file ] &&
+ URL_PREFIX=`echo $url_handler_file | sed "s/.*\/url_//"` &&
URL_TYPES[${#URL_TYPES[@]}]=$URL_PREFIX &&
. $url_handler_file
done
@@ -128,7 +128,7 @@ function url_download_expand_sort() {
# limit and doing netselect on that many urls is absurd
expanded_urls=$(echo "$expanded_urls"|head -n 50)
debug "liburl" "expanded urls $expanded_urls"
- # sort urls
+ # sort urls
url_sort_urls sorted_urls "$expanded_urls"
if ! [[ "$sorted_urls" ]] ; then
message "No sorted urls! If you get this it is a sorcery bug"
@@ -153,7 +153,7 @@ function url_download_expand_sort() {
##
## @return 0 if file could be downloaded
## @return 1 otherwise
-## Downloads the specified url. Returns true if file could be
+## Downloads the specified url. Returns true if file could be
## downloaded, false otherwise.
##
##
@@ -192,7 +192,7 @@ function url_download() {
message "Failed to find a download handler for $url, this is likely to
be a sorcery bug"
fi
done
-
+
# sort buckets, someday a better algorithm may be used, however
# this should be sufficient for now.
buckets=$(hash_get_table_fields dl_buckets|sort)
@@ -291,7 +291,7 @@ function url_rank() {
# want netselect to find the fastest one

# The take home message is that a url can be /any/ random string of text,
- # and a url is officially defined by its handler.
+ # and a url is officially defined by its handler.

# So we are having the handler give us the netselected output
# from there we are sticking things into an array and letting
@@ -318,7 +318,7 @@ function url_rank() {
}
}')
done
-
+
# since we put things in url_speed indexed by speed, the * should
# expand back in sorted order

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

#---------------------------------------------------------------------
## @Type Private
-## @param url
+## @param url
## @Stdout url prefix
## @return 0 valid url
## @return 1 otherwise
@@ -374,7 +374,7 @@ function url_get_prefix() {

#---------------------------------------------------------------------
## @Type Private
-## @param url
+## @param url
## @param url prefix
## @stdout url sans prefix
#---------------------------------------------------------------------
@@ -389,7 +389,7 @@ function url_strip_prefix() {
#---------------------------------------------------------------------

#---------------------------------------------------------------------
-## @param url
+## @param url
## @stdout dl handler
##
## Get the download handler for this url
@@ -400,7 +400,7 @@ function url_bucketize() {
}

#---------------------------------------------------------------------
-## @param url
+## @param url
##
## Parse the url somehow. The results are url specific right now,
## this is usually only called by dl handlers who know what url types
@@ -424,7 +424,7 @@ function url_expand() {
}

#---------------------------------------------------------------------
-## @param url
+## @param url
##
## Verify the url, this usually means going out to the internet and
## somehow determining if the link is good.
@@ -435,7 +435,7 @@ function url_verify() {
}

#---------------------------------------------------------------------
-## @param url
+## @param url
## @Stdout url hostname
## @return 0 valid url
## @return 1 otherwise
@@ -449,7 +449,7 @@ function url_hostname() {
}

#---------------------------------------------------------------------
-## @param url
+## @param url
## @Stdout url netslect output
## @return 0 valid url
## @return 1 otherwise



  • [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (6e6d793a3929575752793e9cfc222a0e4443dc78), Jaka Kranjc, 01/15/2008

Archive powered by MHonArc 2.6.24.

Top of Page