[SM-Commit] GIT changes to devel-stage-root sorcery by David Brown (0354c476422f7b37d71d2d973dda6f97d6ed6221)

David Brown scm at mail.sourcemage.org
Thu Oct 19 11:47:03 EDT 2006


GIT changes to devel-stage-root sorcery by David Brown <dmlb2000 at kajit-master.(none)>:

 ChangeLog                                        |  224 ++++++++++++++
 convert                                          |    2 
 etc/sorcery/config                               |   26 -
 etc/sorcery/mirrors/KDE                          |    6 
 etc/sorcery/mirrors/KERNEL                       |  248 ++++++----------
 etc/sorcery/mirrors/PERL_CPAN                    |  151 ++++++++++
 etc/sorcery/version                              |    2 
 usr/sbin/alter                                   |   14 
 usr/sbin/cast                                    |   45 +-
 usr/sbin/cleanse                                 |   98 +++---
 usr/sbin/delve                                   |   24 -
 usr/sbin/dispel                                  |   96 +++---
 usr/sbin/gaze                                    |  346 +++++++++++------------
 usr/sbin/scribbler                               |   10 
 usr/sbin/scribe                                  |   30 -
 usr/sbin/sorcery                                 |   99 +++---
 usr/sbin/summon                                  |   26 -
 usr/share/man/man1/gaze.1                        |    4 
 usr/share/man/man8/cast.8                        |    2 
 usr/share/man/man8/cleanse.8                     |   10 
 var/lib/sorcery/archspecs/amd64/x86_32           |   11 
 var/lib/sorcery/archspecs/amd64/x86_64           |   14 
 var/lib/sorcery/archspecs/arm/sa11xo             |    5 
 var/lib/sorcery/archspecs/arm/xscale             |    5 
 var/lib/sorcery/archspecs/ia32/amd/athlon        |    9 
 var/lib/sorcery/archspecs/ia32/amd/athlon-4      |    9 
 var/lib/sorcery/archspecs/ia32/amd/athlon-mp     |    9 
 var/lib/sorcery/archspecs/ia32/amd/athlon-tbird  |    9 
 var/lib/sorcery/archspecs/ia32/amd/athlon-xp     |    9 
 var/lib/sorcery/archspecs/ia32/amd/k6            |    9 
 var/lib/sorcery/archspecs/ia32/amd/k6-2          |    9 
 var/lib/sorcery/archspecs/ia32/amd/k6-3          |    9 
 var/lib/sorcery/archspecs/ia32/c3/ezra           |   11 
 var/lib/sorcery/archspecs/ia32/c3/ezra-t         |   11 
 var/lib/sorcery/archspecs/ia32/c3/nehemiah       |   11 
 var/lib/sorcery/archspecs/ia32/c3/samuel2        |   11 
 var/lib/sorcery/archspecs/ia32/i386              |    5 
 var/lib/sorcery/archspecs/ia32/i486              |    5 
 var/lib/sorcery/archspecs/ia32/i586              |    5 
 var/lib/sorcery/archspecs/ia32/i686              |    5 
 var/lib/sorcery/archspecs/ia32/intel/pentium     |    9 
 var/lib/sorcery/archspecs/ia32/intel/pentium-mmx |    9 
 var/lib/sorcery/archspecs/ia32/intel/pentium2    |    9 
 var/lib/sorcery/archspecs/ia32/intel/pentium3    |    9 
 var/lib/sorcery/archspecs/ia32/intel/pentium3m   |   11 
 var/lib/sorcery/archspecs/ia32/intel/pentium4    |    9 
 var/lib/sorcery/archspecs/ia32/intel/pentium4m   |   11 
 var/lib/sorcery/archspecs/ia32/intel/pentiumpro  |    9 
 var/lib/sorcery/archspecs/ppc/g3                 |    5 
 var/lib/sorcery/archspecs/ppc/g3+                |    5 
 var/lib/sorcery/archspecs/ppc/g4                 |    9 
 var/lib/sorcery/archspecs/ppc/g4+                |    9 
 var/lib/sorcery/archspecs/ppc/g5                 |    5 
 var/lib/sorcery/archspecs/ppc/g5-64              |    5 
 var/lib/sorcery/archspecs/sparc/sun4c            |    5 
 var/lib/sorcery/archspecs/sparc/sun4d            |    5 
 var/lib/sorcery/archspecs/sparc/sun4m            |    5 
 var/lib/sorcery/archspecs/sparc/sun4m64          |    5 
 var/lib/sorcery/archspecs/sparc/sun4u            |    5 
 var/lib/sorcery/archspecs/sparc/sun4u64          |    5 
 var/lib/sorcery/archspecs/superh/sh4             |    5 
 var/lib/sorcery/modules/build_api/api1           |   55 ---
 var/lib/sorcery/modules/build_api/api2           |   86 +----
 var/lib/sorcery/modules/build_api/common         |   14 
 var/lib/sorcery/modules/libapi                   |  289 ++++++++-----------
 var/lib/sorcery/modules/libcast                  |    9 
 var/lib/sorcery/modules/libcodex                 |   34 +-
 var/lib/sorcery/modules/libdepends               |  181 +++++-------
 var/lib/sorcery/modules/libdispel                |   36 --
 var/lib/sorcery/modules/libdownload              |    2 
 var/lib/sorcery/modules/libhash                  |    2 
 var/lib/sorcery/modules/liblock                  |   58 +--
 var/lib/sorcery/modules/libmisc                  |   22 -
 var/lib/sorcery/modules/libresurrect             |   20 -
 var/lib/sorcery/modules/libscreen                |    6 
 var/lib/sorcery/modules/libsecurity              |    4 
 var/lib/sorcery/modules/libsorcery               |   58 +--
 var/lib/sorcery/modules/libspell                 |  207 +++++++++++++
 var/lib/sorcery/modules/libstage                 |   91 +++++-
 var/lib/sorcery/modules/libstate                 |    9 
 var/lib/sorcery/modules/libsummon                |   11 
 var/lib/sorcery/modules/libtablet                |    2 
 var/lib/sorcery/modules/libtrack                 |    4 
 var/lib/sorcery/modules/libtriggers              |    6 
 var/lib/sorcery/modules/libunpack                |    2 
 var/lib/sorcery/modules/liburl                   |   16 -
 86 files changed, 1554 insertions(+), 1453 deletions(-)

New commits:
commit 432f172130f8d7697d6a95681248c59880123475
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    fix bug 12966, add spell paths to gaze dependencies environment

commit e3ee5b57d89d2fd40770a8f5176d4b7abebe40c3
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    fix bug 13092

commit bd6a0d952168bf329888d066e105ebaf8b2b0c99
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    fix bug 13026

commit 7a70c2f913ca65c43a17d8de709396da2f73fdd8
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    add new perl-cpan mirror list

commit 91821f4bedf51a11496bcde43dc29129ba47127e
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    propagate failures from file sourcing properly, fix date in changelog
    (which no-one caught :-) ).

commit 0c188901d5eeb624e5b215dded5abebd6f559a21
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    add license

commit 1693807b4c35b0262f4ba9c309d4cae516f7b9e3
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    update changelog

commit ad1ff42eefded2d8c6a366115d0979abdc8b5190
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    more changes for 10914
    any spell file can have a <FILENAME>_CMD in DETAILS, except PREPARE by nature
    added a way for sorcery to specify a message to run if the spell file
    exists -- wont work particularly well for section/grimoire files though
    updated libapi docs

commit 748bed1b3b8ad4f69669952a2f73e3a16e9c24c8
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    add sanity check to libdepends

commit c2105553843df19c00cf8bbec35a6204df9c780c
Author: Paul Mahon <pmahon at sourcemage.org>
Commit: Paul Mahon <pmahon at sourcemage.org>

    cast: Shorten screen names (fixes bug #12133)

commit 97a79fe3d26e7b5433b868139ebd6f8899b08c39
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    fix bug 12978, remove dead kde mirrors

commit 5d64e05fe4b8bf079569f4bae052d1828fc836c5
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    fix poland mirror typo

commit eebb6c54bb7f258f1d50ac2e2c8db01e67483979
Author: David Brown <dmlb2000 at kajit-master.(none)>
Commit: David Brown <dmlb2000 at kajit-master.(none)>

    updated cleanse man page to include --nofix and --nofix_quick

commit 8db432230407418cfdcda478acb02deb6fd15047
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    fix bug 12862

commit ffa3356d87fd8279ac98981c6876018eabda4d51
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    fix bug 12904

commit 9f69e82636ccb7e91cacf0fcad0f25982c3d1599
Author: David Brown <dmlb2000 at dmlb2000.(none)>
Commit: David Brown <dmlb2000 at dmlb2000.(none)>

    added installwatch debug level variable to config and libtrack so people can turn it down

commit a73b5974439e352494068ef24b7c156bd7ca56cb
Author: David Brown <dmlb2000 at kajit-master.(none)>
Commit: David Brown <dmlb2000 at kajit-master.(none)>

    libstage added fifo permission preservation

commit 3446ec29937fa20b050407927874664bd56c5aa3
Author: David Brown <dmlb2000 at kajit-master.(none)>
Commit: David Brown <dmlb2000 at kajit-master.(none)>

    libstage chown calls and output fixes bug #12821

commit 4631bb891b672983e17612b6868700b780da1f5e
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    fix bug 12847, fix gaze argument parsing

commit 127a9042b6220ae571ad509ddf207730d2f24cba
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    fix typo

commit 2419d1e317e24a432e669c617b245e0c9c717b08
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    remove archspecs, users should get them from smgl-archspecs

commit cae4d9f925bbd6339784efd0ece3b493f2f3c1a6
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    fix bugs 12818 and 12805

commit c3ac03cf93133df66759a14c721180771c5788c4
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    check for directory before running find on it. Also simplify the code.

commit b2a9922729cf5773729585086cdff2480a915d28
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    further enhancements for bug 11864

commit 134bdc86e2801bc03b664f0babbbd7dba7654464
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    most of the alpha-level work for bug 10914, seems to work, needs more testing

commit 3fad0c2427f7da87e5303b4f18b56500c0833b56
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    simplify logic

commit 0f5d3ba298af1f24d3943d435cab659c9a7b7da7
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    libsorcery fixed query to also include the the check for cleanse

commit 922936209b107808c9402686b2c6ae3edf091432
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed spaces in the previous commit

commit 59532c6df135148c4f020a545179b5e61540bfc5
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    libsorcery fixed the update sorcery scripts to check return value after cast basesystem and either exit or continue if it fails

commit 3701246c74ef91803b836feb8238b67d1cd44dd1
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    added changelog entry for white space fixing

commit a62d8c53bbb4ce3a6da0bedcdaae2aa9d16442b1
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed whitespace in liburl

commit 4141826f7c7bc21f4e682821c06e40ecc40c54d9
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed whitespace in libunpack

commit a1231301e6c7ee2ea4e818a0cb90939e7980c567
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed whitespace in libtrack

commit 8c30a95ab8a670731fb88f94b9fa6ca3cda97680
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed whitespace in libtablet

commit 9e1103b3d0a355a340a54d2427293fa046c58d40
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed whitespace in libstage

commit 730ca6c2bf581eb550321a3b99af73b41e8aadbd
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed whitespace in libsorcery

commit f16d0bf4480c5517bf720835a12de677c40c6231
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed whitespace in libsecurity

commit 27b802a58fec54adeb04877810d8566b11aea2b0
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed whitespace in libscreen

commit 347d68273bfb295dda029245d3557927288e7087
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed whitespace in libresurrect

commit 0873e9a6506a2b8be136bca57d27712c66ccd045
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed whitespace in libmisc

commit f25a9313fafb2e5d9d144aa41ba6369b0ca1d795
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed whitespace in liblock

commit f5b9adc25204d4816f7e8e801deeca9a56661235
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed whitespace in libhash

commit 5e0e6a5c65f8d14443ed69cfee15c43decd69f0e
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed whitespace in libdownload

commit b5380a13ccde9d5e7e9fa2281cbb04f2bd63ad86
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed whitespace in libdispel

commit 895cd983d5e58bd728db7f27b6e99dbd952016b0
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed whitespace in libdepends

commit f660508dd258f09a1a34a5469234be5abb47600b
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed whitespace in libcodex

commit 59a20a2e66d8491ab18bbc2fd8ada35364a83bd3
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed whitespace in libcast

commit 092dff7a270690904238b5db4f7201aaa7dd90be
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed whitespace in libapi

commit 8583fc43eed7e9f990916ddd6d90ca8744b21ad0
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed whitespace in common

commit 4bf89961f52949b32f19281ff75fee5c7136222b
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed whitespace in summon

commit 787dc28ef2b8005d0d968e0d1b764731046dac23
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed whitespace in sorcery

commit f329349a7600266b570c204ad88cde349c900e15
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed whitespace in scribe

commit 6e98b9ed2f69444e20ecf7ceb950a20cfcff2c9f
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed whitespace in scribbler

commit 690a6df780dfebddad016225b94c9ae726d4333e
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed whitespace in gaze

commit d09bc8c9689f7bb767df8e33dab4f8b11aa84957
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed whitespace in dispel

commit 8a6061e1229eab0f9604cc9cf408b79b552a2cfc
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed whitespace in cleanse

commit 15a43af53e6a5c0ab2cd61ca51dc32709db9e3ea
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed whitespace in cast

commit 6e5b530a6ce342ba290b8b52067ce0fa95f8d71f
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed whitespace in alter

commit d98a125b5182a4dea51e2ce0c9fe1e9d4e83627f
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed whitespace in config

commit 695bf5c0bffc86cbcf0276ddecdff78791a9cb7b
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed whitespace in convert

commit a4fde6d34aa28e59effb44f339d52e7381b473d9
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    always persistent_save

commit aaa294ff29d32c8f3ad8e39698da9df4ea79e6ff
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    added progress bar to sorcery -q and fixed a tab in the changelog

commit a1cf1f792af5d4048129c752d4afcbe4652a490c
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    moved prepare_stage_root to inside the STAGED_INSTALL check because installwatch doesn't need stage root created before its invoked anymore

commit ff3324221e262ea9502eddcc55853d417004cb08
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    added functions for block character and fifos making new files in the system instead of moving them

commit ba3cdd87aa2e81818c40e9e70ec011df9a177998
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    added fix for named pipes and moving them back to the system instead of copying them

commit 2c9b9f47db1868000fcd2f14a4b4b7adf6cd7d5a
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    fix bug 12671, typo in gaze patchlevels

commit 84395092ec9d71b8a8e711adcbb42d3db3420788
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    fix bug 12670, patch from Jaka Kranjc, gaze patchlevels doesnt work with
    uninstalled spells.

commit 1a895865f8a2cffed5dd8ddd77c23889cdf5bc72
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    fix bug 12669, codex_does_spell_exist wasnt handling no or empty string
    parameters

commit 981219f332e71752f1e078031a435fff357bb3a3
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    fix bug 12667, use xargs in case there are too many install logs

commit f4533ca4cec8d7fd864850b43c118f5235b24f79
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    fix bug 12664, gaze dependencies now handles -sub syntax

commit 66a03f5388895ee31c3b62584d8b0142d63917ed
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    fix bug 12638, fix wording in dispel

commit 230e693dcfc5cbc55fd227e1e5d84afda49a523d
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    fix bug 11853, minor spelling fixes, also remove ancient pam specific stuff

commit ecec7ab09a42c23e4ede12c6d9dd2c9affaec8d8
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    removed the code to create the stage root for parts that used to need it but doesn't anymore because we removed the code in installwatch that checks for it

commit 91d8189f82a361767b06b7bd20be83dfdaefcdff
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    moved stage root creation inside the stage install check

commit c8b94d2053ff1c712643b16fa998698c5b6ad4e5
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    added output for installwatch debug log

commit 8e2692fc71d86671ffe5dd56f336dfd36721a00e
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    fix LD_LIBRARY_PATH

commit 63b5a723e5e1eb01cee7cb3601045c893101afd9
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    Tidy up changelog

commit 344390a0c1954258081d42cf593cde51c27a9c32
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    fixed changelog entry to be more descriptive

commit 309a1d1aa4f89bfcb9c6c6c698f4aff0817dd582
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    minor fixes to the ChangeLog entry for stage root code

commit 1a584dd623b838aa37627ca93a7aba8c0ea62977
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    added changelog entry for stage root code

commit 992936a056928237f451d5fffc85a5324c3f47bb
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    added changelog entry for git url and http handlers

commit 672d671107de71407c9ecdff8459ae460ca7ec4e
Author: David Brown <dmlb2000 at gmail.com>
Commit: David Brown <dmlb2000 at gmail.com>

    KERNEL mirror list cleanup

commit e6e86a7f9dc638fb3144579c9674f09c248b3418
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    "merge" from stage-root branch
    ----------------
    Squashed commit log:
    
        commit d3fa2b1dae96653287bac89da260d1896f09835c
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Tue Jun 20 20:37:58 2006 -0700
    
            updated save_binaries to not have problems with symlinks... and also updated the hack to go along with it
    
        commit e2d740dd0d216b731cfcfa8cf6fa8cb1e3326071
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Sun Jun 18 16:08:36 2006 -0700
    
            didn't add the translation directory to the path for setting stage directory paths
    
        commit 5c7c1affe72a8effa36d62654710975e3440032c
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Sun Jun 18 16:06:17 2006 -0700
    
            added save_binaries function and the dirty hack to make it work
    
        commit 44bf3bab534ac66e815d46c27592be088f114e0c
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Thu Jun 15 17:57:04 2006 -0700
    
            updated to create installwatch dbglog files along with the compile log
    
        commit cc3cfc9a02c12ec93c9e4994a12fc7f10af49402
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Tue Jun 13 17:55:01 2006 -0700
    
            updated grimoire man page to reflect some of the security changes required of POST_INSTALL to access files in the stage area
    
        commit 6273271c047eedaf97c66d7e4b5672c11ee2bd54
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Tue Jun 13 17:36:24 2006 -0700
    
            updated to cd to stage directory instead of including transl this will make spells try to access files with the prefix transl which could be a default safety check
    
        commit a9323f0ef33388d2a4f16e09f2564ee55c479fd7
        Merge: 108ae4e... 2062bee...
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Tue Jun 13 17:16:43 2006 -0700
    
            resolved conflicts with andrews fix
    
        commit 108ae4efe085ffe8e1c1d46924a434a75703ac30
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Tue Jun 13 17:14:52 2006 -0700
    
            removed lots of the && that were causing parse errors
    
        commit ed87c0e1a24b19c2a79af097703112c6b5eeddfb
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Tue Jun 13 15:16:03 2006 -0700
    
            added quotes everywhere fixed cd'ing to home instead of install root by adding / and removed the rm's during staging because it's not needed and calling rm in random places could cause problems
    
        commit 042cbc750952e570c0692a56acad0fc1754e2346
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Tue Jun 13 15:07:40 2006 -0700
    
            if removing source dir fails don't fail to remove the stage directory
    
        commit 2062bee451541700a391b2e5de132b54d0929cf8
        Author: Andrew Stitt <astitt at sourcemage.org>
        Date:   Tue Jun 13 14:24:06 2006 -0700
    
            fix api2 to properly change directories when there is no stage-root
    
        commit a27ed36c2c2c780eda1c72ace9f67a6a40b824ae
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Mon Jun 12 19:48:58 2006 -0700
    
            updated grimoire man page to reflect the stage root functionality for POST_INSTALL and the current working directories for every stage
    
        commit cfe7959183d12d74e3d6b2ddd80d26985ca5d511
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Mon Jun 12 19:09:14 2006 -0700
    
            changed checking to destroy stage root to only happen if STAGED_INSTALL is not equal to off instead of if CLEAN_SOURCE is on
    
        commit 3f56f0ffb2650090878e69072f20e90830b6cf39
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Mon Jun 12 14:18:20 2006 -0700
    
            updated to remove stage directory on spell success instead of right after its use
    
        commit 16cd77933230feb15d56e1a2efefec7c342d51c4
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Sun Jun 11 21:01:15 2006 -0700
    
            added setting the environmental vars before the delve calls
    
        commit a3d9619c4309de8aa38b96c5c6783a05db0c8dd9
        Merge: 4d5e8fb... dae12eb...
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Sun Jun 11 21:00:17 2006 -0700
    
            Merge branch 'master' of ssh://scm.sourcemage.org/smgl/sorcery into devel-stage-root
    
        commit 4d5e8fb4503f16d4f54c676c702bcfdfea45dcd7
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Sat Jun 10 23:24:12 2006 -0700
    
            updated adding the set_stage_root_paths to the states that need it
    
        commit b756d41d9b184252ded4719c042bf0218caa4a61
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Sat Jun 10 23:18:08 2006 -0700
    
            updated run_install to prepend the stage directory bin and lib files to LD_LIBRARY_PATH so things will still function
    
        commit a88b555537f831aa85566a4516b90ac52530ecea
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Sat Jun 10 23:09:17 2006 -0700
    
            moved gcc2_prepend_path to libmisc and renamed to envar_prepend_path
    
        commit 343721d2e9dc759c609aab2ee9f274c25f0705aa
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Sat Jun 10 22:37:25 2006 -0700
    
            if the spell is api1 or staged install is off this file won't be created so check if its there before moving it
    
        commit 1e016a58f4b61c18c49f5d3d1c001b6b618d154f
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Sat Jun 10 22:11:28 2006 -0700
    
            updated delve to also check the installwatch version to make sure we can stage spells
    
        commit 21215a91b354b9ed20ab97468760b3a9fd920617
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Sat Jun 10 22:08:22 2006 -0700
    
            *sigh* yeah it needs to be off if installwatch isn't able to do staging
    
        commit 8476f078cce027857ac5ed9df619d7ae34d748f5
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Sat Jun 10 21:53:03 2006 -0700
    
            swapped invoke_installwatch to after the stage directory check... and added the devoke destroy and turning off stage install before running final
    
        commit ae3be0cd26b3d9c78e6ed03692cd89f54e746463
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Sat Jun 10 21:42:54 2006 -0700
    
            this is kinda a hack but we can't remove the stage directory or installwatch will break on any system call when cast calls delve the stage root will already be created so we don't want to call mk_source_dir or it will break installwatch
    
        commit cc77953650b0d8aa6dbd50f59eb87dfd3a75e2de
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Sat Jun 10 21:41:47 2006 -0700
    
            updated libtrack to make the MINOR_VER var local in installwatch_is_stageable
    
        commit 537038e2ab9dd6254e36361f2af1d41df51bd45a
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Sat Jun 10 21:29:39 2006 -0700
    
            damnit wrong variable name
    
        commit 24ed1d815ca351ef423fcf72c381bf9e5e48ab49
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Sat Jun 10 21:18:30 2006 -0700
    
            updated to turn off stage root via the variable instead of adding the extra check at key points for stage root
    
        commit 9b11e8afa338a4055f20a98a0c38a705070b4ab6
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Sat Jun 10 21:11:05 2006 -0700
    
            updated to fix confmeld after su'ing to root dropping back down and calling main again
    
        commit 50973fa57afdddce2914c21d96048069988ef146
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Sat Jun 10 21:01:56 2006 -0700
    
            updated to add check for installwatch 6
    
        commit 498a2ca1b7cd0c78663dfde81cf9ecab23fc0e8b
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Wed Jun 7 12:33:09 2006 -0700
    
            updated TODO to reflect what's left
    
        commit eb75b4f7676c24de5a13445b790aab8fdcfce057
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Wed Jun 7 12:12:09 2006 -0700
    
            updated todo list
    
        commit cd35f4ad4879b4239f0e80a1552303a6bbc42561
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Wed Jun 7 12:11:30 2006 -0700
    
            removed tabs
    
        commit 0bbe91ae1cc3082590b6ab595a8eef28c81d130e
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Wed Jun 7 12:11:05 2006 -0700
    
            made api1 spells with stage install off explicitly
    
        commit eea1c31a1995b368d2f301b4b6fcd03a30e90fa7
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Wed Jun 7 12:10:40 2006 -0700
    
            moved pwd issues between states to the state itself and removed them from other locations
    
        commit 67f80e55ec886b53be7000138f6e351bc1de09db
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Wed Jun 7 12:09:18 2006 -0700
    
            updated confmeld with chuid code
    
        commit 3c3f16a6ada2388953a214d53d77640a56ba43bd
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Tue Jun 6 20:36:34 2006 -0700
    
            updated redundant code in libtrack and tab switch in api2
    
        commit 04604ac865982719a1f897ffa8e51b3bacad639d
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Mon Jun 5 17:09:12 2006 -0700
    
            removed url_git_git it doesn't make sense
    
        commit 13240b7852d04ba728febc4af4aec5ac147b5a2d
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Sun Jun 4 21:57:01 2006 -0700
    
            fixed depends_message to have the correct function
    
        commit afc55dd5d66ed84ca9c68bbd6c70a856505a1403
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Sun Jun 4 21:55:58 2006 -0700
    
            Revert "forgot to merge these changes"
            got the wrong duplicate function
    
            This reverts 914c288d36e36a5a4cfc1cc906d4527a19d9f8cc commit.
    
        commit 914c288d36e36a5a4cfc1cc906d4527a19d9f8cc
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Sun Jun 4 21:53:15 2006 -0700
    
            forgot to merge these changes
    
        commit 40073a02f69ad6f3d8f8e84c3dba170d2eb216b4
        Merge: a26fced... 51a6d3e...
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Sun Jun 4 21:48:31 2006 -0700
    
            merged changes from devel manually
    
        commit a26fced35621bd68cf52ce4f210cf9d0e7250836
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Mon May 29 16:42:36 2006 -0700
    
            factor cast --queue code out of argument parsing, doing this fixes the
            return code issues
            (cherry picked from ee80631dbd1695bf18fd00a205ec128ec339d469 commit)
    
        commit 9de0e8a8903c4d44628e217f8d14b6ab83636d33
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Mon May 29 16:41:27 2006 -0700
    
            forgot *
            (cherry picked from 6ee1f91f1f4aac4ed00f5c68b8be23f79e2e978e commit)
    
        commit a3ca518f37a988f013f101f8e7f6edb40e0da8c5
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Mon May 29 16:40:34 2006 -0700
    
            fix bug 12327
            (cherry picked from 26a9582e7352c6ed49874c22d56b7dab877b74f7 commit)
    
        commit 09615f85b4596804c8c739e8fa1d4d90274166bb
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Mon May 29 16:39:42 2006 -0700
    
            workaround bash 3.0 brokenness
            (cherry picked from 5bbff845c2c92fbdd7f3b1b78db17f05dbba8877 commit)
    
        commit 2f2c3ac210f3fde93ff7977b378ea52854eda7ee
        Author: Andrew Stitt <astitt at sourcemage.org>
        Date:   Sun May 28 14:05:00 2006 -0700
    
            fix bug 11902, multi-spell conflicts
            (cherry picked from f70b117c83926df0af3b134778c1bc13810c5ae2 commit)
    
        commit cd6843adb7ebad10a074042772c21906d97da058
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Mon May 29 16:38:28 2006 -0700
    
            fix bug 11864, add gaze system-info
            (cherry picked from 3fe57aca0c3a80d78785a3636e3fb7841647450c commit)
    
        commit 868e7ec49a464b158b2231c959e3b521291e34c2
        Author: Andrew Stitt <astitt at sourcemage.org>
        Date:   Wed May 24 23:29:53 2006 -0700
    
            fix bug 10459, make gaze maintainer show the grimoire
            (cherry picked from 2c96a46d5ec5175656ae0aff21ee5ce5ab9f18d1 commit)
    
        commit 7cc2cfe20d5b940e82b016f7669f60270b436c08
        Author: Andrew Stitt <afrayedknot at thefrayedknot.(none)>
        Date:   Tue May 23 09:47:00 2006 -0700
    
            update build to work with git (first real git based commit)
            (cherry picked from dd55abb091f02a130784f20528daec1150f7f65b commit)
    
        commit 943bc8f42b4b3600b5a009e49c0b70006d6f7a82
        Author: David Brown <dmlb2000 at gmail.com>
        Date:   Mon May 29 16:21:22 2006 -0700
    
            when dealing with anything other than config files we should force the cp just in case the file is in use, this is for spells like bash
    
        commit 264f98210d2363dcde58e6f8f3ee53305b2eb0a6
        Author: David Brown <dmlb2000 at dmlb2004>
        Date:   Thu May 25 20:17:50 2006 -0700
    
            ------------------------------------------------------------
            revno: 41
            committer: David Brown <dmlb2000 at dmlb2004>
            branch nick: stage-root
            timestamp: Sun 2006-05-14 20:55:44 -0700
            message:
              updated bzr pull to pull from the tag specified
    
        commit 4fe6ed1d5f7c6960bb7a7d0391fca395c0bde461
        Author: David Brown <dmlb2000 at dmlb2004>
        Date:   Thu May 25 20:17:49 2006 -0700
    
            ------------------------------------------------------------
            revno: 40
            committer: David Brown <dmlb2000 at dmlb2004>
            branch nick: stage-root
            timestamp: Sun 2006-05-14 11:00:51 -0700
            message:
              typo fixes
    
        commit 452f76d02e9335e996360e77a33304f82343b18f
        Author: David Brown <dmlb2000 at dmlb2004>
        Date:   Thu May 25 20:17:48 2006 -0700
    
            ------------------------------------------------------------
            revno: 39
            committer: David Brown <dmlb2000 at dmlb2004>
            branch nick: stage-root
            timestamp: Sun 2006-05-14 10:50:58 -0700
            message:
              added use of GIT_TAG which should really be GIT_BRANCH but it works the same
    
        commit 230214885ced298d77251529f74dbe3ce7602b99
        Author: David Brown <dmlb2000 at dmlb2004>
        Date:   Thu May 25 20:17:47 2006 -0700
    
            ------------------------------------------------------------
            revno: 38
            committer: David Brown <dmlb2000 at dmlb2004>
            branch nick: stage-root
            timestamp: Sun 2006-05-14 10:44:44 -0700
            message:
              forgot to strip off git_http instead of git
    
        commit 4ea223a4d4dc13065e3f78e56ce13cd2cfebf99c
        Author: David Brown <dmlb2000 at dmlb2004>
        Date:   Thu May 25 20:17:46 2006 -0700
    
            ------------------------------------------------------------
            revno: 37
            committer: David Brown <dmlb2000 at dmlb2004>
            branch nick: stage-root
            timestamp: Sun 2006-05-14 10:40:59 -0700
            message:
              moved git_git back not needed and forgot a function in url_git_http
    
        commit 4308efaa100461a64dde56672188410dba3373c2
        Author: David Brown <dmlb2000 at dmlb2004>
        Date:   Thu May 25 20:17:45 2006 -0700
    
            ------------------------------------------------------------
            revno: 36
            committer: David Brown <dmlb2000 at dmlb2004>
            branch nick: stage-root
            timestamp: Sun 2006-05-14 10:38:36 -0700
            message:
    ...

commit 8a15f3839f2acbdfde6f6facd864e4f6d1f6590e
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    try to fix all the list searching greps. Translate spaces to newlines
    so we can just use grep -x.

commit 23955205a2c2c4f239fdf1a3ec3f77b6819c971b
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Andrew Stitt <astitt at sourcemage.org>

    add trivial function to walk inheritence tree

diff --git a/ChangeLog b/ChangeLog
index cf0fdb6..fc7105e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,224 @@
+2006-09-25 Andrew Stitt <astitt at sourcemage.org>
+	* gaze: add standard spell paths to gaze dependencies environment
+	  bug 12966
+
+2006-09-25 Andrew Stitt <astitt at sourcemage.org>
+	* gaze: run show_up_depends with verbose parameter (bug 13092)
+	* libdepends: print all edges in verbose mode, andendum to bug 13092
+
+2006-08-28 Andrew Stitt <astitt at sourcemage.org>
+	* libdepends: rename default_trigger_check to
+	  default_sorcery_trigger_check, bug 13026.
+
+2006-08-28 Andrew Stitt <astitt at sourcemage.org>
+	* etc/sorcery/mirorr/PERL_CPAN: add new mirror list
+	* sorcery: add new mirror list to dialog
+
+2006-08-21 Andrew Stitt <astitt at sourcemage.org>
+	* libspell: propagate return code properly
+
+2006-08-20 Andrew Stitt <astitt at sourcemage.org>
+	* libspell: new library for all spell execution (except DETAILS
+	  for now). Handles inheritence scheme and creates function stubs
+	  automatically for every file. Fixes bug 10914.
+	* build_api/api1, build_api/api2, libcast, libdepends, libdispel,
+	  libsummon, libtriggers: remove old file execution code,
+	  and use run_spell_file
+	* libapi: update documentation, add blurb about default_*_<filename>
+	  functions. Remove no-op stubs since they exist for everything
+	  implicitly. Change default_<filename> functions to
+	  default_sorcery_<filename> to remove confusion.
+
+2006-08-19 Andrew Stitt <astitt at sourcemage.org>
+	* libdepends: raise an error if a spell or provider name contains
+	  a space
+
+2006-08-13 Paul Mahon <pmahon at sourcemage.org>
+	* cast: shorten screen names (fixes bug #12133)
+
+2006-08-12 Andrew Stitt <astitt at sourcemage.org>
+	* mirrors/KDE: remove dead mirrors, bug 12978
+
+2006-08-06 Andrew Stitt <astitt at sourcemage.org>
+	* mirrors/KDE: fix typo in poland mirror
+
+2006-08-05 David Brown <dmlb2000 at gmail.com>
+	* cleanse.8: added --nofix and --nofix_quick descriptions.
+
+2006-07-29 Andrew Stitt <astitt at sourcemage.org>
+	* libdepends: fix bug 12862, change default behavior of show_up_depends
+
+2006-07-29 Andrew Stitt <astitt at sourcemage.org>
+	* libstate: fix bug 12904, get_depends_options is broken with
+	  spellnames containing regexp characters. Patch from Jaka Kranjc
+
+2006-07-24 David Brown <dmlb2000 at gmail.com>
+	* libstage: added config var for the debug level
+	* config: added the installwatch debug level variable and a comment for
+	  valid values.
+
+2006-07-23 David Brown <dmlb2000 at gmail.com>
+	* libstage: added fifo permission preservation and output
+
+2006-07-23 David Brown <dmlb2000 at gmail.com>
+	* libstage: added output of owner and group to making files in the
+	  system also added a readlink call to the output of symlink also
+	  added chown of fifo's blocks and directories (fixes bug #12821)
+
+2006-07-15 Andrew Stitt <astitt at sourcemage.org>
+	* gaze: show help when unknown option encountered, bug 12847
+
+2006-07-15 Andrew Stitt <astitt at sourcemage.org>
+	* archspecs: remove, users should get them from smgl-archspecs now
+
+2006-07-10 Andrew Stitt <astitt at sourcemage.org>
+	* build_api/common: export a hidden variable to delve
+	* delve: check for hidden variable and assume that we're running
+	  inside cast has already provided certain things to us already (OPTS)
+	  fixes bugs 12818 and 12805
+
+2006-07-03 Andrew Stitt <astitt at sourcemage.org>
+	* build_api/common: only append to PATH if the saved binaries dir exists
+
+2006-07-03 Andrew Stitt <astitt at sourcemage.org>
+	* gaze: add uninstalled basesystem depends info to system-info
+	* libdepends: expand compute_installed_*_depends to allow status
+	  based selection
+
+2006-07-01 David Brown <dmlb2000 at gmail.com>
+	* libsorcery: fixed query from previous commit to include a check for
+	  cleanse as well
+
+2006-07-01 David Brown <dmlb2000 at gmail.com>
+	* libsorcery: added query to update_sorcery_scripts to check return
+	  value from cast and ask user if they want to continue
+
+2006-07-01 David Brown <dmlb2000 at gmail.com>
+	* convert: fixed whitespace removed tabs
+	* etc/sorcery/config: fixed whitespace removed tabs
+	* alter: fixed whitespace removed tabs
+	* cast: fixed whitespace removed tabs
+	* cleanse: fixed whitespace removed tabs
+	* dispel: fixed whitespace removed tabs
+	* gaze: fixed whitespace removed tabs
+	* scribbler: fixed whitespace removed tabs
+	* scribe: fixed whitespace removed tabs
+	* sorcery: fixed whitespace removed tabs
+	* summon: fixed whitespace removed tabs
+	* build_api/common: fixed whitespace removed tabs
+	* libapi: fixed whitespace removed tabs
+	* libcast: fixed whitespace removed tabs
+	* libcodex: fixed whitespace removed tabs
+	* libdepends: fixed whitespace removed tabs
+	* libdispel: fixed whitespace removed tabs
+	* libdownload: fixed whitespace removed tabs
+	* libhash: fixed whitespace removed tabs
+	* liblock: fixed whitespace removed tabs
+	* libmisc: fixed whitespace removed tabs
+	* libresurrect: fixed whitespace removed tabs
+	* libscreen: fixed whitespace removed tabs
+	* libsecurity: fixed whitespace removed tabs
+	* libsorcery: fixed whitespace removed tabs
+	* libstage: fixed whitespace removed tabs
+	* libtablet: fixed whitespace removed tabs
+	* libtrack: fixed whitespace removed tabs
+	* libunpack: fixed whitespace removed tabs
+	* liburl: fixed whitespace removed tabs
+
+2006-07-01 David Brown <dmlb2000 at gmail.com>
+	* libsorcery: update_install_queue added progress bar so we have
+	  some idea of how long it takes to queue up spells
+
+2006-07-01 David Brown <dmlb2000 at gmail.com>
+	* delve: moved making stage root directory to inside the 
+	  STAGED_INSTALL check not needed anymore since installwatch
+	  doesn't need stage_root before it's invoked
+
+2006-06-26 David Brown <dmlb2000 at gmail.com>
+	* libstage: added functions for installing block character
+	  and fifos instead of moving them we make new ones in the
+		system
+
+2006-06-26 David Brown <dmlb2000 at gmail.com>
+	* libstage: added function for pipes using mv instead of cp
+
+2006-06-26 Andrew Stitt <astitt at sourcemage.org>
+	* cast: spelling fixes for bug 11853
+	* cast, gaze, cast.1, gaze.1, libsorcery: remove pam stuff
+	* dispel: fix bug 12638, fix wording for recasting without
+	  missing optionals
+	* gaze: fix bug 12664, make gaze dependencies handle -sub syntax
+	* gaze: fix bug 12667, use xargs in case there are too many install logs
+	* libcodex: fix bug 12669, handle the case where no parameters
+	  or empty parameters are passed to codex_does_spell_exist
+	* gaze: fix bug 12670, gaze patchlevels couldn't handle uninstalled
+	  spells, patch from Jaka Kranjc.
+	* gaze: fix bug 12671, typo in gaze patchlevels
+
+2006-06-25 David Brown <dmlb2000 at gmail.com>
+	* build_api/api1: removed calls to prepare and destroy stage
+	  root since we patched install watch they aren't needed
+	* build_api/api2: comment also not relevent for the above
+	  reasons
+
+2006-06-25 David Brown <dmlb2000 at gmail.com>
+	* build_api/api2: moved prepare_stage_root to inside staged
+	  install check (bug #12759)
+
+2006-06-25 David Brown <dmlb2000 at gmail.com>
+	* libcast: added output to display creation of installwatch
+	  debug log
+
+2006-06-24 Andrew Stitt <astitt at sourcemage.org>
+	* libstage: correct path for LD_LIBRARY_PATH setting
+
+2006-06-23 David Brown <dmlb2000 at gmail.com>
+	* libstage: added, contains stage root handling functions
+	* confmeld: added to handle staged config files and merge them
+	  back to the system
+	* libapi: added devoke_stage_root function so spells can turn
+	  staging off if they like
+	* build_api/api1: do minimal setup to work with installwatch7
+	* libcast: store installwatch debug file with compile logs
+	* libcodex: add path to staging directory
+	* libgcc2,libmisc: generalize path modification routine
+	* grimoire.5: added information about the current working dir
+	  for each stage in the build process
+	* etc/sorcery/config: added installwatch directories to ignore
+	* libresurrect: make install_config_files always cp if doing a 
+	  staged install (sorcery does this for all config files now)
+	* cast: exported compile log so delve can use it
+	* delve: modified so cast can call delve for the install and
+	  post install stages, adding compile log setting from the 
+	  environment, not failing if source directory isn't there, 
+	  adding stage_install stage to delve, adding mechanism to cd
+	  between build, pre_install, install stages, and creating stage
+	  directory for install stage
+	* build_api/api2: exported appropriate vars so delve can use
+	  them, added calls to delve for install and post install 
+	  stages also added prepare and destroy stage root calls, 
+	  added cd calls for each stage of build process
+	* build_api/common: added save_binaries call here, added dirty
+	  hack to fix the path after the subshell so save_binaries will
+	  work, moved the current config stage directory to a similar 
+	  dir path of the track directory, added destroying stage root
+	  to spell success and to spell failure
+	* libtrack: added invoke, devoke, prepare and destroy stage 
+	  root functions, added the appropriate new environmental vars
+	  to the invoke and devoke installwatch functions, added some
+	  cleanup code to the parse iwlog to remove double slashes at
+	  the root of the path
+	* libsorcery: save_binaries function to provide easier transition
+	  between staging spells then installing them to the system
+
+2006-06-23 David Brown <dmlb2000 at gmail.com>
+	* url_git_http: added to handle http urls
+	* url_git: added to handle branches
+
+2006-06-23 David Brown <dmlb2000 at gmail.com>
+	* KERNEL: got rid of all the bogus mirrors and ran it through sort
+	  and uniq
+
 2006-06-07 Andrew Stitt <astitt at sourcemage.org>
 	* libdepends: replace show_depends with show_up_depends (maybe
 	  we'll have a show_down_depends). Use fast implementation from
@@ -15,7 +236,8 @@
 	* gaze: add patchlevels subcommand, bug 11858
 
 2006-05-28 Andrew Stitt <astitt at sourcemage.org>
-	* cast: factor cast --queue code out of argument parsing, fixed bug 11740
+	* cast: factor cast --queue code out of argument parsing, fixed
+	  bug 11740
 
 2006-05-28 Andrew Stitt <astitt at sourcemage.org>
 	* libcast: fix bug 11902, conflicts are broken for multi-spell conflicts
diff --git a/convert b/convert
index 4b3320f..a26b1bf 100755
--- a/convert
+++ b/convert
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-SORCERY_VERSION=`gaze installed sorcery`	
+SORCERY_VERSION=`gaze installed sorcery`
 . /etc/sorcery/config
 
  case $SORCERY_URL in
diff --git a/etc/sorcery/config b/etc/sorcery/config
index 37cef26..5219da4 100755
--- a/etc/sorcery/config
+++ b/etc/sorcery/config
@@ -175,24 +175,26 @@ PROGRESS_SPINNER_CHARS='-\|/'
    DOCUMENT_DIRECTORY=${INSTALL_ROOT}/usr/share/doc
 CONFIG_STAGE_DIRECTORY=${STATE_ROOT}/var/state/sorcery/staged_configs
 
-	      # this is passed directly to installwatch so it can't contain
-	      # shell expansions or regex's
+      # this is passed directly to installwatch so it can't contain
+      # shell expansions or regex's
 INSTALLWATCH_UNSTAGED_PATHS=""
 for dir in /dev \
            /proc \
-	   /tmp  \
-	   /var/tmp \
-	   /sys \
-	   ${BUILD_DIRECTORY} \
-	   ${SGL_LIBRARY} \
-	   ${INSTALL_ROOT}/${SGL_LIBRARY} \
-	   ${SOURCE_CACHE} \
-	   ${CONFIG_CACHE} \
-	   ${STATE_DIRECTORY} \
-	   ${LOG_DIRECTORY} ; do
+           /tmp  \
+           /var/tmp \
+           /sys \
+           ${BUILD_DIRECTORY} \
+           ${SGL_LIBRARY} \
+           ${INSTALL_ROOT}/${SGL_LIBRARY} \
+           ${SOURCE_CACHE} \
+           ${CONFIG_CACHE} \
+           ${STATE_DIRECTORY} \
+           ${LOG_DIRECTORY} ; do
   INSTALLWATCH_UNSTAGED_PATHS="${INSTALLWATCH_UNSTAGED_PATHS}${dir},"
 done
 INSTALLWATCH_UNSTAGED_PATHS=${INSTALLWATCH_UNSTAGED_PATHS%,}
+# this value can be between 0-4, 0 is nothing and 4 is everything
+INSTALLWATCH_DEBUG_LEVEL=1
 
 # this makes appending the sorcery path idempotent
 [ -z ${PATH##*$SORCERY_PATH*} ] || export PATH="$PATH:$SORCERY_PATH"
diff --git a/etc/sorcery/mirrors/KDE b/etc/sorcery/mirrors/KDE
index fa99c58..369c297 100755
--- a/etc/sorcery/mirrors/KDE
+++ b/etc/sorcery/mirrors/KDE
@@ -2,14 +2,10 @@
 "Custom Mirror"		Custom
 USA			ftp://download.sourceforge.net/pub/mirrors/kde
 USA			http://download.sourceforge.net/mirrors/kde
-USA			ftp://kde.us.themoes.org/pub/kde
-USA			http://kde.us.themos.org/pub/kde
 USA			ftp://ftp.us.kde.org/pub/kde
 USA			http://ftp.us.kde.org/pub/kde
 USA			ftp://csociety-ftp.ecn.purdue.edu/pub/kde
 USA			http://csociety-ftp.ecn.purdue.edu/pub/kde
-"United Kingdom"	ftp://kde.uk.themoes.org/pub/kde
-"United Kingdom"	http://kde.uk.themoes.org/pub/kde
 "United Kingdom"	ftp://ftp.mirror.ac.uk/sites/ftp.kde.org/pub/kde
 "United Kingdom"	http://ftp.mirror.ac.uk/sites/ftp.kde.org/pub/kde
 Australia		ftp://ftp.au.kde.org/pub/kde
@@ -34,7 +30,7 @@ Germany			http://ftp-stud.fht-esslingen.
 Germany			ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/kde
 Netherlands		ftp://ftp.eu.uu.net/pub/kde
 Poland			ftp://ftp.tuniv.szczecin.pl/pub/kde
-Poland			htp://ftp.tuniv.szczecin.pl/pub/kde
+Poland			http://ftp.tuniv.szczecin.pl/pub/kde
 Poland			ftp://ftp.task.gda.pl/pub/unix/kde
 Poland			http://ftp.task.gda.pl/pub/unix/kde
 Poland			ftp://sunsite.icm.edu.pl/pub/unix/kde
diff --git a/etc/sorcery/mirrors/KERNEL b/etc/sorcery/mirrors/KERNEL
old mode 100755
new mode 100644
index 8e82a36..53a4bbb
--- a/etc/sorcery/mirrors/KERNEL
+++ b/etc/sorcery/mirrors/KERNEL
@@ -1,223 +1,181 @@
-"Master Site"		ftp://ftp.kernel.org
+"Antigua and Barbuda"	http://www.ag.kernel.org
+"Bouvet Island"		ftp://ftp.bv.kernel.org
+"Brunei Darussalam"	ftp://ftp.bn.kernel.org
+"Brunei Darussalam"	http://www.bn.kernel.org
+"Cayman Islands"		http://www.ky.kernel.org
+"Costa Rica"		http://www.cr.kernel.org
 "Custom Mirror"		Custom
-Andorra			http://www.ad.kernel.org
+"Czech Republic"	ftp://ftp.cz.kernel.org
+"Czech Republic"	http://www.cz.kernel.org
+"El Salvador"		http://www.sv.kernel.org
+"Falkland Islands (Malvinas)"	http://www.fk.kernel.org
+"Faroe Islands"		ftp://ftp.fo.kernel.org
+"Faroe Islands"		http://www.fo.kernel.org
+"French Guiana"		ftp://ftp.gf.kernel.org
+"French Guiana"		http://www.gf.kernel.org
+"Hong Kong"		ftp://ftp.hk.kernel.org
+"Hong Kong"		http://www.hk.kernel.org
+"Korea, South"		ftp://ftp.kr.kernel.org
+"Korea, South"		http://www.kr.kernel.org
+"Master Site"		ftp://ftp.kernel.org
+"Myanmar (Burma)"	ftp://ftp.mm.kernel.org
+"Myanmar (Burma)"	http://www.mm.kernel.org
+"New Zealand"		ftp://ftp.nz.kernel.org
+"New Zealand"		http://www.nz.kernel.org
+"Papua New Guinea"	ftp://ftp.py.kernel.org
+"Papua New Guinea"	http://www.py.kernel.org
+"Russian Federation"	ftp://ftp.ru.kernel.org
+"Russian Federation"	http://www.ru.kernel.org
+"Saint Pierre and Miquelon"	http://www.pm.kernel.org
+"Saint Vincent and The Grenadines"	http://www.vc.kernel.org
+"Svalbard and Jan Mayen Islands"	ftp://ftp.sj.kernel.org
+"Svalbard and Jan Mayen Islands"	http://www.sj.kernel.org
+"Turks and Caicos Islands"	http://www.tc.kernel.org
+"United Arab Emirates"	ftp://ftp.ae.kernel.org
+"United Arab Emirates"	http://www.ae.kernel.org
+"United Kingdom"	ftp://ftp.uk.kernel.org
+"United Kingdom"	http://www.uk.kernel.org
+"United States Minor Outlying Islands"	ftp://ftp.um.kernel.org
+"United States Minor Outlying Islands"	http://www.um.kernel.org
+"United States"		ftp://ftp.us.kernel.org
+"United States"		http://www.us.kernel.org
+"Virgin Islands (British)"	ftp://ftp.vg.kernel.org
+"Virgin Islands (British)"	http://www.vg.kernel.org
+"Virgin Islands (U.S.)"		ftp://ftp.vi.kernel.org
+"Virgin Islands (U.S.)"		http://www.vi.kernel.org
+"Western Sahara"	ftp://ftp.eh.kernel.org
+"Western Sahara"	http://www.eh.kernel.org
+Aland			ftp://ftp.av.kernel.org
+Aland			http://www.av.kernel.org
 Andorra			ftp://ftp.ad.kernel.org
+Andorra			http://www.ad.kernel.org
 Antarctica		http://www.aq.kernel.org
-"Antigua and Barbuda"	http://www.ag.kernel.org
-Argentina		http://www.ag.kernel.org
-"Antigua and Barbuda"	http://www.ag.kernel.org
-Argentina		http://www.ag.kernel.org
-"Antigua and Barbuda"	http://www.ag.kernel.org
-Argentina		http://www.ag.kernel.org
-"Antigua and Barbuda"	http://www.ag.kernel.org
-Argentina		http://www.ag.kernel.org
-"Antigua and Barbuda"	http://www.ag.kernel.org
-Argentina		http://www.ag.kernel.org
-"Antigua and Barbuda"	http://www.ag.kernel.org
-Argentina		http://www.ag.kernel.org
-"Antigua and Barbuda"	http://www.ag.kernel.org
-Argentina		http://www.ag.kernel.org
-"Antigua and Barbuda"	http://www.ag.kernel.org
 Argentina		http://www.ag.kernel.org
 Aruba			http://www.aw.kernel.org
-Australia		http://www.au.kernel.org
 Australia		ftp://ftp.au.kernel.org
-Austria			http://www.at.kernel.org
+Australia		http://www.au.kernel.org
 Austria			ftp://ftp.at.kernel.org
-Azerbaijan		http://www.az.kernel.org
+Austria			http://www.at.kernel.org
 Azerbaijan		ftp://ftp.az.kernel.org
-Aland			http://www.av.kernel.org
-Aland			ftp://ftp.av.kernel.org
+Azerbaijan		http://www.az.kernel.org
 Bahamas			http://www.bs.kernel.org
 Barbados		http://www.bb.kernel.org
-Belarus			http://www.by.kernel.org
 Belarus			ftp://ftp.by.kernel.org
-Belgium			http://www.be.kernel.org
+Belarus			http://www.by.kernel.org
 Belgium			ftp://ftp.be.kernel.org
+Belgium			http://www.be.kernel.org
 Belize			http://www.bz.kernel.org
 Bermuda			ftp://ftp.bm.kernel.org
-Bolivia			http://www.bo.kernel.org
 Bolivia			ftp://ftp.bo.kernel.org
-"Bouvet Island"		ftp://ftp.bv.kernel.org
-Brazil			http://www.br.kernel.org
+Bolivia			http://www.bo.kernel.org
 Brazil			ftp://ftp.br.kernel.org
-"Brunei Darussalam"	http://www.bn.kernel.org
-"Brunei Darussalam"	ftp://ftp.bn.kernel.org
-Bulgaria		http://www.bg.kernel.org
+Brazil			http://www.br.kernel.org
 Bulgaria		ftp://ftp.bg.kernel.org
-Canada			http://www.ca.kernel.org
+Bulgaria		http://www.bg.kernel.org
 Canada			ftp://ftp.ca.kernel.org
-"Cayman Islands"		http://www.ky.kernel.org
-Chile		http://www.cl.kernel.org
+Canada			http://www.ca.kernel.org
 Chile		ftp://ftp.cl.kernel.org
-China		http://www.cn.kernel.org
+Chile		http://www.cl.kernel.org
 China		ftp://ftp.cn.kernel.org
-Colombia		http://www.co.kernel.org
+China		http://www.cn.kernel.org
 Colombia		ftp://ftp.co.kernel.org
-"Costa Rica"		http://www.cr.kernel.org
-Croatia			http://www.hr.kernel.org
+Colombia		http://www.co.kernel.org
 Croatia			ftp://ftp.hr.kernel.org
-"Czech Republic"	http://www.cz.kernel.org
-"Czech Republic"	ftp://ftp.cz.kernel.org
+Croatia			http://www.hr.kernel.org
 Dominica		http://www.dm.kernel.org
-Ecuador			http://www.ec.kernel.org
 Ecuador			ftp://ftp.ec.kernel.org
-"El Salvador"		http://www.sv.kernel.org
-Estonia			http://www.ee.kernel.org
+Ecuador			http://www.ec.kernel.org
 Estonia			ftp://ftp.ee.kernel.org
-"Falkland Islands (Malvinas)"	http://www.fk.kernel.org
-"Faroe Islands"		http://www.fo.kernel.org
-"Faroe Islands"		ftp://ftp.fo.kernel.org
-Finland			http://www.fi.kernel.org
+Estonia			http://www.ee.kernel.org
 Finland			ftp://ftp.fi.kernel.org
-France			http://www.fr.kernel.org
+Finland			http://www.fi.kernel.org
 France			ftp://ftp.fr.kernel.org
-"French Guiana"		http://www.gf.kernel.org
-"French Guiana"		ftp://ftp.gf.kernel.org
-Germany			http://www.de.kernel.org
+France			http://www.fr.kernel.org
 Germany			ftp://ftp.de.kernel.org
-Greece			http://www.gr.kernel.org
+Germany			http://www.de.kernel.org
 Greece			ftp://ftp.gr.kernel.org
-Greenland		http://www.gl.kernel.org
+Greece			http://www.gr.kernel.org
 Greenland		ftp://ftp.gl.kernel.org
+Greenland		http://www.gl.kernel.org
 Grenada			http://www.gd.kernel.org
 Guadeloupe		http://www.gp.kernel.org
 Guatemala		http://www.gt.kernel.org
-Guyana			http://www.gy.kernel.org
 Guyana			ftp://ftp.gy.kernel.org
+Guyana			http://www.gy.kernel.org
 Haiti			http://www.ht.kernel.org
 Honduras		http://www.hn.kernel.org
-"Hong Kong"		http://www.hk.kernel.org
-"Hong Kong"		ftp://ftp.hk.kernel.org
-Hungary			http://www.hu.kernel.org
 Hungary			ftp://ftp.hu.kernel.org
-Iceland			http://www.is.kernel.org
+Hungary			http://www.hu.kernel.org
 Iceland			ftp://ftp.is.kernel.org
-Indonesia		http://www.id.kernel.org
+Iceland			http://www.is.kernel.org
 Indonesia		ftp://ftp.id.kernel.org
-Ireland			http://www.ie.kernel.org
+Indonesia		http://www.id.kernel.org
 Ireland			ftp://ftp.ie.kernel.org
+Ireland			http://www.ie.kernel.org
 Israel			http://www.il.kernel.org
-Italy			http://www.it.kernel.org
 Italy			ftp://ftp.it.kernel.org
+Italy			http://www.it.kernel.org
 Japan			http://www.jp.kernel.org
-Kazakhstan		http://www.kz.kernel.org
 Kazakhstan		ftp://ftp.kz.kernel.org
-"Korea, South"		http://www.kr.kernel.org
-"Korea, South"		ftp://ftp.kr.kernel.org
-Kuwait			http://www.kw.kernel.org
+Kazakhstan		http://www.kz.kernel.org
 Kuwait			ftp://ftp.kw.kernel.org
-Kyrgyzstan		http://www.kg.kernel.org
+Kuwait			http://www.kw.kernel.org
 Kyrgyzstan		ftp://ftp.kg.kernel.org
-Latvia			http://www.lv.kernel.org
+Kyrgyzstan		http://www.kg.kernel.org
 Latvia			ftp://ftp.lv.kernel.org
-Liechtenstein		http://www.li.kernel.org
+Latvia			http://www.lv.kernel.org
 Liechtenstein		ftp://ftp.li.kernel.org
-Lithuania		http://www.lt.kernel.org
+Liechtenstein		http://www.li.kernel.org
 Lithuania		ftp://ftp.lt.kernel.org
-Luxembourg		http://www.lu.kernel.org
+Lithuania		http://www.lt.kernel.org
 Luxembourg		ftp://ftp.lu.kernel.org
-Malaysia		http://www.my.kernel.org
+Luxembourg		http://www.lu.kernel.org
 Malaysia		ftp://ftp.my.kernel.org
+Malaysia		http://www.my.kernel.org
 Martinique		http://www.mq.kernel.org
 Mexico			http://www.mx.kernel.org
-Moldova			http://www.md.kernel.org
 Moldova			ftp://ftp.md.kernel.org
-Monaco			http://www.mc.kernel.org
+Moldova			http://www.md.kernel.org
 Monaco			ftp://ftp.mc.kernel.org
-"Myanmar (Burma)"	http://www.mm.kernel.org
-"Myanmar (Burma)"	ftp://ftp.mm.kernel.org
-Netherlands		http://www.nl.kernel.org
+Monaco			http://www.mc.kernel.org
 Netherlands		ftp://ftp.nl.kernel.org
-"New Zealand"		http://www.nz.kernel.org
-"New Zealand"		ftp://ftp.nz.kernel.org
+Netherlands		http://www.nl.kernel.org
 Nicaragua		http://www.ni.kernel.org
-Norway			http://www.no.kernel.org
 Norway			ftp://ftp.no.kernel.org
-Pakistan		http://www.pk.kernel.org
+Norway			http://www.no.kernel.org
 Pakistan		ftp://ftp.pk.kernel.org
+Pakistan		http://www.pk.kernel.org
 Panama			http://www.pa.kernel.org
-"Papua New Guinea"	http://www.py.kernel.org
-Paraguay		http://www.py.kernel.org
-"Papua New Guinea"	http://www.py.kernel.org
-Paraguay		http://www.py.kernel.org
-"Papua New Guinea"	http://www.py.kernel.org
-Paraguay		http://www.py.kernel.org
-"Papua New Guinea"	http://www.py.kernel.org
-Paraguay		http://www.py.kernel.org
-"Papua New Guinea"	ftp://ftp.py.kernel.org
-Paraguay		ftp://ftp.py.kernel.org
-"Papua New Guinea"	ftp://ftp.py.kernel.org
 Paraguay		ftp://ftp.py.kernel.org
-"Papua New Guinea"	ftp://ftp.py.kernel.org
-Paraguay		ftp://ftp.py.kernel.org
-"Papua New Guinea"	ftp://ftp.py.kernel.org
-Paraguay		ftp://ftp.py.kernel.org
-"Papua New Guinea"	http://www.py.kernel.org
-Paraguay		http://www.py.kernel.org
-"Papua New Guinea"	http://www.py.kernel.org
-Paraguay		http://www.py.kernel.org
-"Papua New Guinea"	http://www.py.kernel.org
-Paraguay		http://www.py.kernel.org
-"Papua New Guinea"	http://www.py.kernel.org
 Paraguay		http://www.py.kernel.org
-"Papua New Guinea"	ftp://ftp.py.kernel.org
-Paraguay		ftp://ftp.py.kernel.org
-"Papua New Guinea"	ftp://ftp.py.kernel.org
-Paraguay		ftp://ftp.py.kernel.org
-"Papua New Guinea"	ftp://ftp.py.kernel.org
-Paraguay		ftp://ftp.py.kernel.org
-"Papua New Guinea"	ftp://ftp.py.kernel.org
-Paraguay		ftp://ftp.py.kernel.org
-Peru			http://www.pe.kernel.org
 Peru			ftp://ftp.pe.kernel.org
-Philippines		http://www.ph.kernel.org
+Peru			http://www.pe.kernel.org
 Philippines		ftp://ftp.ph.kernel.org
-Poland			http://www.pl.kernel.org
+Philippines		http://www.ph.kernel.org
 Poland			ftp://ftp.pl.kernel.org
-Romania			http://www.ro.kernel.org
+Poland			http://www.pl.kernel.org
 Romania			ftp://ftp.ro.kernel.org
-"Russian Federation"	http://www.ru.kernel.org
-"Russian Federation"	ftp://ftp.ru.kernel.org
-"Saint Pierre and Miquelon"	http://www.pm.kernel.org
-"Saint Vincent and The Grenadines"	http://www.vc.kernel.org
-Singapore		http://www.sg.kernel.org
+Romania			http://www.ro.kernel.org
 Singapore		ftp://ftp.sg.kernel.org
-Slovakia		http://www.sk.kernel.org
+Singapore		http://www.sg.kernel.org
 Slovakia		ftp://ftp.sk.kernel.org
-Slovenia		http://www.si.kernel.org
+Slovakia		http://www.sk.kernel.org
 Slovenia		ftp://ftp.si.kernel.org
-Spain			http://www.es.kernel.org
+Slovenia		http://www.si.kernel.org
 Spain			ftp://ftp.es.kernel.org
-Suriname		http://www.sr.kernel.org
+Spain			http://www.es.kernel.org
 Suriname		ftp://ftp.sr.kernel.org
-"Svalbard and Jan Mayen Islands"	http://www.sj.kernel.org
-"Svalbard and Jan Mayen Islands"	ftp://ftp.sj.kernel.org
-Sweden			http://www.se.kernel.org
+Suriname		http://www.sr.kernel.org
 Sweden			ftp://ftp.se.kernel.org
-Switzerland		http://www.ch.kernel.org
+Sweden			http://www.se.kernel.org
 Switzerland		ftp://ftp.ch.kernel.org
+Switzerland		http://www.ch.kernel.org
 Thailand		http://www.th.kernel.org
-Turkmenistan		http://www.tm.kernel.org
 Turkmenistan		ftp://ftp.tm.kernel.org
-"Turks and Caicos Islands"	http://www.tc.kernel.org
-"United Arab Emirates"	http://www.ae.kernel.org
-"United Arab Emirates"	ftp://ftp.ae.kernel.org
-"United Kingdom"	http://www.uk.kernel.org
-"United Kingdom"	ftp://ftp.uk.kernel.org
-"United States"		http://www.us.kernel.org
-"United States"		ftp://ftp.us.kernel.org
-"United States Minor Outlying Islands"	http://www.um.kernel.org
-"United States Minor Outlying Islands"	ftp://ftp.um.kernel.org
-Uruguay			http://www.uy.kernel.org
+Turkmenistan		http://www.tm.kernel.org
 Uruguay			ftp://ftp.uy.kernel.org
-Venezuela		http://www.ve.kernel.org
+Uruguay			http://www.uy.kernel.org
 Venezuela		ftp://ftp.ve.kernel.org
-Vietnam			http://www.vn.kernel.org
+Venezuela		http://www.ve.kernel.org
 Vietnam			ftp://ftp.vn.kernel.org
-"Virgin Islands (British)"	http://www.vg.kernel.org
-"Virgin Islands (British)"	ftp://ftp.vg.kernel.org
-"Virgin Islands (U.S.)"		http://www.vi.kernel.org
-"Virgin Islands (U.S.)"		ftp://ftp.vi.kernel.org
-"Western Sahara"	http://www.eh.kernel.org
-"Western Sahara"	ftp://ftp.eh.kernel.org
+Vietnam			http://www.vn.kernel.org
diff --git a/etc/sorcery/mirrors/PERL_CPAN b/etc/sorcery/mirrors/PERL_CPAN
new file mode 100644
index 0000000..901600e
--- /dev/null
+++ b/etc/sorcery/mirrors/PERL_CPAN
@@ -0,0 +1,151 @@
+"Master Site"                    http://www.cpan.org
+"Customer Mirror"                Custom
+"United States, Indiana"         http://ftp.ndlug.nd.edu/pub/perl
+"United States, New York"        http://mirrors.24-7-solutions.net/pub/CPAN
+"United States, New York"        http://cpan.hexten.net
+"United States, Ohio"            http://cpan.mirror.qualispace.com
+"United States, Texas"           http://cpan.glines.org/CPAN
+"United States, California"      http://cpan.binarycompass.org
+"United States, California"      http://mirrors.kernel.org/cpan
+"United States, California"      http://cpan.mirrors.redwire.net
+"United States, California"      http://cpan-sj.viaverio.com
+"United States, Hawaii"          http://aniani.ifa.hawaii.edu/CPAN
+"United States, Massachusetts"   http://cpan.calvin.edu/pub/CPAN
+"United States, North Carolina"  http://www.ibiblio.org/pub/mirrors/CPAN
+"United States, North Carolina"  http://mirrors.jtlnet.com/CPAN
+"United States, Oregon"          http://ftp.osuosl.org/pub/CPAN
+"United States, Pennsylvania"    http://ftp.epix.net/CPAN
+"United States, Pennsylvania"    http://mirrors.phenominet.com/pub/CPAN
+"United States, Pennsylvania"    http://cpan.pair.com
+"United States, Utah"            http://cpan.cs.utah.edu
+"United States, Utah"            ftp://mirror.xmission.com/CPAN
+"United States, Virginia"        http://cpan-du.viaverio.com
+"United States, Virginia"        http://perl.secsup.org
+"United States, Wisconsin"       http://cpan.mirrors.tds.net
+"United States, Wisconsin"       http://mirror.sit.wisc.edu/pub/CPAN
+"United States, Wisconsin"       http://cpan.hostrack.net
+"Canada, Alberta"                http://cpan.arcticnetwork.ca
+"Canada, Alberta"                http://cpan.sunsite.ualberta.ca
+"Canada, Manitoba"               http://theoryx5.uwinnipeg.ca/pub/CPAN
+"Canada, Ontario"                http://CPAN.mirror.rafal.ca
+"Canada, Ontario"                ftp://ftp.nrc.ca/pub/CPAN
+"Canada, Ontario"                http://ftp.yi.org/CPAN
+"Austria"                        http://cpan.inode.at
+"Austria"                        http://cpan.serveroffice.at
+"Austria"                        http://gd.tuwien.ac.at/languages/perl/CPAN
+"Belgium"                        http://ftp.belnet.be/packages/cpan
+"Belgium"                        http://ftp.easynet.be/pub/CPAN
+"Belgium"                        http://cpan.mirrors.skynet.be
+"Bosnia and Herzegovina"         http://cpan.blic.net
+"Bulgaria"                       http://cpan.cbox.biz
+"Bulgaria"                       http://cpan.online.bg
+"Bulgaria"                       http://ftp.uni-sofia.bg/cpan
+"Croatia"                        http://ftp.linux.hr/pub/CPAN
+"Croatia"                        http://dl.iskon.hr/pub/CPAN
+"Czech Republic"                 ftp://ftp.fi.muni.cz/pub/CPAN
+"Czech Republic"                 http://ftp.mendelu.cz/perl
+"Czech Republic"                 http://archive.cpan.cz
+"Denmark"                        http://mirrors.dotsrc.org/cpan
+"Denmark"                        http://cpan.cybercity.dk
+"Denmark"                        http://www.cpan.dk
+"Estonia"                        ftp://ftp.ut.ee/pub/languages/perl/CPAN
+"Finland"                        ftp://ftp.funet.fi/pub/languages/perl/CPAN
+"Finland"                        http://mirror.eunet.fi/CPAN
+"France"                         http://cpan.enstimac.fr
+"France"                         ftp://ftp.inria.fr/pub/CPAN
+"France"                         ftp://ftp.erasme.org/pub/CPAN
+"France"                         http://ftp.u-paris10.fr/perl/CPAN
+"France"                         ftp://ftp.club-internet.fr/pub/perl/CPAN
+"France"                         http://cpan.mirrors.easynet.fr
+"Germany"                        ftp://ftp.cs.tu-berlin.de/pub/lang/perl/CPAN
+"Germany"                        ftp://ftp.fu-berlin.de/unix/languages/perl
+"Germany"                        http://www.cpan.mirroarrr.de
+"Germany"                        ftp://ftp.rub.de/pub/CPAN
+"Germany"                        http://www.planet-elektronik.de/CPAN
+"Germany"                        ftp://ftp.freenet.de/pub/ftp.cpan.org/pub/CPAN
+"Germany"                        http://dl.ambiweb.de/mirrors/ftp.cpan.org
+"Germany"                        http://ftp.uni-erlangen.de/pub/CPAN
+"Germany"                        ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/CPAN
+"Germany"                        http://www.mirrorspace.org/cpan
+"Germany"                        http://netmirror.org/mirror/CPAN
+"Germany"                        ftp://nlp.petamem.com
+"Germany"                        http://pandemonium.tiscali.de/pub/CPAN
+"Germany"                        http://ftp.gwdg.de/pub/languages/perl/CPAN
+"Greece"                         ftp://ftp.forthnet.gr/pub/languages/perl/CPAN
+"Greece"                         ftp://ftp.ntua.gr/pub/lang/perl
+"Hungary"                        http://ftp.kfki.hu/packages/perl/CPAN
+"Iceland"                        http://ftp.rhnet.is/pub/CPAN
+"Ireland"                        http://ftp.esat.net/pub/languages/perl/CPAN
+"Ireland"                        http://ftp.heanet.ie/mirrors/ftp.perl.org/pub/CPAN
+"Italy"                          http://bo.mirror.garr.it/mirrors/CPAN
+"Italy"                          http://cpan.panu.it
+"Italy"                          ftp://cis.uniRoma2.it/CPAN
+"Italy"                          ftp://ftp.edisontel.it/pub/CPAN_Mirror
+"Latvia"                         http://kvin.lv/pub/CPAN
+"Lithuania"                      http://ftp.litnet.lt/pub/CPAN
+"Malta"                          http://cpan.waldonet.net.mt
+"Moldova"                        http://cpan.lug.md
+"Netherlands"                    ftp://ftp.quicknet.nl/pub/CPAN
+"Netherlands"                    http://cpan.fluoline.net
+"Netherlands"                    http://cpan.mirror.rokscom.nl
+"Netherlands"                    http://cpan.wanadoo.nl
+"Norway"                         ftp://ftp.uninett.no/pub/languages/perl/CPAN
+"Norway"                         ftp://ftp.uit.no/pub/languages/perl/cpan
+"Poland"                         http://mirror.icis.pcz.pl/CPAN
+"Poland"                         ftp://ftp.mega.net.pl/CPAN
+"Poland"                         ftp://sunsite.icm.edu.pl/pub/CPAN
+"Portugal"                       ftp://perl.di.uminho.pt/pub/CPAN
+"Portugal"                       http://cpan.dei.uc.pt
+"Portugal"                       ftp://ftp.nfsi.pt/pub/CPAN
+"Portugal"                       http://ftp.linux.pt/pub/mirrors/CPAN
+"Portugal"                       http://cpan.interacesso.pt
+"Romania"                        http://ftp.casaafacerilor.ro/mirrors/CPAN
+"Romania"                        http://mirrors.evolva.ro/CPAN
+"Romania"                        ftp://ftp.kappa.ro/pub/mirrors/ftp.perl.org/pub/CPAN
+"Romania"                        ftp://ftp.lug.ro/CPAN
+"Russia"                         ftp://ftp.chg.ru/pub/lang/perl/CPAN
+"Russia"                         ftp://ftp.aha.ru/pub/CPAN
+"Russia"                         ftp://ftp.corbina.ru/pub/CPAN
+"Slovakia"                       ftp://ftp.cvt.stuba.sk/pub/CPAN
+"Slovenia"                       http://www.klevze.si/cpan
+"Spain"                          http://cpan.imasd.elmundo.es
+"Spain"                          ftp://ftp.rediris.es/mirror/CPAN
+"Sweden"                         http://ftp.du.se/CPAN
+"Sweden"                         http://ftp.port80.se/pub/CPAN
+"Switzerland"                    http://cpan.mirror.fr
+"Switzerland"                    http://cpan.mirror.solnet.ch
+"Ukraine"                        http://cpan.org.ua
+"Ukraine"                        http://no-more.kiev.ua/CPAN
+"United Kingdom"                 http://www.mirror.ac.uk/mirror/ftp.funet.fi/pub/languages/perl/CPAN
+"United Kingdom"                 http://www.mirrorservice.org/sites/ftp.funet.fi/pub/languages/perl/CPAN
+"United Kingdom"                 http://cpan.mirror.anlx.net
+"United Kingdom"                 http://cpan.teleglobe.net
+""
+"Australia"                      http://cpan.mirrors.ilisys.com.au
+"New Zealand"                    ftp://ftp.auckland.ac.nz/pub/perl/CPAN
+"New Zealand"                    http://cpan.inspire.net.nz
+"New Zealand"                    http://cpan.catalyst.net.nz/CPAN
+""
+"Argentina"                      ftp://mirrors.bannerlandia.com.ar/mirrors/CPAN
+"Brazil"                         ftp://cpan.pop-mg.com.br/pub/CPAN
+"Chile"                          http://cpan.netglobalis.net
+"Mexico"                         http://www.msg.com.mx/CPAN
+"South Africa"                   http://ftp.rucus.ru.ac.za/pub/perl/CPAN
+"China"                          http://cpan.linuxforum.net
+"China"                          http://mirrors.dayouit.com/CPAN
+"China"                          ftp://mirrors.hknet.com/CPAN
+"China"                          http://mirror.vmmatrix.net/CPAN
+"Hong Kong"                      http://ftp.cuhk.edu.hk/pub/packages/perl/CPAN
+"India"                          http://mirror.gnowledge.org/cpan
+"Iran"                           http://cpan.shatel.ir
+"Israel"                         http://mirror.mirimar.net/cpan
+"Israel"                         http://cpan.initworld.com
+"Japan"                          ftp://ftp.u-aizu.ac.jp/pub/CPAN
+"Japan"                          ftp://ftp.kddilabs.jp/CPAN
+"Republic of Korea"              http://ftp.kaist.ac.kr/pub/CPAN
+"Russian Federation"             http://cpan.tomsk.ru
+"Saudi Arabia"                   ftp://ftp.isu.net.sa/pub/CPAN
+"Taiwan"                         ftp://ftp.nctu.edu.tw/UNIX/perl/CPAN
+"Taiwan"                         http://cpan.cdpa.nsysu.edu.tw
+"Thailand"                       ftp://ftp.loxinfo.co.th/pub/cpan
+"Turkey"                         http://cpan.ulak.net.tr
diff --git a/etc/sorcery/version b/etc/sorcery/version
index d64531f..1a32d89 100644
--- a/etc/sorcery/version
+++ b/etc/sorcery/version
@@ -1 +1 @@
-devel
+20060626
diff --git a/usr/sbin/alter b/usr/sbin/alter
index e91e1d6..73912f6 100755
--- a/usr/sbin/alter
+++ b/usr/sbin/alter
@@ -529,13 +529,13 @@ alter: usage: 
 EOF
 
   case "$1" in
-	-m|--md5mend              ) shift; alter_md5mend   "$@" ;;
-	-p|--prelink              ) shift; alter_prelink   "$@" ;;
-	-s|--strip                ) shift; alter_strip     "$@" ;;
-	-z|--strip-all            ) shift; alter_strip_all "$@" ;;
-	-a|--alter                ) shift; alter_alter     "$@" ;;
-	-h|--about|--help         ) shift; alter_about     "$@" ;;
-	-n|--spell|-v|--version|* )        alter_alter     "$@" ;;
+    -m|--md5mend              ) shift; alter_md5mend   "$@" ;;
+    -p|--prelink              ) shift; alter_prelink   "$@" ;;
+    -s|--strip                ) shift; alter_strip     "$@" ;;
+    -z|--strip-all            ) shift; alter_strip_all "$@" ;;
+    -a|--alter                ) shift; alter_alter     "$@" ;;
+    -h|--about|--help         ) shift; alter_about     "$@" ;;
+    -n|--spell|-v|--version|* )        alter_alter     "$@" ;;
   esac
 
 }
diff --git a/usr/sbin/cast b/usr/sbin/cast
index 2af1d99..d8320f5 100755
--- a/usr/sbin/cast
+++ b/usr/sbin/cast
@@ -21,10 +21,10 @@ Usage:            cast  [parameters]  [s
 
 Optional Parameters:
 
-       --cflags                 Custom CFLAGS
-       --cxxflags               Custom CXXFLAGS
-       --cppflags               Custom CPPFLAGS
-       --ldflags                Custom LDFLAGS
+       --cflags   "flags"       Custom CFLAGS
+       --cxxflags "flags"       Custom CXXFLAGS
+       --cppflags "flags"       Custom CPPFLAGS
+       --ldflags  "flags"       Custom LDFLAGS
        --no-opts                Turn off setting optimization flags, except
                                 for those found in --cflags, --cxxflags,
                                 --cppflags and --ldflags.
@@ -38,7 +38,7 @@ Optional Parameters:
        --deps                   Configure spells and determine dependencies,
                                 only cast dependencies, not spells themselves
 
--c  |  --compile                Recompile the spells (dont install from cache).
+-c  |  --compile                Recompile the spells (don't install from cache).
 -r  |  --reconfigure            Select new dependencies for spells (implies -c)
 
 -g  |  --grimoire  [...]        Use only the specified grimoires for this cast
@@ -58,23 +58,20 @@ Optional Parameters:
                                    could optionally depend on it, but those
                                    dependencies are disabled, ask to recast
                                    the dependee. Optional parameter can be
-				   option can be one of: "always", "ask-yes",
-				   "ask-no", or "ignore", it defaults to what
-				   is set via the sorcery menu.
+                                   option can be one of: "always", "ask-yes",
+                                   "ask-no", or "ignore"; it defaults to what
+                                   is set via the sorcery menu.
 
 -Z  |  --lazy-updates [option]  Perform updates on installed spells that
-				need updates. Optional parameter same as
-				above.
+                                need updates. Optional parameter same as
+                                above.
 
 -b  |  --force-base-dep         Force all spells to depend on basesystem
 
        --from   directory       Specify an alternate for $SOURCE_CACHE
        --url    URL             Specify an alternate download URL
 
-       --pam                    Re-casts all installed spells that
-                                can use Linux-PAM
-
-       --queue                  Casts all spells listed in $INSTALL_QUEUE
+       --queue                  Cast all spells listed in $INSTALL_QUEUE
 
 EOF
 
@@ -122,7 +119,6 @@ function process_parameters()  {
             --silent)  SILENT="$1";                                  shift 1  ;;
                   -s)  export  SEPARATE="$1";                        shift 1  ;;
                --url)  export  BASE_URL="$2";                        shift 2  ;;
-               --pam)  cast  -c  `find_pam_aware` ;                  shift 1  ;;
              --queue)  CAST_QUEUE=yes ; COMPILE=$1;                  shift 1  ;;
                    *)  help                                   ;;
       esac
@@ -171,7 +167,6 @@ function strip_parameters()  {
            -d|--download)  shift 1  ;;
                       -s)  shift 1  ;;
                    --url)  shift 2  ;;
-                   --pam)  shift 1  ;;
                  --queue)  shift 1  ;;
                        *)  shift 1  ;;
 
@@ -249,6 +244,7 @@ # and install_xinetd) (afk 4/10/04)
 
   # must declare OPS before sourcing config
   local OPTS
+  export OPTS
   run_spell_config                            
 
   local spell_depends spell_sub_depends
@@ -414,7 +410,7 @@ function pass_two()  {
   return 1
   fi
 
-  rm -f $TMP_DIR/pass_three.done # dont return until this file exists
+  rm -f $TMP_DIR/pass_three.done # don't return until this file exists
   MINUS_K=yes
   if  [[  $SEPARATE   ]] ; then
     ( CAST_PASS="three" 
@@ -516,7 +512,7 @@ function pass_three()  {
     touch $download_log
   fi
   
-  # check if this is being resurrected and if so, dont summon
+  # check if this is being resurrected and if so, don't summon
   # this will go away when resurrect support and dependency resolution merge
   if ! [[ $COMPILE ]] ; then
     VERSION=$(codex_set_current_spell_by_name $SPELL &> /dev/null;echo $VERSION)
@@ -569,7 +565,7 @@ function pass_four()  {
     # hacky way to get the latest version
     VERSION=$(codex_set_current_spell_by_name $SPELL &> /dev/null;echo $VERSION)
     if [[ ! $VERSION ]] ; then
-      message "Cant find spell version for some reason, is $SPELL a spell?"
+      message "Can't find spell version for some reason, is $SPELL a spell?"
     else
       can_resurrect $SPELL $VERSION &> /dev/null && do_resurrect=yes
     fi
@@ -629,7 +625,7 @@ function pass_five()  {
       message "$item"
     done | column
    
-    set_term_title "Casting successfull."
+    set_term_title "Casting successful."
     message "${DEFAULT_COLOR}"
 
   fi 
@@ -747,7 +743,7 @@ function int_trap()
   if [[ $SCREEN_NAME ]] ; then
     message -n "Press a key to exit screen."
     read -n 1
-	screen_quit "$SCREEN_NAME"
+    screen_quit "$SCREEN_NAME"
   fi
   exit 1
 }
@@ -891,8 +887,9 @@ else
   if  [[ $SCREEN == on ]]         && 
       [[ $TERM != screen ]]
   then
-    export SCREEN_NAME="ScreenCast $*"
-    screen_start "ScreenCast $*" "$0" "$@"
+    SCREEN_NAME="ScreenCast $*"
+    export SCREEN_NAME="${SCREEN_NAME:0:64}$(echo $SCREEN_NAME | md5sum)"
+    screen_start "$SCREEN_NAME" "$0" "$@"
     echo "WTF?? We should not get here. screen_start execs!"
     exit 1
   fi
@@ -913,7 +910,7 @@ else
     then 
       touch $DEBUG
       screen_new_window "$SCREEN_NAME" $SCREEN_DEBUG_WIN "Debug" \
-      	tail -f -n 0 -s 0.1 $DEBUG
+      tail -f -n 0 -s 0.1 $DEBUG
       #screen_unmonitor_window "$SCREEN_NAME" $SCREEN_DEBUG_WIN
     fi
 
diff --git a/usr/sbin/cleanse b/usr/sbin/cleanse
index 98e66e3..6ba1b5a 100755
--- a/usr/sbin/cleanse
+++ b/usr/sbin/cleanse
@@ -35,44 +35,44 @@ ## @Stdout Usage statement
 #--------------------
 function usage()
 {
-	local s=$(basename $0)
+  local s=$(basename $0)
 cat << EOF
 Invoke $s with one of the arguments below. 
 
-Command		Description
---delint	Finds stale dependency entries
---delint full	will delint dependencies that are off
---prune		Finds dispeled spells that should be cast
---prune doit	will cause it to actually cast and dispel
---packages	find bad entries in the installed spells file
+Command         Description
+--delint        Finds stale dependency entries
+--delint full   will delint dependencies that are off
+--prune         Finds dispeled spells that should be cast
+--prune doit    will cause it to actually cast and dispel
+--packages      find bad entries in the installed spells file
 
---fix		attempts to detect errors in cast spells and recasts broken ones
---nofix		attempts to detect errors in cast spells but does not recast
---nofix_quick	like --nofix, but does not check dependent spells.
+--fix           attempts to detect errors in cast spells and recasts broken ones
+--nofix         attempts to detect errors in cast spells but does not recast
+--nofix_quick   like --nofix, but does not check dependent spells.
 
---tablet	clean up the tablet
---tablet_spell	clean up the tablet for one spell
---logs		cleans old logs in the same way a system-update does
+--tablet        clean up the tablet
+--tablet_spell  clean up the tablet for one spell
+--logs          cleans old logs in the same way a system-update does
 
---sweep		Clean out old downloaded sources and cached binaries
-		old is defined as not capable of being used by any
-		spell/version in any grimoire on the system.
+--sweep         Clean out old downloaded sources and cached binaries
+                old is defined as not capable of being used by any
+                spell/version in any grimoire on the system.
 
---sweep_all	Clean out old downloaded sources and cached binaries
-		old is defined as not capable of being used by any spell
-		installed on the system. Only the first version of the
-		spell found is used.
+--sweep_all     Clean out old downloaded sources and cached binaries
+                old is defined as not capable of being used by any spell
+                installed on the system. Only the first version of the
+                spell found is used.
 
 It is suggested that you try the following order the first time:
-	1) $s --packages
-	2) $s --delint
-	3) $s --tablet
-	4) $s --logs
-	5) $s --prune
-	6) $s --sweep
-	7) $s --fix
+    1) $s --packages
+    2) $s --delint
+    3) $s --tablet
+    4) $s --logs
+    5) $s --prune
+    6) $s --sweep
+    7) $s --fix
 EOF
-	[[ $# -gt 0 ]] && echo "Unknown $*"
+    [[ $# -gt 0 ]] && echo "Unknown $*"
 }
 
 
@@ -318,8 +318,8 @@ function prune_depends()
         Installed[$1] = 1; 
     } 
     $3=="on"{ 
-	  if($2 ~ "[(].*[)]")
-	    prov=gensub("^.*\\((.*)\\).*$", "\\1", 1, $2);
+      if($2 ~ "[(].*[)]")
+        prov=gensub("^.*\\((.*)\\).*$", "\\1", 1, $2);
       else
         prov="__BLANK__";
       gsub("\\(.*\\)", "", $2)
@@ -332,31 +332,31 @@ function prune_depends()
   while [ $# -gt 0 ] ; do
     options=()
     message "$1 needs $2 ($3)."
-	
-	# Check if the dependency is a provider. IF so, the SA may have  switched
-	# to another provider and should be given the option to recast with the
-	# new provider
-	if [[ $4 != __BLANK__ ]] ; then
-	  message -n "$2 used to provide $4. Now "
-	  local CANDIDATES=$( find_providers $4 )
-	  provider=""
+
+# Check if the dependency is a provider. IF so, the SA may have  switched
+# to another provider and should be given the option to recast with the
+# new provider
+  if [[ $4 != __BLANK__ ]] ; then
+    message -n "$2 used to provide $4. Now "
+    local CANDIDATES=$( find_providers $4 )
+    provider=""
       for spell in $CANDIDATES; do
         if spell_installed $spell || spell_held $spell; then
-		  local provider=$spell
-		  break
-		fi
+          local provider=$spell
+          break
+        fi
       done
 
 
       if [[ ${provider} ]] ; then
         message -n "$provider "
-	    options=( "Switch from $2 to ${provider} and recompile" )
+        options=( "Switch from $2 to ${provider} and recompile" )
       else
         message -n "${PROBLEM_COLOR}no one${DEFAULT_COLOR} "
-	  fi
-	  message "provides it."
+      fi
+      message "provides it."
     fi
-	
+
     # If the spell is optional, then the dependency can be removed and the spell recast
     # If it's required, then it can't be removed
     if [[ $3 == required ]] ; then
@@ -376,10 +376,10 @@ function prune_depends()
         sed 's/^\('$1':'$2':\)on\(:optional:.*\)$/\1off\2/' $DEPENDS_STATUS > $TMP_DIR/prune.1
         mv $TMP_DIR/prune.1 $DEPENDS_STATUS
         ;;
-	  S*)  sed 's/^\('$1':\)'$2'\(('$4'):.*\)$/\1'$provider'\2/' $DEPENDS_STATUS > $TMP_DIR/prune.1
-	  	mv $TMP_DIR/prune.1 $DEPENDS_STATUS
-		echo $1 >>$TMP_DIR/prune.cast
-		;;
+      S*)  sed 's/^\('$1':\)'$2'\(('$4'):.*\)$/\1'$provider'\2/' $DEPENDS_STATUS > $TMP_DIR/prune.1
+        mv $TMP_DIR/prune.1 $DEPENDS_STATUS
+        echo $1 >>$TMP_DIR/prune.cast
+        ;;
       *)  message "We should never get here." 
         exit 1
         ;;
diff --git a/usr/sbin/delve b/usr/sbin/delve
index 8967fa6..4fc5c94 100755
--- a/usr/sbin/delve
+++ b/usr/sbin/delve
@@ -71,16 +71,19 @@ ## Loads OPTS and all the other log file
 ## environment for spell files
 #---------------------------------------------------------------------------
 function delve_log_helper() {
-  # must declare OPS before sourcing config
-  local OPTS
-  run_spell_config
 
-  get_uncommitted_depends_file $SPELL spell_depends
-  if test -e $spell_depends && test -e $ABANDONED_DEPENDS/$SPELL ; then
-    cp $ABANDONED_DEPENDS/$SPELL $spell_depends
+  if ! [[ "$__DELVE_IN_CAST" ]] ; then
+    # must declare OPS before sourcing config
+    local OPTS
+    run_spell_config
+
+    get_uncommitted_depends_file $SPELL spell_depends
+    if test -e $spell_depends && test -e $ABANDONED_DEPENDS/$SPELL ; then
+      cp $ABANDONED_DEPENDS/$SPELL $spell_depends
+    fi
+    test -e $spell_depends &&
+    OPTS="$OPTS $(get_depends_options $spell_depends $SPELL)"
   fi
-  test -e $spell_depends &&
-  OPTS="$OPTS $(get_depends_options $spell_depends $SPELL)"
 
   # these have to go somewhere where future delves can find them
   C_LOG=${C_LOG:="/tmp/sorcery/delve/$SPELL.compile.log"}
@@ -157,13 +160,10 @@ function delve_install() {
 
   delve_is_valid_step BUILD 2 || return 1
   delve_log_helper
-  if [[ ! -d $STAGE_DIRECTORY ]]
-  then
-    prepare_stage_root
-  fi &&
   invoke_installwatch &&
   if [[ "$STAGED_INSTALL" != "off" ]]
   then
+    prepare_stage_root
     invoke_stage_root
   fi &&
   (
diff --git a/usr/sbin/dispel b/usr/sbin/dispel
index 87cbb9a..860f8fc 100755
--- a/usr/sbin/dispel
+++ b/usr/sbin/dispel
@@ -10,63 +10,63 @@ ##
 #---------------------------------------------------------------------
 
 
-help()	{
+help()  {
 
   cat  <<  EOF
 
 Dispel uninstalls single or multiple spells.
 
-Example:	dispel  hdparm vim emacs
-Usage:		dispel  [parameters]  [spells]
+Example:        dispel  hdparm vim emacs
+Usage:          dispel  [parameters]  [spells]
 
 Optional Parameters:
 
 -e | --exile spell      Removes spells and blocks them
                         from being automatically reinstalled.
-			
+
 -d | --downgrade spell version
-			Removes the spell and reinstalls
-			the selected version from cache
-			
---notriggers		Disables triggers for this dispel
---nosustain		Turns off dispel protection for vital spells
-			(you usually don't want to do this)
---noreap		Dispels spells but doesn't remove its files
---no-reap-depends	Dont remove dependency information, dont use this
-			unless you know exactly what you are doing, and
-			dont complain if it breaks your box.
-
---total-dispel		Remove everything including config files even
-			if they were modified.
+                        Removes the spell and reinstalls
+                        the selected version from cache
+
+--notriggers            Disables triggers for this dispel
+--nosustain             Turns off dispel protection for vital spells
+                        (you usually don't want to do this)
+--noreap                Dispels spells but doesn't remove its files
+--no-reap-depends       Dont remove dependency information, dont use this
+                        unless you know exactly what you are doing, and
+                        dont complain if it breaks your box.
+
+--total-dispel          Remove everything including config files even
+                        if they were modified.
 
 The following parameters effect dependency following, if they are not
 specified the default action is to do no dependency following. For
 a more in-depth explaination refer to the manual
 
-			The following 5 parameters accept one of the following
-			4 parameters:
-			ignore, ask-yes, ask-no, always
+                        The following 5 parameters accept one of the following
+                        4 parameters:
+                        ignore, ask-yes, ask-no, always
 
---orphan		Default action for dispelling a newly orphaned child 
-			spell.
---non-orphan		Default action for dispelling a dependee of
-			another spell, that is not an orphan (doing this
-			will break the spells that still depend on it).
+--orphan                Default action for dispelling a newly orphaned child 
+                        spell.
+--non-orphan            Default action for dispelling a dependee of
+                        another spell, that is not an orphan (doing this
+                        will break the spells that still depend on it).
 
---child			Default action for dispelling a child spell that
-			is either an orphan or non-orphan.
+--child                 Default action for dispelling a child spell that
+                        is either an orphan or non-orphan.
 
---recast-parent		If a spell has a child removed from under it, the
-			spell is considered broken, if all of the removed
-			children are optional, the spell may be recast
-			without those depends. This option controls the
-			default for this action.
---dispel-parent		Default action for dispelling broken parents,
-			the user is asked for recasting if possible first.
+--recast-parent         If a spell has a child removed from under it, the
+                        spell is considered broken, if all of the removed
+                        children are optional, the spell may be recast
+                        without those depends. This option controls the
+                        default for this action.
+--dispel-parent         Default action for dispelling broken parents,
+                        the user is asked for recasting if possible first.
 
---user-deps		Use defaults for dependency following from the
---user-child-deps	sorcery menu for child and/or parent dependency
---user-parent-deps	following.
+--user-deps             Use defaults for dependency following from the
+--user-child-deps       sorcery menu for child and/or parent dependency
+--user-parent-deps      following.
 
 EOF
 
@@ -369,10 +369,10 @@ ## Common code for querying the user abo
 ## Prints a message and asks a query, if ask-yes or ask-no is the
 ## provided action.
 ##
-## @param	Spell in question
-## @param	Message a short message about the state of the spell
-## @param	Question to ask the user
-## @param	quad-option (always, ask-yes, ask-no, ignore)
+## @param       Spell in question
+## @param       Message a short message about the state of the spell
+## @param       Question to ask the user
+## @param       quad-option (always, ask-yes, ask-no, ignore)
 #---------------------------------------------------------------------
 function dispel_child_query() {
   local SPELL=$1
@@ -404,8 +404,8 @@ #---------------------------------------
 ## Common code for querying the user about parents spells.
 ## Asks a query, if ask-yes or ask-no is the provided action.
 ##
-## @param	Question to ask the user
-## @param	quad-option (always, ask-yes, ask-no, ignore)
+## @param       Question to ask the user
+## @param       quad-option (always, ask-yes, ask-no, ignore)
 #---------------------------------------------------------------------
 function dispel_parent_query() {
   local QUERY=$1
@@ -450,9 +450,9 @@ function remove_from_dep_trees() {
 }
 
 #---------------------------------------------------------------------
-## @param	Spell to find borked parents for
-## @param	Name of upward dependency hash
-## @param	Name of hash to accumulate borked parents in
+## @param    Spell to find borked parents for
+## @param    Name of upward dependency hash
+## @param    Name of hash to accumulate borked parents in
 ##
 ## Find the spells that the following spell borks.
 ##
@@ -477,7 +477,7 @@ ## tree downwards for all the provided s
 ## borked parents. The caller is expected to call this repeatedly until
 ## there are no borked parents to remove.
 ##
-## @param	List of spells to remove on this iteration.
+## @param        List of spells to remove on this iteration.
 #---------------------------------------------------------------------
 function dispel_depends_engine() {
 
@@ -551,7 +551,7 @@ function dispel_depends_engine() {
         dispel_parents_list_borkers $parent "$optional_borkers" \
                                     "$runtime_borkers" "$suggested_borkers"
         if [[ $optional_borkers ]] && dispel_parent_query \
-                       "Re-cast $parent without these non-optional depends?" \
+                       "Re-cast $parent without these optional depends?" \
                        "$RECAST_PARENT_DEFAULT" ; then
           # fix up the abandoned depends data for impending recompile
           # this is a bit of a hack but should work:
diff --git a/usr/sbin/gaze b/usr/sbin/gaze
index 84856e1..fa91f42 100755
--- a/usr/sbin/gaze
+++ b/usr/sbin/gaze
@@ -14,109 +14,106 @@ cat << EOF
 Invoke gaze with desired command followed by arguments.
 Please note that anything in brackets [] is optional.
 
-Command		Arguments	Description
+Command         Arguments       Description
 
--q		<empty>		disables human style output
+-q              <empty>         disables human style output
 
-alien		<empty>		Discovers untracked files.
-from		path/file	Discovers what installed a file.
+alien           <empty>         Discovers untracked files.
+from            path/file       Discovers what installed a file.
 
-search		"phrase"	Searches for "phrase" in the long and short
-				spell descriptions and in the spell name.
-search -name  	"phrase" 	Searches for "phrase" in the spell name.
-search -short 	"phrase" 	Searches for "phrase" in the short spell 
-				descriptions
+search          "phrase"        Searches for "phrase" in the long and short
+                                spell descriptions and in the spell name.
+search -name    "phrase"        Searches for "phrase" in the spell name.
+search -short   "phrase"        Searches for "phrase" in the short spell 
+                                descriptions
 
-provides	feature 	Displays spells that provide the feature.
+provides        feature         Displays spells that provide the feature.
 
-what		spell		Prints the spell's description.
+what            spell           Prints the spell's description.
 short           spell           Prints the spell's short description.
-where	-path	spell		Prints the spell's section or full path.
-website | url	spell		Prints the spell's website.
-install		spell		Views an install log, and sorcery log files for to the spell.
-install-full		spell		Views an install log including all sorcery state files.
-install-spell		spell		Views an install log without any sorcery files included.
-installed	[spell]		Views installed spells.
-version		spell		Views version of spell installed,
-				 and version in the grimoire.
-versions	spell		Views version of spell in all grimoires
-patchlevels	spell		Views PATCHLEVEL and SECURITY_PATCH value
-				 of spell in all grimoires
-license		spell		Views the license of the given spell(s)
-license		section		Views the licenses of spells in the given
-				 section(s)
-license		license		Views information about the given license(s).
-compile		spell [version]	Views a compile log. If no optional version
-				 was given, try the installed version,
-				 if the spell is not installed use the
-				 version in the grimoire.
-sources		spell		Lists the source files for a spell.
-source_urls	spell		Lists the source urls for a spell.
-history		spell		Shows history for a spell.
-
-sum		[spell]		Prints checksums.
-md5sum		[spell]		Prints md5sums.
-size		spell		Prints total size of all files installed
-				 by this spell
-export				Makes snapshot of box's configuration.
-import		snapshot	Restores snapshot.
-
-section		[section]	Lists all sections. Or all spells in
-				 the specified section.
-maintainer	[section]	Lists who is the maintainer for a section
-grimoire	[grimoire]	Views a text listing of all grimoires.
-                	         Or of the specified grimoire.
-grimoires			Views list of installed grimoires' names
-html	[-s]	[grimoire]	Views a html listing of all grimoires.
-                        	 Or of the specified grimoire.
-                        	 Additionally displays links to the source
-				 files when -s is given.
-
-newer		20020521	Shows available spells newer than May 21, 2002.
-older		20010521	Shows spells installed before May 21, 2001.
-newer last_sorcery_update  Shows spells newer than your previous sorcery update
-newer last_cast            Shows spells newer than your last casting
-
-voyeur		[delay or spell]  
-				Peeks into spell compilation.
-
-pam		<empty>		Displays installed or held spells that are
-				  linux-pam aware.
-
-
-orphans		<empty>		Displays installed spells that no installed
-				  spells explicitly depend on.
-
-depends		[--fast] spell [level]
+where   -path   spell           Prints the spell's section or full path.
+website | url   spell           Prints the spell's website.
+install         spell           Views an install log, and sorcery log files for to the spell.
+install-full    spell           Views an install log including all sorcery state files.
+install-spell   spell           Views an install log without any sorcery files included.
+installed      [spell]          Views installed spells.
+version         spell           Views version of spell installed,
+                                 and version in the grimoire.
+versions        spell           Views version of spell in all grimoires
+patchlevels     spell           Views PATCHLEVEL and SECURITY_PATCH value
+                                 of spell in all grimoires
+license         spell           Views the license of the given spell(s)
+license         section         Views the licenses of spells in the given
+                                 section(s)
+license         license         Views information about the given license(s).
+compile         spell [version] Views a compile log. If no optional version
+                                 was given, try the installed version,
+                                 if the spell is not installed use the
+                                 version in the grimoire.
+sources         spell           Lists the source files for a spell.
+source_urls     spell           Lists the source urls for a spell.
+history         spell           Shows history for a spell.
+
+sum            [spell]          Prints checksums.
+md5sum         [spell]          Prints md5sums.
+size            spell           Prints total size of all files installed
+                                 by this spell
+export                          Makes snapshot of box's configuration.
+import          snapshot        Restores snapshot.
+
+section        [section]        Lists all sections. Or all spells in
+                                 the specified section.
+maintainer     [section]        Lists who is the maintainer for a section
+grimoire       [grimoire]       Views a text listing of all grimoires.
+                                 Or of the specified grimoire.
+grimoires                       Views list of installed grimoires' names
+html    [-s]   [grimoire]       Views a html listing of all grimoires.
+                                 Or of the specified grimoire.
+                                 Additionally displays links to the source
+                                 files when -s is given.
+
+newer           20020521        Shows available spells newer than May 21, 2002.
+older           20010521        Shows spells installed before May 21, 2001.
+newer last_sorcery_update       Shows spells newer than your previous sorcery
+                                 update
+newer last_cast                 Shows spells newer than your last casting
+
+voyeur         [delay or spell]  
+                                Peeks into spell compilation.
+
+orphans        <empty>          Displays installed spells that no installed
+                                 spells explicitly depend on.
+
+depends [--fast] spell [level]
                                  Displays the spells that explicitly or
-                   		 recursively depend on this spell,
-				 up to \$level levels (infinity if omitted)
+                                 recursively depend on this spell,
+                                 up to \$level levels (infinity if omitted)
                                  --fast omits some information but runs faster
 
 dependencies    [-c ] [--no-optionals ] spell [level]
-				Displays the spells this spell explicitly
-				 or recursively depends on, up to \$level
-				 levels (infinity if omitted). -c turns
-				 on compact mode, which will prevent
-				 previously shown trees from being displayed
-				 (avoids loops). --no-optionals skips
-				 optional spells
+                                 Displays the spells this spell explicitly
+                                 or recursively depends on, up to \$level
+                                 levels (infinity if omitted). -c turns
+                                 on compact mode, which will prevent
+                                 previously shown trees from being displayed
+                                 (avoids loops). --no-optionals skips
+                                 optional spells
 
-SCRIPT NAME	spell		will print the spell script for that spell.
+SCRIPT NAME      spell            will print the spell script for that spell.
 
-activity	<empty>		View the activity log
+activity        <empty>          View the activity log
 
-install-queue	<empty>		View the install queue
+install-queue   <empty>          View the install queue
 
-remove-queue	<empty>		View the remove queue
+remove-queue    <empty>          View the remove queue
 
-checkmd5s       [spell|section]	Print a md5 check of spells
+checkmd5s       [spell|section]  Print a md5 check of spells
 
-system-info					Show information about a Source Mage system
+system-info                      Show information about a Source Mage system
 
-show-held          		Shows all held spells.
+show-held                        Shows all held spells.
 
-show-exiled        		Shows all exiled spells.
+show-exiled                      Shows all exiled spells.
 
 EOF
 }
@@ -242,7 +239,7 @@ function alien()  {
 
   [[ $GAZE_VERBOSE != 0 ]] && 
   message  "Discovering installed files..."
-  { cat $SORCERY_INSTALL_LOG ; cat  $INSTALL_LOGS/* ; }  | 
+  { cat $SORCERY_INSTALL_LOG ; find $INSTALL_LOGS/ -type f|xargs cat ; }  | 
     files  |  sort  >  $TMP_DIR/gaze.known
 
   [[ $GAZE_VERBOSE != 0 ]] && 
@@ -445,20 +442,20 @@ function gaze_catalog_html()  {
             BOLD="<td>"
             UNBOLD="</td>"
         fi
-	if  [  -z  "$UPDATED"  ]  &&  [  "$ENTERED"  ];  then
-	    UPDATED=$ENTERED
-	fi
+        if  [  -z  "$UPDATED"  ]  &&  [  "$ENTERED"  ];  then
+          UPDATED=$ENTERED
+        fi
         echo  "${BOLD}${SPELL}${UNBOLD}"
         echo  "${BOLD}${VERSION}${UNBOLD}"
         echo  "<td>$UPDATED</td>"
 
         if  [  "$WEB_SITE"  !=  "unknown"  ];  then
-	    WEBSITE="`echo  $WEB_SITE  |  cut  -c-30`..."
-	    echo  "<td>"
-	    echo  "<a href=\"$WEB_SITE\">$WEBSITE</a>"
-	    echo  "</td>"
+            WEBSITE="`echo  $WEB_SITE  |  cut  -c-30`..."
+            echo  "<td>"
+            echo  "<a href=\"$WEB_SITE\">$WEBSITE</a>"
+            echo  "</td>"
         else
-	    echo  "<td></td>"
+            echo  "<td></td>"
         fi
         if [[ $COLS -eq 5 ]]; then
             echo "<td>"
@@ -468,7 +465,7 @@ function gaze_catalog_html()  {
            while  [  -n "${!ii}"  ];  do
                iii="${ii}_URL"
                echo "<br />"
-	       echo "<a href=\"${!iii}\">$(echo ${!ii} | cut -c-25)</a>"
+               echo "<a href=\"${!iii}\">$(echo ${!ii} | cut -c-25)</a>"
                i=$(($i+1))
                ii=SOURCE${i}
            done
@@ -500,8 +497,8 @@ function display()  {
       *text)       cat  $1  |  $PAGER  ;;
       bzip2*)     bzcat  $1  |  $PAGER  ;;
       gzip*)   gzip -cd  $1  |  $PAGER  ;;
-	  *) message "Unknown file type."
-	    return 1 ;;
+      *) message "Unknown file type."
+      return 1 ;;
     esac
   else
     message  "$2" 1>&2
@@ -725,7 +722,7 @@ function real_long_search()  {
   local SEARCH SEARCH_RESULTS
 
   if ! [[ $GAZE_VERBOSE == 0 ]] ; then
-	echo  "Searching...   "
+    echo  "Searching...   "
   fi
 
   let i=0
@@ -809,8 +806,8 @@ function specific_voyeur()
   then
     return 1
   fi
-  nice -n +20			\
-   tail /tmp/$1.compile.log	\
+  nice -n +20                   \
+   tail /tmp/$1.compile.log     \
     --follow=name --pid=$(ls "/tmp/liblock-0/cast.$1") 2>/dev/null
 }
 
@@ -825,7 +822,7 @@ function any_voyeur()
          sed "s/.*\/cast\.//" | head -n 1`
   [ $FILE ] || return 1
   debug "voyeur" "Looking at spell \"$FILE\""
-  nice -n +20				\
+  nice -n +20                                               \
     tail $(find /tmp/sorcery/cast/ -name $FILE.compile.log )\
          --follow=name --pid=$(ls "/tmp/liblock-0/cast.$FILE") 2>/dev/null
 }
@@ -1018,14 +1015,14 @@ #---------------------------------------
 function gaze_show_spell_version_table()  {
 
   (
-	echo  "Grimoire|Section|Spell|Grimoire Version|Installed Version"
+    echo  "Grimoire|Section|Spell|Grimoire Version|Installed Version"
     echo  "--------|-------|-----|----------------|-----------------"
  
    for  SPELL  in  $@; do 
 
       codex_set_current_spell  $SPELL                        &&
       local  INSTALLED=`installed_version  $SPELL`           &&
-	  echo  "$GRIMOIRE_NAME|$SECTION|$SPELL|${VERSION:="-"}|${INSTALLED:="-"}"
+      echo  "$GRIMOIRE_NAME|$SECTION|$SPELL|${VERSION:="-"}|${INSTALLED:="-"}"
 
     done 
 
@@ -1112,8 +1109,8 @@ function gaze_show_versions()  {
     then
       codex_set_current_spell $SPELL_DIRECTORY
 
-	    if [ $ECHO_INSTALLED -eq 1 ]
-	    then
+      if [ $ECHO_INSTALLED -eq 1 ]
+      then
         echo "$GRIMOIRE_NAME|$SECTION|$SPELL|$VERSION|${INSTALLED:="-"}"
         ECHO_INSTALLED=0
       else
@@ -1146,19 +1143,20 @@ function gaze_show_patchlevels()  {
   fi
 
   local TB_DIR
-  tablet_find_spell_dir "$SPELL" TB_DIR
 
-  local I_PATCH
-  local I_SPATCH
-  tablet_get_patchlevel "$TB_DIR" I_PATCH
-  tablet_get_security_patch "$TB_DIR" I_SPATCH
+  local I_PATCH="-"
+  local I_SPATCH="-"
+  if tablet_find_spell_dir "$SPELL" TB_DIR; then
+    tablet_get_patchlevel "$TB_DIR" I_PATCH
+    tablet_get_security_patch "$TB_DIR" I_SPATCH
+  fi
 
 
   local ECHO_INSTALLED=1
   (
 
   echo "Grimoire|Spell|Grimoire  |Grimoire  |Installed |Installed"
-  echo "        |     |Regula    |Security  |Regular   |Security"
+  echo "        |     |Regular   |Security  |Regular   |Security"
   echo "        |     |Patchlevel|Patchlevel|Patchlevel|Patchlevel"
   echo "--------|-----|----------|----------|----------|----------"
 
@@ -1465,7 +1463,7 @@ function gaze_show_depends() {
     if [[ "$GAZE_VERBOSE" == 0 ]] || [[ "$fast" ]]; then
       show_up_depends "$1" "$2" "$fast"
     else
-      show_up_depends  "$1" "$2" |
+      show_up_depends  "$1" "$2" "verbose"|
       awk -F: '{ printf("%s depends on %s (%s)\n",$1,$2,$4);}'
     fi
 
@@ -1481,19 +1479,19 @@ ##
 #-----
 function gaze_show_dependencies() {
     local FOUND SPELL NO_OPTIONALS
-	
+
     while true; do
         # Check for the compact mode flag
         if [[ $1 == -c ]] ; then
             FOUND="/tmp/gaze.seen.$$"
-	          echo -n > $FOUND
-		        shift
+            echo -n > $FOUND
+            shift
             continue
         fi
         # Check for the no optionals flag
         if [[ $1 == --no-optionals ]] ; then
             NO_OPTIONALS=yes
-		        shift
+            shift
             continue
         fi
         break
@@ -1501,7 +1499,7 @@ function gaze_show_dependencies() {
 
     SPELL=$1
     codex_does_spell_exist "$SPELL"  || exit 1
-	
+
     [[ $# == 2 ]] && MAX_DEPTH=$2
 
     (
@@ -1509,23 +1507,23 @@ function gaze_show_dependencies() {
             return 0
         }
         depends() {
+                [[ $1 == -sub ]] && shift 2
                 recurse "$1" $DEPTH "depends"
                 return 0
         }
         optional_depends() {
+                [[ $1 == -sub ]] && shift 2
                 [[ $NO_OPTIONALS ]] ||
                 recurse "$1" $DEPTH "optional"
                 return 0
         }
-        requires() {
-                recurse "$1" $DEPTH "requires"
-                return 0
-        }
         runtime_depends() {
+                [[ $1 == -sub ]] && shift 2
                 recurse "$1" $DEPTH "runtime"
                 return 0
         }
         suggest_depends() {
+                [[ $1 == -sub ]] && shift 2
                 recurse "$1" $DEPTH "suggest"
                 return 0
         }
@@ -1534,56 +1532,57 @@ function gaze_show_dependencies() {
     
             while (( COUNT-- )); do echo -en "$CHAR"; done
         }
-		
-		# These functions shouldn't do anything in this function.
-		# Eventualy, they should be separated into two lists, ones
-		# that may be used in DEPENDS, and ones that shouldn't be
-		define_functions ': ;'			\
-			real_persistent_save real_query_string config_get_option 		\
-			config_set_option real_config_query real_config_query_option 	\
-			real_config_query_string real_list_add
-
-		# real_config_query_list should set $1 to something reasonable:
-		real_config_query_list() { eval "$1='$3'"; }
+
+# These functions shouldn't do anything in this function.
+# Eventualy, they should be separated into two lists, ones
+# that may be used in DEPENDS, and ones that shouldn't be
+        define_functions ': ;'              \
+        real_persistent_save real_query_string config_get_option \
+        config_set_option real_config_query real_config_query_option \
+        real_config_query_string real_list_add
+
+# real_config_query_list should set $1 to something reasonable:
+        real_config_query_list() { eval "$1='$3'"; }
     
         recurse () {
             local name=$1 DEPTH=$2 WHAT=$3
-			local found_before=""
-			
-			if ! [[ $name ]] ; then
-				return ;
-			fi
-			
-    
+            local found_before=""
+
+            if ! [[ $name ]] ; then
+                return ;
+            fi
+
+   
             [[ $MAX_DEPTH ]] && [[ $DEPTH -ge $MAX_DEPTH ]] && return 1
             grep () {
                local foo
                smgl_which grep foo &&
                $foo "$@"
             }
-			[[ $FOUND ]] && 
-			    grep -q '^'$name'$' $FOUND && 
-				    found_before=" (see above for tree)"
+            [[ $FOUND ]] && 
+                grep -q '^'$name'$' $FOUND && 
+                found_before=" (see above for tree)"
     
             repeat "\t" $DEPTH
             echo "$name ($WHAT)${found_before}"
-			if [[ $found_before ]] ; then 
-			    return ;
-			elif [[ $FOUND ]] ; then
-			    echo "$name" >> $FOUND
-			fi
+            if [[ $found_before ]] ; then 
+                return ;
+            elif [[ $FOUND ]] ; then
+                echo "$name" >> $FOUND
+            fi
     
-            local SPELL=$(codex_find_spell_by_name $name)
-            [[ -e "$SPELL/DEPENDS" ]] &&
+            local SPELL_DIRECTORY=$(codex_find_spell_by_name $name)
+            [[ -e "$SPELL_DIRECTORY/DEPENDS" ]] &&
             (
-				let DEPTH++
-				define_functions ':;' grep
-				source "$SPELL/DEPENDS" 2>/dev/null
+                let DEPTH++
+                define_functions ':;' grep
+                codex_get_spell_paths $SPELL_DIRECTORY
+                source "$SPELL_DIRECTORY/DEPENDS" 2>/dev/null
             ) 
         }
         recurse $SPELL
     )
-	[[ $FOUND ]] && rm $FOUND
+    [[ $FOUND ]] && rm $FOUND
 }
 
 #-----
@@ -1656,13 +1655,13 @@ #---------------------------------------
 
 function figure_installed()
 {
-	local version
-	version=$(installed_version  $1)
-	if  [  -n  "$version"  ]; then
-		message  "[${version}]"
-	else
-		message  "[not installed]"
-	fi
+  local version
+  version=$(installed_version  $1)
+  if  [  -n  "$version"  ]; then
+    message  "[${version}]"
+  else
+    message  "[not installed]"
+  fi
 }
 
 #---------------------------------------------------------------------
@@ -1727,14 +1726,29 @@ function gaze_system_info()
   ## -e "s/()//" -e 's/ (depends)//' -e 's/ (optional)//' | tr "\n" " " )"
   #---
   
-  compute_installed_depends down_deps
-  for curr_spell in $(hash_get down_deps basesystem)
+  version="$(figure_installed basesystem)"
+  section="$(codex_get_spell_section_name basesystem)"
+  message -n "${MESSAGE_COLOR}${section}/basesystem:\t"
+  message    "${QUERY_COLOR}${version}${DEFAULT_COLOR}\n"
+
+  compute_installed_depends on_down_deps x on
+  compute_installed_depends off_down_deps x off
+  {
+  for curr_spell in $(hash_get on_down_deps basesystem)
   do
     version="$(figure_installed $curr_spell)"
     section="$(codex_get_spell_section_name $curr_spell)"
     message -n "${MESSAGE_COLOR}${section}/${curr_spell}:\t"
     message    "${QUERY_COLOR}${version}${DEFAULT_COLOR}"
   done
+  for curr_spell in $(hash_get off_down_deps basesystem)
+  do
+    version="$(figure_installed $curr_spell)"
+    section="$(codex_get_spell_section_name $curr_spell)"
+    message -n "${MESSAGE_COLOR}${section}/${curr_spell}:\t"
+    message    "${QUERY_COLOR}${version} (disabled)${DEFAULT_COLOR}"
+  done
+  } | sort
 
   #---
   ## Section: CODEX
@@ -1747,9 +1761,8 @@ function gaze_system_info()
   let idx=0
   for grimoire in $(codex_get_all_grimoires)
   do
-    message -n "${MESSAGE_COLOR} ${QUERY_COLOR}[$idx] :"
-    message -n "$(basename "$grimoire")${MESSAGE_COLOR} :"
-    message    "$grimoire ${DEFAULT_COLOR}"
+    message "${QUERY_COLOR} [$idx]: $(basename "$grimoire"):${DEFAULT_COLOR}" \
+            "${MESSAGE_COLOR}$grimoire${DEFAULT_COLOR}"
     let idx+=1
   done
 
@@ -1948,6 +1961,7 @@ parse()  {
           done
           shift 2
           ;;
+      *) help ; exit ;;
     esac
   done
 
@@ -2047,8 +2061,6 @@ parse()  {
 
    voyeur)  shift  1;  gaze_activate_voyeur  $@  ;;
 
-      pam)  find_pam_aware  ;;
-
  install-queue)  if [[ -s $INSTALL_QUEUE ]]; then
                    $PAGER $INSTALL_QUEUE
                  else
diff --git a/usr/sbin/scribbler b/usr/sbin/scribbler
index 05d55f1..c3c55c5 100755
--- a/usr/sbin/scribbler
+++ b/usr/sbin/scribbler
@@ -27,12 +27,12 @@ Scribbler is a utility for controlling t
 Example: scribbler add bash test stable
 Usage:
 scribbler add spell from-grimoire to-grimoire [to-section]
-	copies a spell from one grimoire to
-	another grimoire into the specified section.
-	The to-section is the same as the source section if unspecified
-	
+        copies a spell from one grimoire to
+        another grimoire into the specified section.
+        The to-section is the same as the source section if unspecified
+
 scribbler remove spell from-grimoire
-	removes a spell from a grimoire
+        removes a spell from a grimoire
 
 EOF
 }
diff --git a/usr/sbin/scribe b/usr/sbin/scribe
index ce15ea4..942a3f5 100755
--- a/usr/sbin/scribe
+++ b/usr/sbin/scribe
@@ -27,26 +27,26 @@ and the spells in your grimoires.
 Invoke scribe with the desired command followed by the target.
 Note that most options can be called with the beginning of the command.
 
-Command		Arguments	Description
-add		grimoire [from source]	Adds a new grimoire
-				 (optionally from a different URL)
-remove		grimoire	Removes a grimoire
-update		[grimoire]	Updates a grimoire or all grimoires
-
-fix		grimoire	Attempts to fix metadata for grimoire
-reindex		[grimoire]	Recreates the list of spells
-reindex-keyword [grimoire]      Recreates keyword listing
+Command          Arguments       Description
+add              grimoire [from source]  Adds a new grimoire
+                                 (optionally from a different URL)
+remove           grimoire        Removes a grimoire
+update          [grimoire]       Updates a grimoire or all grimoires
+
+fix              grimoire        Attempts to fix metadata for grimoire
+reindex         [grimoire]       Recreates the list of spells
+reindex-keyword [grimoire]       Recreates keyword listing
                                  (official grimoires should come with
                                  a keyword listing already)
 
-index				Prints list of grimoires
+index                            Prints list of grimoires
 
-set		grim1 grim2	puts grim1 before grim2
-swap		grim1 grim2 	Swaps two grimoires
+set              grim1 grim2     puts grim1 before grim2
+swap             grim1 grim2     Swaps two grimoires
 
-localize	grimoire	Makes a grimoire local
-				 (so scribe won't try to update it)
-unlocalize	grimoire	Makes a grimoire nonlocal
+localize         grimoire        Makes a grimoire local
+                                 (so scribe won't try to update it)
+unlocalize       grimoire         Makes a grimoire nonlocal
 
 
 Grimoire tarballs are located at $CODEX_TARBALL_URL
diff --git a/usr/sbin/sorcery b/usr/sbin/sorcery
index ee72138..d91750e 100755
--- a/usr/sbin/sorcery
+++ b/usr/sbin/sorcery
@@ -32,27 +32,27 @@ Usage:          sorcery [parameters]
 
 Optional Parameters:
 
--h  |  --help  |  help	Display this help screen
+-h  |  --help  |  help  Display this help screen
 
--s  |  system-update	Perform a system update (updates sorcery, grimoire,
-			  and spells).
-			  [ scribe update, sorcery queue, cast --queue ]
--u  |  update		Update the sorcery scripts only.
--g  |  upgrade		Do not update grimoire, just any spells that need to
-			  be upgraded.  [ sorcery queue, cast --queue ]
+-s  |  system-update    Perform a system update (updates sorcery, grimoire,
+                          and spells).
+                          [ scribe update, sorcery queue, cast --queue ]
+-u  |  update           Update the sorcery scripts only.
+-g  |  upgrade          Do not update grimoire, just any spells that need to
+                          be upgraded.  [ sorcery queue, cast --queue ]
 
--r  |  rebuild		rebuild all spells
+-r  |  rebuild          rebuild all spells
 
--q  |  queue		Compare installed grimoire to installed spells,
-			  generate queue of spells needing to be updated.
-       queue-security	Same as queue, but only for spells that need
-			  updating due to security fixes.
+-q  |  queue            Compare installed grimoire to installed spells,
+                          generate queue of spells needing to be updated.
+       queue-security   Same as queue, but only for spells that need
+                          updating due to security fixes.
 
-review-queue		Review the install queue for each spell's history 
-			  since each was last installed.
+review-queue            Review the install queue for each spell's history 
+                          since each was last installed.
 
-add-queue <spell|s>	Add spell(s) to install queue
-remove-queue <spell|s>	Remove spell(s) from install queue
+add-queue <spell|s>     Add spell(s) to install queue
+remove-queue <spell|s>  Remove spell(s) from install queue
 
 hold   <spell|s>   Sets spells' status to held.
 unhold <spell|s>   Sets spells' status to installed.
@@ -61,26 +61,26 @@ exile   <spell|s>   Sets spells' status 
 unexile <spell|s>   Removes spells' exiled status (to not installed at all).
 
 
-default add spell_1 spell_2 on/off	If "spell_1" optionally depends
-					on "spell_2" the default answer
-					is on/off.
+default add spell_1 spell_2 on/off      If "spell_1" optionally depends
+                                        on "spell_2" the default answer
+                                        is on/off.
 
-default add "" spell on/off	If anything optionally depends on "spell" the
-				default answer is on/off.
+default add "" spell on/off     If anything optionally depends on "spell" the
+                                default answer is on/off.
 
-default add spell "" on/off	If "spell" optionally depends on anything
-				the default answer is on/off.
+default add spell "" on/off     If "spell" optionally depends on anything
+                                the default answer is on/off.
 
-default add spell PROVIDER on/off	"Spell" is the provder for
-					PROVIDER bydefault, in the
-					case of optional_depends, if
-					on/off is off, none is chosen
-					by default instead.
+default add spell PROVIDER on/off       "Spell" is the provder for
+                                        PROVIDER bydefault, in the
+                                        case of optional_depends, if
+                                        on/off is off, none is chosen
+                                        by default instead.
 
 default remove [spell|""] [spell|PROVIDER|""] Remove entry from defaults
 default search [spell|""] [spell|PROVIDER|""] [on|off] Search defaults
 
--v  | --version		Print the sorcery version
+-v  | --version                 Print the sorcery version
 
 EOF
 
@@ -117,6 +117,7 @@ mirror_menu()  {
   local L_HELP="Select mirror for downloading kernel related sources."
   local N_HELP="Select mirror for downloading GNOME sources."
   local G_HELP="Select mirror for downloading GNU sources."
+  local P_HELP="Select mirror for downloading PERL-CPAN sources"
   local S_HELP="Select mirror for downloading Sorcery itself"
   local SF_HELP="Select mirror for downloading Sourceforge"
   local X_HELP="Select mirror for downloading XFree86 related sources."
@@ -136,8 +137,9 @@ mirror_menu()  {
                       "KERNEL"      ""  "$L_HELP"  \
                       "GNOME"       ""  "$N_HELP"  \
                       "GNU"         ""  "$G_HELP"  \
-		      "SOURCEFORGE" "" "$SF_HELP"  \
-		      "SORCERY"     ""  "$S_HELP"  \
+                      "PERL_CPAN"   ""  "$P_HELP"  \
+                      "SOURCEFORGE" "" "$SF_HELP"  \
+                      "SORCERY"     ""  "$S_HELP"  \
                       "XFREE86"     ""  "$X_HELP"'`
   do
 
@@ -148,6 +150,7 @@ mirror_menu()  {
       KERNEL)       MIRROR="      KERNEL_URL"  ;;
       GNOME)        MIRROR="       GNOME_URL"  ;;
       GNU)          MIRROR="         GNU_URL"  ;;
+      PERL_CPAN)    MIRROR="   PERL_CPAN_URL"  ;;
       SORCERY)      MIRROR="     SORCERY_URL"  ;;
       SOURCEFORGE)  MIRROR=" SOURCEFORGE_URL"  ;;
       XFREE86)      MIRROR="     XFREE86_URL"  ;;
@@ -172,7 +175,7 @@ mirror_menu()  {
 }
 
 
-show_spells()	{ (
+show_spells()  { (
 
   local  SECTION=`codex_find_section_by_name $1`
   local  SPELLS=`codex_get_spells_in_section  $SECTION`
@@ -266,7 +269,7 @@ add_pkgs()  { (
 ) }
 
 
-show_file()	{
+show_file() {
 
   if  [  -f  $1  ];  then
 
@@ -330,7 +333,7 @@ show_installed_spells()  {
 }
 
 
-remove_pkgs()	{
+remove_pkgs() {
 
   while
 
@@ -768,7 +771,7 @@ # used by sorcery configuration
                               --menu                     \
                               "$ARCH_HELP"               \
                                0 0 0                     \
-			       '$LIST              `; then
+                              '$LIST              `; then
 
     # remove spurious ""
     NEW_ARCH=`echo "${NEW_ARCH}" | sed -e 's/^"//' -e 's/"$//'`
@@ -925,18 +928,18 @@ I off . . . . . - . - . . - . . . - .
   local IGNORE_HELP="Ignore (do not check) integrity of downloads. DANGEROUS!"
 
   if  INT_DL_CHECK=`eval $DIALOG '  --title  "$INT_DL_TITLE"        \
-   			     --no-cancel                            \
-			     --ok-label    "Commit"                 \
-			     --item-help                            \
-			     --menu                                 \
-			     "$INT_DL_HELP"                         \
-			     0 0 0                                  \
-	"P"  "Abort unpack paranoid"             "$ABORT_ALL_HELP"  \
-	"A"  "Abort unpack but ask on ignore"    "$ABORT_HELP"      \
-	"B"  "Ask (default abort)"               "$ABORT_ASK_HELP"  \
-	"U"  "Ask (default abort save ignore)"   "$ABORT_IGN_HELP"  \
-	"G"  "Ask (default ignore)"              "$IGNORE_ASK_HELP" \
-	"I"  "Ignore (do not check)"             "$IGNORE_HELP"'`
+                                    --no-cancel                     \
+                                    --ok-label    "Commit"          \
+                                    --item-help                     \
+                                    --menu                          \
+                                    "$INT_DL_HELP"                  \
+                                    0 0 0                           \
+        "P"  "Abort unpack paranoid"             "$ABORT_ALL_HELP"  \
+        "A"  "Abort unpack but ask on ignore"    "$ABORT_HELP"      \
+        "B"  "Ask (default abort)"               "$ABORT_ASK_HELP"  \
+        "U"  "Ask (default abort save ignore)"   "$ABORT_IGN_HELP"  \
+        "G"  "Ask (default ignore)"              "$IGNORE_ASK_HELP" \
+        "I"  "Ignore (do not check)"             "$IGNORE_HELP"'`
   then
     case $INT_DL_CHECK in
       P) modify_local_config "MD5SUM_DL" "abort_all" ;;
@@ -1151,7 +1154,7 @@ integrity_menu()  {
 
   while  INT_CHECKS=`eval $DIALOG '  --title  "$INT_TITLE"     \
                            --cancel-label  "Exit"              \
-			   --ok-label      "Select"            \
+                           --ok-label      "Select"            \
                            --item-help                         \
                            --menu                              \
                            "$INT_HELP"                         \
diff --git a/usr/sbin/summon b/usr/sbin/summon
index 4be5a2f..fc09afd 100755
--- a/usr/sbin/summon
+++ b/usr/sbin/summon
@@ -33,22 +33,22 @@ Usage:          summon  [parameters] [sp
 
 Optional Parameters:
 
---from		<directory>	Specify an alternate for $SOURCE_CACHE
-       					
+--from          <directory>     Specify an alternate for $SOURCE_CACHE
 
---url		<URL>		Specify an alternate download URL
 
--d | --download			Force download of source, regardless of
+--url           <URL>           Specify an alternate download URL
+
+-d | --download                 Force download of source, regardless of
                                  of whether it exists locally or not.
 
--g | --grimoire <grimoire>	Searches only the given grimoire when
+-g | --grimoire <grimoire>      Searches only the given grimoire when
                                  searching for spells to summon.
-				 <grimoire> can be absolute or relative to
-				 $CODEX_ROOT
-				 Note that spells or the --all parameter
-				 still needs to be specified.
+                                 <grimoire> can be absolute or relative to
+                                 $CODEX_ROOT
+                                 Note that spells or the --all parameter
+                                 still needs to be specified.
 
--p | --print	<type>		Instead of downloading, print out
+-p | --print    <type>          Instead of downloading, print out
                                  information in some form according
                                  to the value of <type> for each spell:
                                   source   - print out the filenames
@@ -63,9 +63,9 @@ Optional Parameters:
                                  file2 url2-1 url2-2 ...
                                  ...
 
---queue				Download all spells in the install queue.
---all				Download all spells in the grimoires.
-				(note: this is several gigabytes)
+--queue                         Download all spells in the install queue.
+--all                           Download all spells in the grimoires.
+                                (note: this is several gigabytes)
 EOF
 
   exit  1
diff --git a/usr/share/man/man1/gaze.1 b/usr/share/man/man1/gaze.1
index f9bf3e3..ab32fd4 100644
--- a/usr/share/man/man1/gaze.1
+++ b/usr/share/man/man1/gaze.1
@@ -40,10 +40,6 @@ versions. This does not delete sources t
 NOTE: This is deprecated. Use 
 .I cleanse --sweep
 .PP
-.SS pam
-.IP
-display spells installed that are pam aware
-.PP
 .SS orphans
 .IP
 display installed spells that have no explicit dependencies on them
diff --git a/usr/share/man/man8/cast.8 b/usr/share/man/man8/cast.8
index 9841f5f..aa5b074 100644
--- a/usr/share/man/man8/cast.8
+++ b/usr/share/man/man8/cast.8
@@ -53,8 +53,6 @@ NOTE: If there are any cross-grimoire de
 Specify an alternate directory to search for cached sources.
 An alternate to /var/spool/sorcery.
 Usually though, you'd just copy the source to /var/spool/sorcery.
-.SS "--pam"
-re-casts all installed spells that can use linux-pam.
 .SS "--queue"
 re-casts all spells in the install queue, as generated for example by
 .BI sorcery " queue"
diff --git a/usr/share/man/man8/cleanse.8 b/usr/share/man/man8/cleanse.8
index 93747e9..ba802a6 100644
--- a/usr/share/man/man8/cleanse.8
+++ b/usr/share/man/man8/cleanse.8
@@ -11,6 +11,8 @@ cleanse \- Cleans sorcery system files o
 [\-\-sweep]
 [\-\-sweep_all]
 [\-\-fix]
+[\-\-nofix]
+[\-\-nofix_quick]
 .SH "EXAMPLE"
 To check everything type:
 .IP 
@@ -72,6 +74,14 @@ Discovers Broken executables and librari
 .IP 
 Discovers miss\-owned symbolic links to files.
 
+.TP
+.B "\-\-nofix"
+Similar to \-\-fix but attempts to discover and report instead of fixing. Uses the same four methods as \-\-fix to find broken spells.
+
+.TP
+.B "\-\-nofix_quick"
+Similar to \-\-nofix but does not check dependent spells. Uses the same four methods as \-\-fix to find broken spells.
+
 .TP 
 .B "\-h, \-\-help"
 Display short help.
diff --git a/var/lib/sorcery/archspecs/amd64/x86_32 b/var/lib/sorcery/archspecs/amd64/x86_32
deleted file mode 100755
index 86675ef..0000000
--- a/var/lib/sorcery/archspecs/amd64/x86_32
+++ /dev/null
@@ -1,11 +0,0 @@
-CPUNAME="AMD Athlon 64, Athlon 64 FX and Opteron"
-if use_gcc 3.3. ; then
-  CFLAGS="-march=athlon-xp -mmmx -mfpmath=sse -msse -msse2 -m3dnow -m32"
-elif use_gcc2 ; then
-  CFLAGS="-march=i686"
-else
-  CFLAGS="-march=k8 -mmmx -mfpmath=sse -msse -msse2 -m3dnow -m32"
-fi
-HOST="i686-pc-linux-gnu"
-FAST="-O3"
-SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/amd64/x86_64 b/var/lib/sorcery/archspecs/amd64/x86_64
deleted file mode 100755
index cc8453e..0000000
--- a/var/lib/sorcery/archspecs/amd64/x86_64
+++ /dev/null
@@ -1,14 +0,0 @@
-CPUNAME="AMD Athlon 64, Athlon 64 FX and Opteron"
-
-if use_gcc 3.3. ; then
-  CFLAGS="-march=athlon-xp -mmmx -mfpmath=sse -msse -msse2 -m3dnow -m64"
-elif use_gcc2 ; then
-  CFLAGS="-march=i686"
-else
-  CFLAGS="-march=k8 -mmmx -mfpmath=sse -msse -msse2 -m3dnow -m64"
-fi
-
-HOST="x86_64-unknown-linux-gnu"
-FAST="-O3"
-SMALL="-Os"
-
diff --git a/var/lib/sorcery/archspecs/arm/sa11xo b/var/lib/sorcery/archspecs/arm/sa11xo
deleted file mode 100755
index 03ab689..0000000
--- a/var/lib/sorcery/archspecs/arm/sa11xo
+++ /dev/null
@@ -1,5 +0,0 @@
-CPUNAME="Intel StrongArm SA11XO (Zaurus 5500)"
- CFLAGS="-march=armv4 -mtune=strongarm1100 -mapcs-32"
-   HOST="armv4l-strongarm"
-   FAST="-O3"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/arm/xscale b/var/lib/sorcery/archspecs/arm/xscale
deleted file mode 100755
index 1e294a8..0000000
--- a/var/lib/sorcery/archspecs/arm/xscale
+++ /dev/null
@@ -1,5 +0,0 @@
-CPUNAME="Intel StrongArm XScale"
- CFLAGS="-march=armv4 -mtune=xscale -mapcs-32"
-   HOST="armv4l-xscale"
-   FAST="-O3"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/ia32/amd/athlon b/var/lib/sorcery/archspecs/ia32/amd/athlon
deleted file mode 100755
index 762dada..0000000
--- a/var/lib/sorcery/archspecs/ia32/amd/athlon
+++ /dev/null
@@ -1,9 +0,0 @@
-CPUNAME="AMD Athlon"
-if use_gcc2; then
- CFLAGS="-march=i686"
-else
- CFLAGS="-march=athlon -mmmx -m3dnow"
-fi
-   HOST="i686-pc-linux-gnu"
-   FAST="-O3"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/ia32/amd/athlon-4 b/var/lib/sorcery/archspecs/ia32/amd/athlon-4
deleted file mode 100755
index e86717b..0000000
--- a/var/lib/sorcery/archspecs/ia32/amd/athlon-4
+++ /dev/null
@@ -1,9 +0,0 @@
-CPUNAME="AMD Athlon 4"
-if use_gcc2; then
- CFLAGS="-march=i686"
-else
- CFLAGS="-march=athlon-4 -mmmx -mfpmath=sse -msse -m3dnow"
-fi
-   HOST="i686-pc-linux-gnu"
-   FAST="-O3"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/ia32/amd/athlon-mp b/var/lib/sorcery/archspecs/ia32/amd/athlon-mp
deleted file mode 100755
index 4120fb6..0000000
--- a/var/lib/sorcery/archspecs/ia32/amd/athlon-mp
+++ /dev/null
@@ -1,9 +0,0 @@
-CPUNAME="AMD Athlon MP"
-if use_gcc2; then
- CFLAGS="-march=i686"
-else
- CFLAGS="-march=athlon-mp -mmmx -mfpmath=sse -msse -m3dnow"
-fi
-   HOST="i686-pc-linux-gnu"
-   FAST="-O3"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/ia32/amd/athlon-tbird b/var/lib/sorcery/archspecs/ia32/amd/athlon-tbird
deleted file mode 100755
index d60781e..0000000
--- a/var/lib/sorcery/archspecs/ia32/amd/athlon-tbird
+++ /dev/null
@@ -1,9 +0,0 @@
-CPUNAME="AMD Athlon Thunderbird"
-if use_gcc2; then
- CFLAGS="-march=i686"
-else
- CFLAGS="-march=athlon-tbird -mmmx -m3dnow"
-fi
-   HOST="i686-pc-linux-gnu"
-   FAST="-O3"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/ia32/amd/athlon-xp b/var/lib/sorcery/archspecs/ia32/amd/athlon-xp
deleted file mode 100755
index 0093776..0000000
--- a/var/lib/sorcery/archspecs/ia32/amd/athlon-xp
+++ /dev/null
@@ -1,9 +0,0 @@
-CPUNAME="AMD Athlon XP"
-if use_gcc2; then
- CFLAGS="-march=i686"
-else
- CFLAGS="-march=athlon-xp -mmmx -mfpmath=sse -msse -m3dnow"
-fi
-   HOST="i686-pc-linux-gnu"
-   FAST="-O3"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/ia32/amd/k6 b/var/lib/sorcery/archspecs/ia32/amd/k6
deleted file mode 100755
index d5c0761..0000000
--- a/var/lib/sorcery/archspecs/ia32/amd/k6
+++ /dev/null
@@ -1,9 +0,0 @@
-CPUNAME="AMD K6"
-if use_gcc2; then
- CFLAGS="-march=k6"
-else
- CFLAGS="-march=k6 -mmmx"
-fi
-   HOST="i586-pc-linux-gnu"
-   FAST="-O2"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/ia32/amd/k6-2 b/var/lib/sorcery/archspecs/ia32/amd/k6-2
deleted file mode 100755
index 849cdbe..0000000
--- a/var/lib/sorcery/archspecs/ia32/amd/k6-2
+++ /dev/null
@@ -1,9 +0,0 @@
-CPUNAME="AMD K6-2"
-if use_gcc2; then
- CFLAGS="-march=k6"
-else
- CFLAGS="-march=k6-2 -mmmx -m3dnow"
-fi
-   HOST="i586-pc-linux-gnu"
-   FAST="-O2"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/ia32/amd/k6-3 b/var/lib/sorcery/archspecs/ia32/amd/k6-3
deleted file mode 100755
index 2778cf9..0000000
--- a/var/lib/sorcery/archspecs/ia32/amd/k6-3
+++ /dev/null
@@ -1,9 +0,0 @@
-CPUNAME="AMD K6-3"
-if use_gcc2; then
- CFLAGS="-march=k6"
-else
- CFLAGS="-march=k6-3 -mmmx -m3dnow"
-fi
-   HOST="i586-pc-linux-gnu"
-   FAST="-O3"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/ia32/c3/ezra b/var/lib/sorcery/archspecs/ia32/c3/ezra
deleted file mode 100755
index 6949d8f..0000000
--- a/var/lib/sorcery/archspecs/ia32/c3/ezra
+++ /dev/null
@@ -1,11 +0,0 @@
-CPUNAME="C3 Ezra"
-if use_gcc2; then
- CFLAGS="-march=i586"
-else
- # Note: for gcc <3.3 then -march=i586
- CFLAGS="-march=c3 -m3dnow -pipe -fomit-frame-pointer"
-fi
-   HOST="i586-pc-linux-gnu"
-   FAST="-O3" # Note: should this be -Os
-              # see: http://www.epiawiki.org/wiki/tiki-index.php?page=EpiaInstallingGentoo
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/ia32/c3/ezra-t b/var/lib/sorcery/archspecs/ia32/c3/ezra-t
deleted file mode 100755
index 3b2a380..0000000
--- a/var/lib/sorcery/archspecs/ia32/c3/ezra-t
+++ /dev/null
@@ -1,11 +0,0 @@
-CPUNAME="C3 Ezra-T"
-if use_gcc2; then
- CFLAGS="-march=i586"
-else
- # Note: for gcc <3.3 then -march=i586
- CFLAGS="-march=c3 -m3dnow -pipe -fomit-frame-pointer"
-fi
-   HOST="i586-pc-linux-gnu"
-   FAST="-O3" # Note: should this be -Os
-              # see: http://www.epiawiki.org/wiki/tiki-index.php?page=EpiaInstallingGentoo
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/ia32/c3/nehemiah b/var/lib/sorcery/archspecs/ia32/c3/nehemiah
deleted file mode 100755
index db688cc..0000000
--- a/var/lib/sorcery/archspecs/ia32/c3/nehemiah
+++ /dev/null
@@ -1,11 +0,0 @@
-CPUNAME="C3 Samuel 2"
-if use_gcc2; then
- CFLAGS="-march=i686"
-else
- # Note: for gcc <3.3 then -march=i686, for gcc >3.3.2 then -march=c3-2
- CFLAGS="-march=c3 -msse -mmmx -mfpmath=sse -pipe -fomit-frame-pointer"
-fi
-   HOST="i686-pc-linux-gnu"
-   FAST="-O3" # Note: should this be -Os
-              # see: http://www.epiawiki.org/wiki/tiki-index.php?page=EpiaInstallingGentoo
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/ia32/c3/samuel2 b/var/lib/sorcery/archspecs/ia32/c3/samuel2
deleted file mode 100755
index 4da07b4..0000000
--- a/var/lib/sorcery/archspecs/ia32/c3/samuel2
+++ /dev/null
@@ -1,11 +0,0 @@
-CPUNAME="C3 Samuel 2"
-if use_gcc2; then
- CFLAGS="-march=i586"
-else
- # Note: for gcc <3.3 then -march=i586
- CFLAGS="-march=c3 -m3dnow -mmmx -pipe -fomit-frame-pointer"
-fi
-   HOST="i586-pc-linux-gnu"
-   FAST="-O3" # Note: should this be -Os
-              # see: http://www.epiawiki.org/wiki/tiki-index.php?page=EpiaInstallingGentoo
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/ia32/i386 b/var/lib/sorcery/archspecs/ia32/i386
deleted file mode 100755
index 295285d..0000000
--- a/var/lib/sorcery/archspecs/ia32/i386
+++ /dev/null
@@ -1,5 +0,0 @@
-CPUNAME="Intel 80386 and clones"
- CFLAGS="-march=i386"
-   HOST="i386-pc-linux-gnu"
-   FAST="-O2"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/ia32/i486 b/var/lib/sorcery/archspecs/ia32/i486
deleted file mode 100755
index 1456fe4..0000000
--- a/var/lib/sorcery/archspecs/ia32/i486
+++ /dev/null
@@ -1,5 +0,0 @@
-CPUNAME="Intel 80486 and clones"
- CFLAGS="-march=i486"
-   HOST="i486-pc-linux-gnu"
-   FAST="-O2"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/ia32/i586 b/var/lib/sorcery/archspecs/ia32/i586
deleted file mode 100755
index f5cb265..0000000
--- a/var/lib/sorcery/archspecs/ia32/i586
+++ /dev/null
@@ -1,5 +0,0 @@
-CPUNAME="Intel Pentium and clones"
- CFLAGS="-march=i586"
-   HOST="i586-pc-linux-gnu"
-   FAST="-O2"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/ia32/i686 b/var/lib/sorcery/archspecs/ia32/i686
deleted file mode 100755
index 2204eef..0000000
--- a/var/lib/sorcery/archspecs/ia32/i686
+++ /dev/null
@@ -1,5 +0,0 @@
-CPUNAME="Intel Pentium Pro and clones"
- CFLAGS="-march=i686"
-   HOST="i686-pc-linux-gnu"
-   FAST="-O3"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/ia32/intel/pentium b/var/lib/sorcery/archspecs/ia32/intel/pentium
deleted file mode 100755
index d9152fb..0000000
--- a/var/lib/sorcery/archspecs/ia32/intel/pentium
+++ /dev/null
@@ -1,9 +0,0 @@
-CPUNAME="Intel Pentium"
-if use_gcc2; then
- CFLAGS="-march=i586"
-else
- CFLAGS="-march=pentium"
-fi
-   HOST="i586-pc-linux-gnu"
-   FAST="-O2"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/ia32/intel/pentium-mmx b/var/lib/sorcery/archspecs/ia32/intel/pentium-mmx
deleted file mode 100755
index 906f0c2..0000000
--- a/var/lib/sorcery/archspecs/ia32/intel/pentium-mmx
+++ /dev/null
@@ -1,9 +0,0 @@
-CPUNAME="Intel Pentium with MMX"
-if use_gcc2; then
- CFLAGS="-march=i586"
-else
- CFLAGS="-march=pentium-mmx -mmmx"
-fi
-   HOST="i586-pc-linux-gnu"
-   FAST="-O2"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/ia32/intel/pentium2 b/var/lib/sorcery/archspecs/ia32/intel/pentium2
deleted file mode 100755
index 2015783..0000000
--- a/var/lib/sorcery/archspecs/ia32/intel/pentium2
+++ /dev/null
@@ -1,9 +0,0 @@
-CPUNAME="Intel Pentium II"
-if use_gcc2; then
- CFLAGS="-march=i686"
-else
- CFLAGS="-march=pentium2 -mmmx"
-fi
-   HOST="i686-pc-linux-gnu"
-   FAST="-O3"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/ia32/intel/pentium3 b/var/lib/sorcery/archspecs/ia32/intel/pentium3
deleted file mode 100755
index 33380f7..0000000
--- a/var/lib/sorcery/archspecs/ia32/intel/pentium3
+++ /dev/null
@@ -1,9 +0,0 @@
-CPUNAME="Intel Pentium III"
-if use_gcc2; then
- CFLAGS="-march=i686"
-else
- CFLAGS="-march=pentium3 -mmmx -mfpmath=sse -msse"
-fi
-   HOST="i686-pc-linux-gnu"
-   FAST="-O3"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/ia32/intel/pentium3m b/var/lib/sorcery/archspecs/ia32/intel/pentium3m
deleted file mode 100755
index 3ccbc87..0000000
--- a/var/lib/sorcery/archspecs/ia32/intel/pentium3m
+++ /dev/null
@@ -1,11 +0,0 @@
-CPUNAME="Intel Pentium Mobile"
-if use_gcc2; then
- CFLAGS="-march=i686"
-elif use_gcc 3.3; then
- CFLAGS="-march=pentium3 -mmmx -mfpmath=sse -msse2"
-else
- CFLAGS="-march=pentium-m -mmmx -mfpmath=sse -msse2"
-fi
-   HOST="i686-pc-linux-gnu"
-   FAST="-O3"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/ia32/intel/pentium4 b/var/lib/sorcery/archspecs/ia32/intel/pentium4
deleted file mode 100755
index fd68f8f..0000000
--- a/var/lib/sorcery/archspecs/ia32/intel/pentium4
+++ /dev/null
@@ -1,9 +0,0 @@
-CPUNAME="Intel Pentium IV"
-if use_gcc2; then
- CFLAGS="-march=i686"
-else
- CFLAGS="-march=pentium4 -mmmx -mfpmath=sse -msse -msse2"
-fi
-   HOST="i686-pc-linux-gnu"
-   FAST="-O3"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/ia32/intel/pentium4m b/var/lib/sorcery/archspecs/ia32/intel/pentium4m
deleted file mode 100755
index e1af73a..0000000
--- a/var/lib/sorcery/archspecs/ia32/intel/pentium4m
+++ /dev/null
@@ -1,11 +0,0 @@
-CPUNAME="Intel Pentium IV mobile"
-if use_gcc2; then
- CFLAGS="-march=i686"
-elif use_gcc 3.3; then
- CFLAGS="-march=pentium4 -mmmx -mfpmath=sse -msse -msse2"
-else
- CFLAGS="-march=pentium4m -mmmx -mfpmath=sse -msse -msse2"
-fi
-   HOST="i686-pc-linux-gnu"
-   FAST="-O3"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/ia32/intel/pentiumpro b/var/lib/sorcery/archspecs/ia32/intel/pentiumpro
deleted file mode 100755
index 90fba80..0000000
--- a/var/lib/sorcery/archspecs/ia32/intel/pentiumpro
+++ /dev/null
@@ -1,9 +0,0 @@
-CPUNAME="Intel Pentium Pro"
-if use_gcc2; then
- CFLAGS="-march=i686"
-else
- CFLAGS="-march=pentiumpro"
-fi
-   HOST="i686-pc-linux-gnu"
-   FAST="-O3"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/ppc/g3 b/var/lib/sorcery/archspecs/ppc/g3
deleted file mode 100755
index f2d1a31..0000000
--- a/var/lib/sorcery/archspecs/ppc/g3
+++ /dev/null
@@ -1,5 +0,0 @@
-CPUNAME="IBM/Motorola Powerpc G3 (740)"
- CFLAGS="-mcpu=740"
-   HOST="powerpc-linux-gnu"
-   FAST="-O3"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/ppc/g3+ b/var/lib/sorcery/archspecs/ppc/g3+
deleted file mode 100755
index 5542228..0000000
--- a/var/lib/sorcery/archspecs/ppc/g3+
+++ /dev/null
@@ -1,5 +0,0 @@
-CPUNAME="IBM/Motorola Powerpc G3 (750)"
- CFLAGS="-mcpu=750"
-   HOST="powerpc-linux-gnu"
-   FAST="-O3"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/ppc/g4 b/var/lib/sorcery/archspecs/ppc/g4
deleted file mode 100755
index 4da260b..0000000
--- a/var/lib/sorcery/archspecs/ppc/g4
+++ /dev/null
@@ -1,9 +0,0 @@
-CPUNAME="IBM/Motorola Powerpc G4 (7400)"
-if use_gcc2; then
- CFLAGS="-mcpu=7400"
-else
- CFLAGS="-mcpu=7400 -maltivec -mabi=altivec"
-fi
-   HOST="powerpc-linux-gnu"
-   FAST="-O3"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/ppc/g4+ b/var/lib/sorcery/archspecs/ppc/g4+
deleted file mode 100755
index df318c6..0000000
--- a/var/lib/sorcery/archspecs/ppc/g4+
+++ /dev/null
@@ -1,9 +0,0 @@
-CPUNAME="IBM/Motorola Powerpc G4 (7450)"
-if use_gcc2; then
- CFLAGS="-mcpu=7400"
-else
- CFLAGS="-mcpu=7450 -maltivec -mabi=altivec"
-fi
-   HOST="powerpc-linux-gnu"
-   FAST="-O3"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/ppc/g5 b/var/lib/sorcery/archspecs/ppc/g5
deleted file mode 100755
index ea4df6f..0000000
--- a/var/lib/sorcery/archspecs/ppc/g5
+++ /dev/null
@@ -1,5 +0,0 @@
-CPUNAME="IBM/Motorola Powerpc G5 (860)"
- CFLAGS="-mcpu=860 -maltivec -mabi=altivec"
-   HOST="powerpc-linux-gnu"
-   FAST="-O3"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/ppc/g5-64 b/var/lib/sorcery/archspecs/ppc/g5-64
deleted file mode 100755
index e4ff4d1..0000000
--- a/var/lib/sorcery/archspecs/ppc/g5-64
+++ /dev/null
@@ -1,5 +0,0 @@
-CPUNAME="IBM/Motorola Powerpc G5 (860) 64Bit Mode"
- CFLAGS="-mcpu=860 -maltivec -mabi=altivec -mpowerpc64"
-   HOST="powerpc-linux-gnu"
-   FAST="-O3"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/sparc/sun4c b/var/lib/sorcery/archspecs/sparc/sun4c
deleted file mode 100755
index 9f4a6d3..0000000
--- a/var/lib/sorcery/archspecs/sparc/sun4c
+++ /dev/null
@@ -1,5 +0,0 @@
-CPUNAME="Sun SPARCstation server 1/1+/2, IPC, ELC, IPX, SLC)"
- CFLAGS="-mcpu=v7"
-   HOST="sparc-unknown-linux-gnu"
-   FAST="-O3"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/sparc/sun4d b/var/lib/sorcery/archspecs/sparc/sun4d
deleted file mode 100755
index 73ba5ca..0000000
--- a/var/lib/sorcery/archspecs/sparc/sun4d
+++ /dev/null
@@ -1,5 +0,0 @@
-CPUNAME="Sun SPARCstation server 1000/etc."
- CFLAGS="-mcpu=v8"
-   HOST="sparc-unknown-linux-gnu"
-   FAST="-O3"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/sparc/sun4m b/var/lib/sorcery/archspecs/sparc/sun4m
deleted file mode 100755
index fe071a0..0000000
--- a/var/lib/sorcery/archspecs/sparc/sun4m
+++ /dev/null
@@ -1,5 +0,0 @@
-CPUNAME="Sun SPARCstation server 5/10/20, 4/600, Classic, LX, Voyager, JavaStation 1)"
- CFLAGS="-mcpu=v8"
-   HOST="sparc-unknown-linux-gnu"
-   FAST="-O3"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/sparc/sun4m64 b/var/lib/sorcery/archspecs/sparc/sun4m64
deleted file mode 100755
index 56a8966..0000000
--- a/var/lib/sorcery/archspecs/sparc/sun4m64
+++ /dev/null
@@ -1,5 +0,0 @@
-CPUNAME="Sun SPARCstation server 5/10/20, 4/600, Classic, LX, Voyager, JavaStation 1) 64-bit binaries (slow, big, no gain)"
- CFLAGS="-mcpu=v8 -m64"
-   HOST="sparc64-unknown-linux-gnu"
-   FAST="-O3"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/sparc/sun4u b/var/lib/sorcery/archspecs/sparc/sun4u
deleted file mode 100755
index 16812cc..0000000
--- a/var/lib/sorcery/archspecs/sparc/sun4u
+++ /dev/null
@@ -1,5 +0,0 @@
-CPUNAME="Sun UltraSPARC 5/10/etc."
- CFLAGS="-mcpu=v9 -mtune=ultrasparc"
-   HOST="sparc-unknown-linux-gnu"
-   FAST="-O3"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/sparc/sun4u64 b/var/lib/sorcery/archspecs/sparc/sun4u64
deleted file mode 100755
index 35e51eb..0000000
--- a/var/lib/sorcery/archspecs/sparc/sun4u64
+++ /dev/null
@@ -1,5 +0,0 @@
-CPUNAME="Sun UltraSPARC 5/10/etc. 64-bit binaries (slow, big, no gain)"
- CFLAGS="-mcpu=v9 -mtune=ultrasparc -m64"
-   HOST="sparc64-unknown-linux-gnu"
-   FAST="-O3"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/archspecs/superh/sh4 b/var/lib/sorcery/archspecs/superh/sh4
deleted file mode 100755
index 6392bd6..0000000
--- a/var/lib/sorcery/archspecs/superh/sh4
+++ /dev/null
@@ -1,5 +0,0 @@
-CPUNAME="Hitachi SuperH (SH4) (Dreamcast)"
- CFLAGS="-m4 -ml"
-   HOST="sh4-linux-gnu"
-   FAST="-O3"
-  SMALL="-Os"
diff --git a/var/lib/sorcery/modules/build_api/api1 b/var/lib/sorcery/modules/build_api/api1
index cd7e5e3..f345d4b 100755
--- a/var/lib/sorcery/modules/build_api/api1
+++ b/var/lib/sorcery/modules/build_api/api1
@@ -91,17 +91,7 @@ function run_pre_build() {
   mkdir -p  $BUILD_DIRECTORY
   cd  $BUILD_DIRECTORY
 
-  persistent_load &&
-  if  [  -x  $SCRIPT_DIRECTORY/PRE_BUILD  ];  then
-    debug "build_api/api1" "run_pre_build() - Prebuild script exists, now sourcing "
-    . $SCRIPT_DIRECTORY/PRE_BUILD
-  elif [[ "$PRE_BUILD_CMD" ]] ; then
-    $PRE_BUILD_CMD
-  else
-    debug "build_api/api1" "run_pre_build() - Prebuild script not found, using default"
-    default_pre_build
-  fi &&
-  persistent_save
+  run_spell_file PRE_BUILD pre_build
 }
 
 
@@ -124,7 +114,6 @@ function run_build()  {
   invoke_build_dir
   invoke_gcc2
   optimize
-  prepare_stage_root
   invoke_installwatch
 
   message -n "Installing in dir: "
@@ -133,15 +122,7 @@ function run_build()  {
 
   run_config_loc
   (
-    persistent_load &&
-    if  [  -x  $SCRIPT_DIRECTORY/BUILD  ];  then
-      .  $SCRIPT_DIRECTORY/BUILD
-    elif [[ "$BUILD_CMD" ]] ; then
-      $BUILD_CMD
-    else
-      default_build
-    fi &&
-    persistent_save
+    run_spell_file BUILD build
   ) 2> >(tee -a $C_LOG 1>&2 >> $VOYEUR_STDERR) \
      > >(tee -a $C_LOG >> $VOYEUR_STDOUT) # see bug 7201
 
@@ -164,15 +145,7 @@ #---------------------------------------
 function run_post_build() {
 
   debug "build_api/api1" "Starting run_post_build()"
-  persistent_load &&
-  if  [  -x  $SCRIPT_DIRECTORY/POST_BUILD  ];  then
-           . $SCRIPT_DIRECTORY/POST_BUILD
-  elif [[ "$POST_BUILD_CMD" ]] ; then
-    $POST_BUILD_CMD
-  else
-    default_post_build
-  fi
-  persistent_save
+  run_spell_file POST_BUILD post_build
 
   # Lock made in prepare_install
   unlock_resources "libgrimoire" "install"
@@ -188,14 +161,7 @@ #---------------------------------------
 function run_post_install() {
 
   debug "build_api/api1" "Starting run_post_install()"
-  persistent_load &&
-  if    [  -x  $SCRIPT_DIRECTORY/POST_INSTALL  ]
-  then
-    . $SCRIPT_DIRECTORY/POST_INSTALL
-  elif [[ "$POST_INSTALL_CMD" ]] ; then
-    $POST_INSTALL_CMD
-  fi &&
-  persistent_save
+  run_spell_file INSTALL install
 }
 
 
@@ -204,9 +170,9 @@ ## @Type API
 ## Creates the source directory and unpacks the source package into it.
 ## Used if no PRE_BUILD script is found for a spell.
 #---------------------------------------------------------------------
-function real_default_pre_build() {
+function real_default_sorcery_pre_build() {
 
-  debug "build_api/api1" "Starting real_default_pre_build() - SOURCE=$SOURCE SOURCE_DIRECTORY=$SOURCE_DIRECTORY"
+  debug "build_api/api1" "Starting real_default_sorcery_pre_build() - SOURCE=$SOURCE SOURCE_DIRECTORY=$SOURCE_DIRECTORY"
   mk_source_dir        $SOURCE_DIRECTORY  &&
   unpack_file
 
@@ -231,9 +197,9 @@ ##  make    install
 ## </pre>
 ##
 #---------------------------------------------------------------------
-function real_default_build() {
+function real_default_sorcery_build() {
 
-  debug "build_api/api1" "Starting real_default_build()"
+  debug "build_api/api1" "Starting real_default_sorcery_build()"
   OPTS="$OPTS --build=${BUILD}"
   #If this switches are used, they _may_ stop distcc and ccache from working
   # for some spells (bug 3798)
@@ -260,9 +226,9 @@ ## Installs configuration files and docu
 ## Used if no POST_BUILD script is found for a spell.
 ##
 #---------------------------------------------------------------------
-function real_default_post_build() {
+function real_default_sorcery_post_build() {
 
-  debug "build_api/api1" "Starting real_default_post_build()"
+  debug "build_api/api1" "Starting real_default_sorcery_post_build()"
 
   install_xinetd
   install_initd
@@ -270,7 +236,6 @@ function real_default_post_build() {
   install_desktop_files
   gather_docs
   devoke_installwatch
-  destroy_stage_root
   init_post_install
   ldconfig
   # release_saved_libraries
diff --git a/var/lib/sorcery/modules/build_api/api2 b/var/lib/sorcery/modules/build_api/api2
index 973f4ec..a9a92ee 100755
--- a/var/lib/sorcery/modules/build_api/api2
+++ b/var/lib/sorcery/modules/build_api/api2
@@ -31,6 +31,7 @@ function run_build_spell() {
   export C_FIFO=/dev/stdout # not needed for api2 anymore, but just in case
   export S_PWD=$TMP_DIR/build.saved.pwd 
   export VOYEUR_STDOUT VOYEUR_STDERR
+  export __DELVE_IN_CAST=on
 
   rm  -f $IW_DBGLOG
   touch $IW_DBGLOG
@@ -65,12 +66,10 @@ function run_build_spell() {
     (
       run_build                             &&
       run_pre_install                       &&
-# you have to make this directory every time even if you don't use it because
-# it's a bug with installwatch that it needs to exist at all times
-      prepare_stage_root                    &&
       invoke_installwatch                   &&
       if [[ "$STAGED_INSTALL" != "off" ]]
       then
+        prepare_stage_root                  &&
         invoke_stage_root
       fi                                    &&
       set_stage_root_paths                  &&
@@ -84,6 +83,7 @@ # it's a bug with installwatch that it n
        > >(tee -a $C_LOG >> $VOYEUR_STDOUT)
   )
   rs=$?
+  unset __DELVE_IN_CAST
   if [[ $SCREEN_NAME ]] && [ $rs -gt 0 ] ; then
     screen_move_window "$SCREEN_NAME" $SCREEN_CAST_WIN $SCREEN_LAST_FAILED_CAST_WIN
     screen_name_window "$SCREEN_NAME" $SCREEN_LAST_FAILED_CAST_WIN "Failed $SPELL"
@@ -117,15 +117,7 @@ function run_pre_build() {
   cd  "$BUILD_DIRECTORY"
 
   verify_sources &&
-  persistent_load &&
-  if  [  -x  $SCRIPT_DIRECTORY/PRE_BUILD  ];  then
-    . $SCRIPT_DIRECTORY/PRE_BUILD
-  elif [[ "$PRE_BUILD_CMD" ]] ; then
-    $PRE_BUILD_CMD
-  else
-    default_pre_build
-  fi &&
-  persistent_save
+  run_spell_file PRE_BUILD pre_build
 }
 
 
@@ -155,15 +147,7 @@ function run_build()  {
   pwd
   message "$SPELL    $VERSION"
 
-  persistent_load &&
-  if  [  -x  $SCRIPT_DIRECTORY/BUILD  ];  then
-    .  $SCRIPT_DIRECTORY/BUILD
-  elif [[ "$BUILD_CMD" ]] ; then
-    $BUILD_CMD
-  else
-    default_build
-  fi &&
-  persistent_save
+  run_spell_file BUILD build
 
   if  [  "$?"  !=  0  ];  then
     message  "${PROBLEM_COLOR}"      \
@@ -190,15 +174,7 @@ function run_pre_install() {
     cd "$BUILD_DIRECTORY"
   fi
   
-  persistent_load &&
-  if  [  -x  $SCRIPT_DIRECTORY/PRE_INSTALL  ];  then
-    .  $SCRIPT_DIRECTORY/PRE_INSTALL 
-  elif [[ "$PRE_INSTALL_CMD" ]] ; then
-    $PRE_INSTALL_CMD
-  else
-    default_pre_install
-  fi &&
-  persistent_save &&
+  run_spell_file PRE_INSTALL pre_install
   echo  "Compile log for $SPELL $VERSION Completed Build on `date  -u`"  >>  $C_LOG
   pwd > $S_PWD
 }
@@ -222,17 +198,8 @@ function run_install() {
     cd "$BUILD_DIRECTORY"
   fi
 
-  persistent_load &&
-  if  [  -x  $SCRIPT_DIRECTORY/INSTALL  ];  then
-    .  $SCRIPT_DIRECTORY/INSTALL 
-  elif [[ "$INSTALL_CMD" ]] ; then
-    $INSTALL_CMD
-  else
-    default_install
-  fi &&
-  persistent_save
-
-
+  run_spell_file INSTALL install
+  
   if  [  "$?"  !=  0  ];  then
     message  "${PROBLEM_COLOR}"      \
              "! Problem Detected !"  \
@@ -260,14 +227,7 @@ function run_post_install() {
   else
     cd "${INSTALL_ROOT:-/}"
   fi &&
-  if    [  -x  $SCRIPT_DIRECTORY/POST_INSTALL  ]; then
-    . $SCRIPT_DIRECTORY/POST_INSTALL
-  elif [[ "$POST_INSTALL_CMD" ]] ; then
-    $POST_INSTALL_CMD
-  else
-    default_post_install
-  fi &&
-  persistent_save &&
+  run_spell_file POST_INSTALL post_install
   unlock_resources "libgrimoire" "install"
 }
 #--------------------------------------------------------------------
@@ -291,15 +251,7 @@ #---------------------------------------
 function run_final() {
 
   debug "build_api/api2" "Starting run_final()"
-  persistent_load &&
-  cd "${INSTALL_ROOT:-/}"
-  if    [  -x  $SCRIPT_DIRECTORY/FINAL  ]
-  then
-    . $SCRIPT_DIRECTORY/FINAL
-  elif [[ "$FINAL_CMD" ]] ; then
-    $FINAL_CMD
-  fi &&
-  persistent_save
+  run_spell_file FINAL final
 }
 
 #---------------------------------------------------------------------
@@ -308,7 +260,7 @@ ## Creates the source directory and unpa
 ## Used if no PRE_BUILD script is found for a spell.
 ##
 #---------------------------------------------------------------------
-function real_default_pre_build() {
+function real_default_sorcery_pre_build() {
 
   debug "libgrimoire" "default_pre_build() - SOURCE=$SOURCE SOURCE_DIRECTORY=$SOURCE_DIRECTORY"
   mk_source_dir        $SOURCE_DIRECTORY  &&
@@ -331,8 +283,8 @@ ##  make
 ## </pre>
 ##
 #---------------------------------------------------------------------
-function real_default_build() {
-  debug "build_api/api2" "real_default_build"
+function real_default_sorcery_build() {
+  debug "build_api/api2" "real_default_sorcery_build"
 
   OPTS="$OPTS --build=${BUILD}"
   #If these switches are used, they _may_ stop distcc and ccache from working
@@ -359,8 +311,8 @@ ##  prepare_install
 ## </pre>
 ##
 #---------------------------------------------------------------------
-function real_default_pre_install() {
-  debug "build_api/api2" "Starting real_default_pre_install"
+function real_default_sorcery_pre_install() {
+  debug "build_api/api2" "Starting real_default_sorcery_pre_install"
   prepare_install
 }
 
@@ -373,8 +325,8 @@ ##  make    install
 ## </pre>
 ##
 #---------------------------------------------------------------------
-function real_default_install() {
-  debug "build_api/api2" "Starting real_default_install"
+function real_default_sorcery_install() {
+  debug "build_api/api2" "Starting real_default_sorcery_install"
   make    install
 }
 
@@ -386,9 +338,9 @@ ## Used if no POST_INSTALL script is fou
 ##
 ## This is identical to api1's post_build
 #---------------------------------------------------------------------
-function real_default_post_install() {
+function real_default_sorcery_post_install() {
 
-  debug "build_api/api2" "Starting real_default_post_install"
+  debug "build_api/api2" "Starting real_default_sorcery_post_install"
   install_xinetd
   install_initd
   install_pam_confs
diff --git a/var/lib/sorcery/modules/build_api/common b/var/lib/sorcery/modules/build_api/common
index 61abc80..14b6616 100755
--- a/var/lib/sorcery/modules/build_api/common
+++ b/var/lib/sorcery/modules/build_api/common
@@ -68,9 +68,9 @@ function run_config_loc () {
       fi
 
       if    query  "Do you wish to add -- options to ./configure?"  n ;  then
-	F_TMP=$TMP_DIR/cast.$$.configure
+        F_TMP=$TMP_DIR/cast.$$.configure
         rm -f $F_TMP
-				
+
         if [ -x ./configure ]; then
           ./configure --help > $F_TMP
         elif [ -x ./src/configure ]; then
@@ -132,13 +132,11 @@ function real_prepare_install() { ( 
     fi
 )
   # TODO this is a dirty hack we need to remove it
-  for dir in $( find $SOURCE_DIRECTORY/old.binaries )
-	do
-	  if [[ -d $dir ]]
-		then
+  if test -d "$SOURCE_DIRECTORY/old.binaries" ; then
+    for dir in $( find "$SOURCE_DIRECTORY/old.binaries" -type d); do
       export PATH="$dir:$PATH"
-    fi
-  done
+    done
+  fi
 }
 
 #---------------------------------------------------------------------
diff --git a/var/lib/sorcery/modules/libapi b/var/lib/sorcery/modules/libapi
index 5b4ae54..3392d19 100755
--- a/var/lib/sorcery/modules/libapi
+++ b/var/lib/sorcery/modules/libapi
@@ -18,73 +18,88 @@ #---------------------------------------
 
 #---------------------------------------------------------------------
 # functions defined in here: (in alphabetical order)
-#    acquire_src            (libsummon)
-#    config_query           (libmisc)
-#    config_query_list      (libmisc)
-#    config_query_option    (libmisc)
-#    config_query_string    (libmisc)
-#    conflicts              (libgrimoire)  
-#    default_build          (build_api/...)   
-#    default_configure      (libdepends)
-#    default_depends        (libdepends)
-#    default_download       (libsummon)
-#    default_install        (build_api/api2)   (BUILD_API==2 only)
-#    default_post_build     (build_api/api1)   (BUILD_API==1 only)
-#    default_post_install   (build_api/api2)   (BUILD_API==2 only)
-#    default_post_remove    (libdispel)
-#    default_pre_build      (build_api/common)   
-#    default_pre_install    (build_api/api2)   (BUILD_API==2 only)
-#    default_pre_remove     (libdispel)
-#    default_prepare        (libdepends)
-#    depends                (libdepends)
-#    devoke_installwatch    (libtrack)
-#    download_src           (libsummon)
-#    force_depends          (libdepends)
-#    gather_docs            (build_api/common)
-#    get_spell_provider     (libstate)
-#    get_source_nums        (libmisc)
-#    guess_compressor       (libunpack)
-#    handle_changed_config  (libresurrect)
-#    is_depends_enabled     (libstate)
-#    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)   
-#    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)   
-#    provider_ok            (libstate)
-#    query                  (libmisc)       
-#    query_string           (libmisc)
-#    requires               (libdepends)
-#    runtime_depends        (libdepends)
-#    rm_source_dir          (libgrimoire)
-#    sedit                  (libmisc)       
-#    sub_depends            (libdepends)
-#    show_depends           (libdepends)
-#    spell_exiled           (libstate)
-#    spell_held             (libstate)
-#    spell_installed        (libstate)
-#    spell_ok               (libstate)
-#    suggest_depends        (libdepends)
-#    track_manual           (libtrack)
-#    uncompress             (libunpack)
-#    unpack                 (libunpack) (deprecated)
-#    unpack_file            (libunpack)
-#    unpack_file_simple     (libunpack)
-#    verify_file            (libunpack)
+#    acquire_src                    (libsummon)
+#    config_query                   (libmisc)
+#    config_query_list              (libmisc)
+#    config_query_option            (libmisc)
+#    config_query_string            (libmisc)
+#    conflicts                      (libgrimoire)  
+#    default_sorcery_build          (build_api/...)   
+#    default_sorcery_download       (libsummon)
+#    default_sorcery_install        (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_pre_build      (build_api/common)   
+#    default_sorcery_pre_install    (build_api/api2)   (BUILD_API==2 only)
+#    depends                        (libdepends)
+#    devoke_installwatch            (libtrack)
+#    download_src                   (libsummon)
+#    force_depends                  (libdepends)
+#    gather_docs                    (build_api/common)
+#    get_spell_provider             (libstate)
+#    get_source_nums                (libmisc)
+#    guess_compressor               (libunpack)
+#    handle_changed_config          (libresurrect)
+#    is_depends_enabled             (libstate)
+#    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)   
+#    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)   
+#    provider_ok                    (libstate)
+#    query                          (libmisc)       
+#    query_string                   (libmisc)
+#    runtime_depends                (libdepends)
+#    rm_source_dir                  (libgrimoire)
+#    sedit                          (libmisc)       
+#    sub_depends                    (libdepends)
+#    show_depends                   (libdepends)
+#    spell_exiled                   (libstate)
+#    spell_held                     (libstate)
+#    spell_installed                (libstate)
+#    spell_ok                       (libstate)
+#    suggest_depends                (libdepends)
+#    track_manual                   (libtrack)
+#    uncompress                     (libunpack)
+#    unpack                         (libunpack) (deprecated)
+#    unpack_file                    (libunpack)
+#    unpack_file_simple             (libunpack)
+#    verify_file                    (libunpack)
+#
+# The following are implicitly defined for each spell file
+# (filename is first lowercased):
+# default_<filename>
+# default_section_<filename>
+# default_grimoire_<filename>
+# default_sorcery_<filename>
+#
+# It is supported to have a file at the spell, section, or grimoire level,
+# the more specific one overrides the less specific.
+# Depending on context default_<filename> calls one of the default
+# section, grimoire or sorcery functions. Calling it will always run the
+# next level up.
+#
+# The default_section_<filename> and default_grimoire_<filename> functions
+# first check for the filename (capitalized) in the section or grimoire.
+# If it doesn't exist, default_<filename> is called (which runs the next
+# step up).
+#
+# If the default_sorcery_<filename> function is not defined here, it is
+# simply "true".
 #
 # Read-only variable that might be of use to a spell:
 # SOURCE_CACHE, OPTS, BUILD HOST, INSTALL_ROOT
@@ -215,7 +230,7 @@ ##
 #---------------------------------------------------------------------
 function config_query_option () {
     debug "libapi" "config_query_option - $*"
-	 real_config_query_option "$@"
+    real_config_query_option "$@"
 }
 
 #---------------------------------------------------------------------
@@ -257,7 +272,7 @@ function conflicts () {
 
 #---------------------------------------------------------------------
 ## @Type API
-## @See <@function var.lib.sorcery.modules.libgrimoire.html,real_default_build> for more details.
+## @See <@function var.lib.sorcery.modules.libgrimoire.html,real_default_sorcery_build> for more details.
 ## Used if no BUILD script is found for a spell
 ## Default build for BUILD_API==1 is:
 ## <pre>
@@ -281,50 +296,26 @@ ##  make
 ## </pre>
 ##
 #---------------------------------------------------------------------
-function default_build () {
-    debug "libapi" "default_build - $*"
-    real_default_build "$@"
-}
-
-#---------------------------------------------------------------------
-## @Type API
-## @See <@function var.lib.sorcery.modules.libdepends.html,real_default_configure> for more details.
-##
-## Default configure code, just no-op for now.
-##
-#---------------------------------------------------------------------
-function default_configure() {
-    debug "libapi" "$FUNCNAME - $*"
-    real_default_configure "$@"
+function default_sorcery_build () {
+    debug "libapi" "default_sorcery_build - $*"
+    real_default_sorcery_build "$@"
 }
 
 #---------------------------------------------------------------------
 ## @Type API
-## @See <@function var.lib.sorcery.modules.libdepends.html,real_default_depends> for more details.
-##
-## Default depends code, just no-op for now.
-##
-#---------------------------------------------------------------------
-function default_depends() {
-    debug "libapi" "$FUNCNAME - $*"
-    real_default_depends "$@"
-}
-
-#---------------------------------------------------------------------
-## @Type API
-## @See <@function var.lib.sorcery.modules.libsummon.html,real_default_download> for more details.
+## @See <@function var.lib.sorcery.modules.libsummon.html,real_default_sorcery_download> for more details.
 ##
 ## Default download code, downloads each SOURCE[[:digit:]]*
 ##
 #---------------------------------------------------------------------
-function default_download() {
+function default_sorcery_download() {
     debug "libapi" "$FUNCNAME - $*"
-    real_default_download "$@"
+    real_default_sorcery_download "$@"
 }
 
 #---------------------------------------------------------------------
 ## @Type API
-## @See <@function var.lib.sorcery.modules.libgrimoire.html,real_default_install> for more details.
+## @See <@function var.lib.sorcery.modules.libgrimoire.html,real_default_sorcery_install> for more details.
 ## Only defined for BUILD_API==2
 ## Used if no INSTALL script is found.
 ## Default install is:
@@ -333,65 +324,53 @@ ##  make    install
 ## </pre>
 ##
 #---------------------------------------------------------------------
-function default_install () {
-    debug "libapi" "default_install - $*"
-    real_default_install "$@"
+function default_sorcery_install () {
+    debug "libapi" "default_sorcery_install - $*"
+    real_default_sorcery_install "$@"
 }
 
 #---------------------------------------------------------------------
 ## @Type API
-## @See <@function var.lib.sorcery.modules.libgrimoire.html,real_default_post_build> for more details.
+## @See <@function var.lib.sorcery.modules.libgrimoire.html,real_default_sorcery_post_build> for more details.
 ## Only defined for BUILD_API==1
 ## Installs configuration files and documentation.  Stops installwatch.
 ## Used if no POST_BUILD script is found for a spell.
-## equivalent to default_post_install in BUILD_API==2
+## equivalent to default_sorcery_post_install in BUILD_API==2
 ##
 #---------------------------------------------------------------------
-function default_post_build () {
-    debug "libapi" "default_post_build - $*"
-    real_default_post_build "$@"
+function default_sorcery_post_build () {
+    debug "libapi" "default_sorcery_post_build - $*"
+    real_default_sorcery_post_build "$@"
 }
 
 #---------------------------------------------------------------------
 ## @Type API
-## @See <@function var.lib.sorcery.modules.libgrimoire.html,real_default_post_install> for more details.
+## @See <@function var.lib.sorcery.modules.libgrimoire.html,real_default_sorcery_post_install> for more details.
 ## Only defined for BUILD_API==2
 ## Installs configuration files and documentation.  Stops installwatch.
 ## Used if no POST_INSTALL script is found for a spell.
-## equivalent to default_post_build in BUILD_API==1
-##
-#---------------------------------------------------------------------
-function default_post_install () {
-    debug "libapi" "default_post_install - $*"
-    real_default_post_install "$@"
-}
-
-#---------------------------------------------------------------------
-## @Type API
-## @See <@function var.lib.sorcery.modules.libdispel.html,real_default_post_remove> for more details.
-##
-## Default post_remove code, just no-op for now.
+## equivalent to default_sorcery_post_build in BUILD_API==1
 ##
 #---------------------------------------------------------------------
-function default_post_remove() {
-    debug "libapi" "$FUNCNAME - $*"
-    real_default_post_remove "$@"
+function default_sorcery_post_install () {
+    debug "libapi" "default_sorcery_post_install - $*"
+    real_default_sorcery_post_install "$@"
 }
 
 #---------------------------------------------------------------------
 ## @Type API
-## @See <@function var.lib.sorcery.modules.libgrimoire.html,real_default_pre_build> for more details.
+## @See <@function var.lib.sorcery.modules.libgrimoire.html,real_default_sorcery_pre_build> for more details.
 ## Creates the source directory and unpacks the source package into it.
 ## Used if no PRE_BUILD script is found for a spell.
 #---------------------------------------------------------------------
-function default_pre_build () {
-    debug "libapi" "default_pre_build - $*"
-    real_default_pre_build "$@"
+function default_sorcery_pre_build () {
+    debug "libapi" "default_sorcery_pre_build - $*"
+    real_default_sorcery_pre_build "$@"
 } 
 
 #---------------------------------------------------------------------
 ## @Type API
-## @See <@function var.lib.sorcery.modules.libgrimoire.html,real_default_pre_install> for more details.
+## @See <@function var.lib.sorcery.modules.libgrimoire.html,real_default_sorcery_pre_install> for more details.
 ## Only defined for BUILD_API==2
 ## Used if no PRE_INSTALL script is found.
 ## Default pre_install is:
@@ -400,33 +379,9 @@ ##  prepare_install
 ## </pre>
 ##
 #---------------------------------------------------------------------
-function default_pre_install () {
-    debug "libapi" "default_pre_install - $*"
-    real_default_pre_install "$@"
-}
-
-#---------------------------------------------------------------------
-## @Type API
-## @See <@function var.lib.sorcery.modules.libdispel.html,real_default_pre_remove> for more details.
-##
-## Default pre_remove code, just no-op for now.
-##
-#---------------------------------------------------------------------
-function default_pre_remove() {
-    debug "libapi" "$FUNCNAME - $*"
-    real_default_pre_remove "$@"
-}
-
-#---------------------------------------------------------------------
-## @Type API
-## @See <@function var.lib.sorcery.modules.libdepends.html,real_default_prepare> for more details.
-##
-## Default prepare code, just no-op for now.
-##
-#---------------------------------------------------------------------
-function default_prepare() {
-    debug "libapi" "$FUNCNAME - $*"
-    real_default_prepare "$@"
+function default_sorcery_pre_install () {
+    debug "libapi" "default_sorcery_pre_install - $*"
+    real_default_sorcery_pre_install "$@"
 }
 
 #---------------------------------------------------------------------
@@ -562,9 +517,9 @@ function guess_compressor () {
 
 #------------------------------------------------------------------------
 ## @Type API
-## @param from	File we might want to install
-## @param to	File to replace
-## @param savetime	Backup time if necessary
+## @param from          File we might want to install
+## @param to            File to replace
+## @param savetime      Backup time if necessary
 ##
 ## @See <@function var.lib.sorcery.modules.libresurrect.html,real_handle_changed_config> for more details.
 ##
@@ -609,9 +564,9 @@ function installed_version () {
 
 #------------------------------------------------------------------------
 ## @Type API
-## @param from	File we might want to install
-## @param to	File to replace
-## @param savetime	Backup time if necessary (optional, defaults to
+## @param from          File we might want to install
+## @param to            File to replace
+## @param savetime      Backup time if necessary (optional, defaults to
 ##                      $(date +'%Y%m%d%H%M')
 ## @See <@function var.lib.sorcery.modules.libresurrect.html,real_install_config_file> for more details.
 ## Returns the current version of the given spell
@@ -657,7 +612,7 @@ ##
 #---------------------------------------------------------------------
 function list_remove () {
     debug "libapi" "list_remove - $*"
-	 real_list_remove "$@"
+    real_list_remove "$@"
 }
 
 #---------------------------------------------------------------------
@@ -856,7 +811,7 @@ ##
 #---------------------------------------------------------------------
 function persistent_load () {
     debug "libapi" "persistent_load - $*"
-	 real_persistent_load "$@"
+    real_persistent_load "$@"
 }
 
 #---------------------------------------------------------------------
@@ -872,7 +827,7 @@ ##
 #---------------------------------------------------------------------
 function persistent_remove () {
     debug "libapi" "persistent_remove - $*"
-	 real_persistent_remove "$@"
+    real_persistent_remove "$@"
 }
 
 #---------------------------------------------------------------------
@@ -1032,7 +987,7 @@ ## @param max depth
 ## @param fast (optional)
 ## @See <@function var.lib.sorcery.modules.libdepends.html,real_show_up_depends> for more details.
 ##
-## @stdout recursibely prints out the spell that depend on the specified spell
+## @stdout recursively prints out the spell that depend on the specified spell
 #---------------------------------------------------------------------
 function show_up_depends() {
     debug "libapi" "spell_ok - $*"
diff --git a/var/lib/sorcery/modules/libcast b/var/lib/sorcery/modules/libcast
index 36e9219..8a6c00f 100755
--- a/var/lib/sorcery/modules/libcast
+++ b/var/lib/sorcery/modules/libcast
@@ -99,9 +99,7 @@ function run_conflicts() {
 
   if  [  -x  $SCRIPT_DIRECTORY/CONFLICTS  ]; then
     local CONFLICTS=$(
-        persistent_load
-        . $SCRIPT_DIRECTORY/CONFLICTS
-        persistent_save
+        run_spell_file CONFLICTS conflicts
     )
 
     local tmp to_dispel=""
@@ -163,7 +161,7 @@ function query_custom_cflags() {
         CFLAGS) USER_SPELL_CFLAGS="$@"  ;;
         CXXFLAGS) USER_SPELL_CXXFLAGS="$@" ;;
         LDFLAGS) USER_SPELL_LDFLAGS="$@" ;;
-	CPPFLAGS) USER_SPELL_CPPFLAGS="$@" ;;
+        CPPFLAGS) USER_SPELL_CPPFLAGS="$@" ;;
       esac
     done
   fi
@@ -639,6 +637,9 @@ function create_compile_log()  {
   else
     $COMPRESSBIN  -f  <  $C_LOG  >  $COMPILE_LOGS/$SPELL-$VERSION$EXTENSION
   fi
+  message  "${MESSAGE_COLOR}Creating installwatch debug log"                \
+           "${FILE_COLOR}$COMPILE_LOGS/$SPELL-$VERSION.iwdbglog$EXTENSION"  \
+           "${DEFAULT_COLOR}"
   if [ -z "$EXTENSION" ]
   then
     cp $IW_DBGLOG $COMPILE_LOGS/$SPELL-$VERSION.iwdbglog
diff --git a/var/lib/sorcery/modules/libcodex b/var/lib/sorcery/modules/libcodex
index 32c8be4..29c2913 100755
--- a/var/lib/sorcery/modules/libcodex
+++ b/var/lib/sorcery/modules/libcodex
@@ -462,10 +462,14 @@ #---------------------------------------
 function codex_does_spell_exist() {
   local i
   local retValue=0
-  for i in $* ; do
-    if ! [[ `codex_find_spell_by_name $i` ]] ; then
+  [[ "$#" -lt 1 ]] && return 1
+  for i in "$@" ; do
+    if [[ "$i" == "" ]] ; then
+      message "${PROBLEM_COLOR}Empty string is not a spell!${DEFAULT_COLOR}"
+      retValue=1
+    elif ! [[ $(codex_find_spell_by_name "$i") ]] ; then
       message "${SPELL_COLOR}$i${PROBLEM_COLOR} is not a spell!${DEFAULT_COLOR}"
-	  retValue=1
+      retValue=1
     fi
   done
   return $retValue
@@ -737,18 +741,18 @@ ## is asked for.
 ##
 #---------------------------------------------------------------------
 function codex_create_cache()  {
-	
-	debug "libcodex" "codex_create_cache - $*"
-	local list="$*"
-	[[ $list ]] || list="${GRIMOIRE_DIR[*]}"
-
-	for i in $list ; do
-        codex_find_in_grimoire $i "DETAILS" | \
-			sed 's@\(.*\)/\([^/]*\)/DETAILS@\2 \1@' |	\
-			sort > $i/$SPELL_INDEX_FILE
-
-        codex_list_provides $i > "$i/$PROVIDE_INDEX_FILE"
-	done
+
+  debug "libcodex" "codex_create_cache - $*"
+  local list="$*"
+  [[ $list ]] || list="${GRIMOIRE_DIR[*]}"
+
+  for i in $list ; do
+    codex_find_in_grimoire $i "DETAILS" | \
+    sed 's@\(.*\)/\([^/]*\)/DETAILS@\2 \1@' | \
+    sort > $i/$SPELL_INDEX_FILE
+
+    codex_list_provides $i > "$i/$PROVIDE_INDEX_FILE"
+  done
 
 }
 
diff --git a/var/lib/sorcery/modules/libdepends b/var/lib/sorcery/modules/libdepends
index fb62b24..2dd5372 100755
--- a/var/lib/sorcery/modules/libdepends
+++ b/var/lib/sorcery/modules/libdepends
@@ -87,26 +87,14 @@ function run_prepare() 
   # these are here so you can source section/grimoire level scripts in
   # PREPARE, which by definition runs before the spell is loaded
   # and they are defined as usual (see bug 8329)
-  local SPELL_DIRECTORY=$SCRIPT_DIRECTORY
-  local SECTION_DIRECTORY=${SPELL_DIRECTORY%/*}
-  local GRIMOIRE=${SECTION_DIRECTORY%/*}
+  codex_get_spell_paths "$SCRIPT_DIRECTORY"
 
   local PROTECT_SORCERY=yes
-  persistent_load &&
-  if  [  -x  $SCRIPT_DIRECTORY/PREPARE  ];  then
-    . $SCRIPT_DIRECTORY/PREPARE
-  else
-    default_prepare
-  fi
+  run_spell_file PREPARE prepare
   rc=$?
-  persistent_save
   return $rc
 }
 
-function real_default_prepare() {
-  :
-}
-
 #---------------------------------------------------------------------
 ## This will be home to all "other" questions we are supposed to ask about
 ## during this phase of things, right now its a placeholder
@@ -129,55 +117,38 @@ #---------------------------------------
 ## Run the spell's CONFIGURE script if it exists
 ## @param Spell to configure
 #---------------------------------------------------------------------
-function run_configure() 
-{
-
+function run_configure() {
   local SPELL=$1
   debug "cast" "run_configure() - SCRIPT_DIRECTORY = $SCRIPT_DIRECTORY"
 
-  local PROTECT_SORCERY=yes
-  persistent_load &&
-  if  [  -x  $SCRIPT_DIRECTORY/CONFIGURE  ];  then
+  function run_configure_msg() {
     depends_message  "${SPELL}" "running configuration..."
-    . $SCRIPT_DIRECTORY/CONFIGURE
-  else
-    default_configure
-  fi
+  }
+
+  local PROTECT_SORCERY=yes
+  run_spell_file CONFIGURE configure run_configure_msg
   rc=$?
-  persistent_save
   return $rc
 }
 
-function real_default_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
-  persistent_load &&
-  if  [  -x  $SCRIPT_DIRECTORY/DEPENDS  ];  then
-    depends_message  "${SPELL}" "checking dependencies..."
-    .  $SCRIPT_DIRECTORY/DEPENDS
-  else
-    default_depends
-  fi
+  run_spell_file DEPENDS depends run_depends_msg
   rc=$?
-  persistent_save
   return $rc
 }
 
-function real_default_depends() {
-  :
-}
-
 #---------------------------------------------------------------------
 ## Run a spell's UP_TRIGGERS if it exists
 ## @param Spell
@@ -185,17 +156,14 @@ #---------------------------------------
 function run_up_triggers() {
   local SPELL=$1
   debug "cast" "run_up_triggers() - SCRIPT_DIRECTORY = $SCRIPT_DIRECTORY"
- 
-  local PROTECT_SORCERY=yes
-  if  [  -x  $SCRIPT_DIRECTORY/UP_TRIGGERS ];  then
+
+  function run_up_triggers_msg() {
     depends_message  "${SPELL}" "checking for reverse triggers..."
-    # we need &&'s to preserve the proper return code (persistant_save
-    # will probably succeed even if PREPARE fails)
-    persistent_load &&
-    . $SCRIPT_DIRECTORY/UP_TRIGGERS &&
-    persistent_save
-  fi
-  
+  }
+  local PROTECT_SORCERY=yes
+  run_spell_file UP_TRIGGERS up_triggers run_up_triggers_msg
+  rc=$?
+  return $rc
 }
 
 #---------------------------------------------------------------------
@@ -272,6 +240,7 @@ function process_sub_depends() {
   local requester=$1
   local sub_dependee=$2
   local sub_depends=$3
+  local PROTECT_SORCERY=yes
 
   if test -x $SCRIPT_DIRECTORY/SUB_DEPENDS; then
     if ! list_find "$(hash_get processed_sub_depends $sub_dependee)" "$sub_depends"; then
@@ -279,9 +248,7 @@ function process_sub_depends() {
 
       local THIS_SUB_DEPENDS=$sub_depends
       local PROCESSED_SUB_DEPENDS=$(hash_get processed_sub_depends $sub_dependee)
-      persistent_load &&
-      source $SCRIPT_DIRECTORY/SUB_DEPENDS &&
-      persistent_save || return 1
+      run_spell_file SUB_DEPENDS sub_depends || return 1
       hash_append processed_sub_depends $sub_dependee $sub_depends
     else
       debug libdepends "SUB_DEPENDS: $sub_dependee needs to provide $sub_depends but has already been processed"
@@ -312,19 +279,20 @@ function compute_installed_depends() {
   local hash=$1
   touch $DEPENDS_STATUS $SPELL_STATUS &>/dev/null
 
-  local pattern
+  local pattern status
   if [[ $2 ]] ; then
     pattern="required|optional|runtime|suggest"
   else
     pattern="required|optional"
   fi
+  status=${3:-on}
 
   # From here forward $1 and $2 are only used to refer to awk variables
 
   # sub(/(.*)/, "", $2) removes a provider name
-  eval $(awk -v pattern="$pattern" -F : 'BEGIN {
+  eval $(awk -v pattern="$pattern" -v status="$status" -F : 'BEGIN {
     while (getline < ARGV[1] ) {
-      if( $3=="on" && ( $4 ~ pattern ) ) {
+      if( $3==status && ( $4 ~ pattern ) ) {
         sub(/\(.*\)/, "", $2);
         depmap[$1]=depmap[$1]" "$2" "
       }
@@ -348,19 +316,21 @@ function compute_reverse_installed_depen
   #$1==hash table to fill
   local hash=$1
   touch $DEPENDS_STATUS $SPELL_STATUS &>/dev/null
-  local pattern
+
+  local pattern status
   if [[ $2 ]] ; then
     pattern="required|optional|runtime|suggest"
   else
     pattern="required|optional"
   fi
+  status=${3:-on}
 
   # From here forward $1 and $2 are only used to refer to awk variables
 
   # sub(/(.*)/, "", $2) removes a provider name
-  eval $(awk -v pattern="$pattern" -F : 'BEGIN {
+  eval $(awk -v pattern="$pattern" -v status="$status" -F : 'BEGIN {
     while (getline < ARGV[1] ) {
-      if( $3=="on" && ( $4 ~ pattern ) ) {
+      if( $3==status && ( $4 ~ pattern ) ) {
         sub(/\(.*\)/, "", $2);
         depmap[$2]=depmap[$2]" "$1" "
       }
@@ -409,7 +379,7 @@ function compute_uninstalled_depends() 
   local spell spells
   spells=( $@ )
 
-  PRETEND_NOT_INSTALLED=" $@ "
+  PRETEND_NOT_INSTALLED=$(echo "$@"|tr " " "\n")
 
   local _idx
   
@@ -536,7 +506,7 @@ function private_should_cast()
   # order is important here...
   if ! codex_does_spell_exist $1; then
     return 1
-  elif echo "$PRETEND_NOT_INSTALLED" | grep -q " $1 " ; then
+  elif echo "$PRETEND_NOT_INSTALLED" | grep -x -q "$1" ; then
     # always look at stuff on the command line unless its exiled
     return 0
   # from here on the spell was not on the command line...
@@ -643,6 +613,12 @@ function real_generic_required_depends()
     shift 2
   fi
 
+  if [[ $1 != ${1/ /} ]] ; then
+    message "${PROBLEM_COLOR}Spell names must not contain spaces:" \
+            "${DEFAULT_COLOR}${SPELL_COLOR}$1${DEFAULT_COLOR}"
+    return 1
+  fi
+
   # see if theres another grimoire
   if [[ "$4" ]] && ! [[ "$OVERRIDE_GRIMOIRES" ]] ; then
     local grimoire here nothere current
@@ -772,6 +748,12 @@ function real_generic_optional_depends()
     shift 2
   fi
 
+  if [[ $1 != ${1/ /} ]] ; then
+    message "${PROBLEM_COLOR}Spell names must not contain spaces:" \
+            "${DEFAULT_COLOR}${SPELL_COLOR}$1${DEFAULT_COLOR}"
+    return 1
+  fi
+
   # see if theres another grimoire
   if [[ "$5" ]] && ! [[ "$OVERRIDE_GRIMOIRES" ]] ; then
     local grimoire here nothere current
@@ -932,20 +914,20 @@ function work_depends_provider()
   # check if theres an abandoned answer, but only if its still a provider
   if [[ ! $default ]] && [ -e $ABANDONED_DEPENDS/$SPELL ] ; then
     tmp=$(search_depends_status $ABANDONED_DEPENDS/$SPELL "$SPELL" ".*($1)"|awk -F: '{print $2;exit}')
-    [[ $tmp ]] && echo $CANDIDATES|grep -q "\<$tmp\>" && default=$tmp
+    [[ $tmp ]] && echo $CANDIDATES|grep -x -q "$tmp" && default=$tmp
   fi
 
   # check if theres a default provider
   if [[ ! $default ]]; then
     explode "$(search_default_provider $DEFAULT_PROVIDERS ".*" "$1")" ":" "status"
     tmp=${status[0]}
-    [[ $tmp ]] && echo $CANDIDATES|grep -q "\<$tmp\>" && default=$tmp
+    [[ $tmp ]] && echo $CANDIDATES|grep -x -q "$tmp" && default=$tmp
   fi
 
   # check if we've already answered this question
   if [[ ! $default ]]; then
     for tmp in $CANDIDATES; do
-      echo ${spells[@]} | grep -q "\<$tmp\>" && default=$tmp && break
+      echo ${spells[@]} | tr " " "\n"| grep -x -q "$tmp" && default=$tmp && break
     done
   fi
 
@@ -1037,7 +1019,7 @@ function work_optional_depends_provider(
   # check if theres an abandoned answer, but only if its still a provider
   if [[ ! $default ]] && [ -e $ABANDONED_DEPENDS/$SPELL ] ; then
     tmp=$(search_depends_status_simple $ABANDONED_DEPENDS/$SPELL "$SPELL" ".*($1)" "on"|awk -F: '{print $2;exit}')
-    if [[ $tmp ]] && echo $CANDIDATES|grep -q "\<$tmp\>" ; then
+    if [[ $tmp ]] && echo $CANDIDATES|grep -x -q "$tmp" ; then
       default=$tmp
     else
       tmp=$(search_depends_status_simple $ABANDONED_DEPENDS/$SPELL "$SPELL" ".*($1)" "off")
@@ -1059,7 +1041,7 @@ function work_optional_depends_provider(
         # if the user said "on" use the default rather than none
         # unless theres something wrong with the provider they chose 
         # in which case fall back to none
-        [[ $tmp ]] && echo $CANDIDATES|grep -q "\<$tmp\>" &&
+        [[ $tmp ]] && echo $CANDIDATES|grep -x -q "$tmp" &&
         default=$tmp || default=none
       else
         default=none
@@ -1070,7 +1052,7 @@ function work_optional_depends_provider(
   # check if we've already answered this question
   if [[ ! $default ]]; then
     for tmp in $CANDIDATES; do
-      echo ${spells[@]} | grep -q "\<$tmp\>" && default=$tmp && break
+      echo ${spells[@]} | tr " " "\n" | grep -x -q "$tmp" && default=$tmp && break
     done
   fi
 
@@ -1177,7 +1159,7 @@ function work_optional_depends_spell()
   if [[ ! $default ]]; then
     debug "libdepends" "Checking in queue"
     #\< and \> match the empty string at the start and end of a word
-    echo ${spells[@]} | grep -q "\<$1\>" && default=on
+    echo ${spells[@]}|tr " " "\n" | grep -x -q "$1" && default=on
   fi
 
   # check if installed/held
@@ -1293,8 +1275,12 @@ function private_up_trigger() {
   # this maps trigerees to triggerers
   # cast_self:perl_module -> perl
   hash_append trg_r_hash  "$TARGET:$ACTION" " $SPELL "
-  echo $NEW_DEPENDS | grep -q "$TARGET" || 
+
+  # 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[@]} |tr " " "\n"| grep -x -q "$TARGET" || 
   NEW_DEPENDS=( ${NEW_DEPENDS[*]} $spell)
+
   triggerees=( ${triggerees[*]} $TARGET )
 }
 
@@ -1331,10 +1317,8 @@ function real_sub_depends() {
       if ! tablet_set_spell $sub_dependee ; then
         codex_set_current_spell_by_name $sub_dependee || return 1
       fi
-      test -x $SCRIPT_DIRECTORY/PRE_SUB_DEPENDS || return 1
-      persistent_load &&
-      source $SCRIPT_DIRECTORY/PRE_SUB_DEPENDS; rc=$?
-      persistent_save
+      run_spell_file PRE_SUB_DEPENDS pre_sub_depends
+      rc=$?
       return $rc
     ) && {
       debug "libdepends" "adding altruistic sub-depends for $sub_dependee with $sub_depends from $requester"
@@ -1348,7 +1332,7 @@ function real_sub_depends() {
 
   # if didnt return above, then we know the sub-depends is not on the system
   # so the spell must be (re)cast, check to see if we're allowed to do that
-  if ! echo "$PRETEND_NOT_INSTALLED" | grep -q " $1 "  &&
+  if ! echo "$PRETEND_NOT_INSTALLED" | grep -x -q "$1"  &&
      spell_held $sub_dependee; then
     # spell is held and not explicitly requested, so we cant recast the
     # spell with the sub-depends requested
@@ -1416,7 +1400,7 @@ #---------------------------------------
 ## Default trigger checking function. Asks user if they want to
 ## run the trigger.
 #---------------------------------------------------------------------
-function default_trigger_check() {
+function default_sorcery_trigger_check() {
   message  "${SPELL_COLOR}${SPELL}${DEFAULT_COLOR}" \
            "${CHECK_COLOR}triggers a" \
            "${SPELL_COLOR}${ACTION}${DEFAULT_COLOR}" \
@@ -1438,15 +1422,8 @@ function private_add_triggerees() {
   # run the trigger check file
   # this is made into a sub-function just to reduce duplication...
   function private_add_triggerees_sub1() {
-    running_trigger=0
-    persistent_load
-    if test -x $SCRIPT_DIRECTORY/TRIGGER_CHECK; then
-      source $SCRIPT_DIRECTORY/TRIGGER_CHECK
-    else
-      default_trigger_check
-    fi
+    run_spell_file TRIGGER_CHECK trigger_check
     running_trigger=$?
-    persistent_save
     if [[ $running_trigger == 0 ]] ; then
       private_up_trigger "$SPELL" "$TARGET" "$ACTION"
     fi
@@ -1488,7 +1465,7 @@ function private_add_depends()
   # force implied basesystem dependency in the depends tree
   if [[ $FORCE_BASESYSTEM_DEPENDS == on ]] &&
      [[ $SPELL != basesystem ]] &&
-     ! echo $base_deps| grep -q $SPELL; then
+     ! echo $base_deps|grep -x -q "$SPELL"; then
     hash_append "$CAST_HASH" "$SPELL" "basesystem"
     hash_append "$BACK_CAST_HASH" "basesystem" "$SPELL"
   fi
@@ -1550,15 +1527,15 @@ ## Removes a dependency from the list.
 #---------------------------------------------------------------------
 function private_remove_dependees()
 {
-	local SPELL=$1
-        local i
-	echo "Removing dependees of $1"
-
-	# spell is being removed from cast list, add to FAILED_LIST
-	echo "$SPELL" >> $FAILED_LIST
-        hash_put depends_looked_at $SPELL failed
-        hash_unset "$CAST_HASH" "$SPELL"
-        hash_put $CANNOT_CAST_HASH "$SPELL" "Failed"
+  local SPELL=$1
+  local i
+  echo "Removing dependees of $1"
+
+  # spell is being removed from cast list, add to FAILED_LIST
+  echo "$SPELL" >> $FAILED_LIST
+  hash_put depends_looked_at $SPELL failed
+  hash_unset "$CAST_HASH" "$SPELL"
+  hash_put $CANNOT_CAST_HASH "$SPELL" "Failed"
 }
 
 #---------------------------------------------------------------------
@@ -1573,7 +1550,7 @@ function run_spell_config() 
     
   if  [  -x  $SPELL_CONFIG  ];  then
     debug "libdepends" "run_spell_config() - found $SPELL_CONFIG"
-	.  $SPELL_CONFIG
+    .  $SPELL_CONFIG
   fi
 }
 
@@ -1587,7 +1564,7 @@ function real_show_up_depends()  
 {
     local i=0
     local MAX_DEPTH=$2
-    local fast=$3
+    local type=$3
     function show_up_depends_sub() {
         local each
         let i++
@@ -1597,18 +1574,20 @@ function real_show_up_depends()  
                 hash_put done $each done
                 echo $each:$1
                 show_up_depends_sub $each
+            elif [[ "$type" == "verbose" ]] ; then
+                echo $each:$1
             fi
         done
     }
     hash_reset foo
     hash_reset done
     compute_reverse_installed_depends foo
-    if [[ $fast ]] ; then
-      show_up_depends_sub "$1"|cut -f1 -d:
-    else 
+    if [[ "$type" == "verbose" ]] ; then
       show_up_depends_sub "$1"|while read line; do
         grep "$line" "$DEPENDS_STATUS"
       done
+    else 
+      show_up_depends_sub "$1"|cut -f1 -d:
     fi|sort|uniq
     hash_reset foo
     hash_reset done
diff --git a/var/lib/sorcery/modules/libdispel b/var/lib/sorcery/modules/libdispel
index da09924..ea078cc 100755
--- a/var/lib/sorcery/modules/libdispel
+++ b/var/lib/sorcery/modules/libdispel
@@ -273,46 +273,22 @@ #-----
 function pre_remove() {
   local rc=0
   if  [[ $SCRIPT_DIRECTORY ]] ; then
-    persistent_load &&
-    if test  -x  $SCRIPT_DIRECTORY/PRE_REMOVE ; then
-      . $SCRIPT_DIRECTORY/PRE_REMOVE
-    else
-      default_pre_remove
-    fi
-    rc=$?
-    persistent_save
+    run_spell_file PRE_REMOVE pre_remove
   fi
   return $rc
 }
 
-function real_default_pre_remove() {
-  :
-}
-
 #-----
 ## Run the POST_REMOVE script if it exists.
 #-----
 function post_remove() {
   local rc=0
   if  [[ $SCRIPT_DIRECTORY ]] ; then
-    persistent_load &&
-    if test  -x  $SCRIPT_DIRECTORY/POST_REMOVE ; then
-      . $SCRIPT_DIRECTORY/POST_REMOVE
-    else
-      default_post_remove
-    fi
-    rc=$?
-    persistent_save
+    run_spell_file POST_REMOVE post_remove
   fi
   return $rc
 }
 
-function real_default_post_remove() {
-  :
-}
-
-
-
 #---------------------------------------------------------------------
 ## Dispel a spell
 #---------------------------------------------------------------------
@@ -364,7 +340,7 @@ function dispel_spell() {
 }
 
 #---------------------------------------------------------------------
-## @param	default value
+## @param    default value
 ## Set one of always, ask_yes, ask_no, and ignore to on based
 ## on the value of default, leave the remaining as off.
 #---------------------------------------------------------------------
@@ -384,9 +360,9 @@ function dispel_depends_value_to_items()
 
 
 #---------------------------------------------------------------------
-## @param	Title of the menu
-## @param	Name of the parameter being set
-## @param	Default value of the parameter being set
+## @param    Title of the menu
+## @param    Name of the parameter being set
+## @param    Default value of the parameter being set
 ##
 ## Present a radiolist menu with the quad-options for one of various
 ## dependency following options.
diff --git a/var/lib/sorcery/modules/libdownload b/var/lib/sorcery/modules/libdownload
index 7c396c5..953ff06 100755
--- a/var/lib/sorcery/modules/libdownload
+++ b/var/lib/sorcery/modules/libdownload
@@ -59,7 +59,7 @@ ##
 ## Download a specified group of urls, they are assumed to all be understood
 ## by the specified handler.
 ##
-## @Param type	Name of handler
+## @Param type  Name of handler
 ## The remainder of the arguments are target, url_list, hints, dl_target
 ## and dl_type. See above for information.
 ##
diff --git a/var/lib/sorcery/modules/libhash b/var/lib/sorcery/modules/libhash
index 696191e..2b5c35e 100755
--- a/var/lib/sorcery/modules/libhash
+++ b/var/lib/sorcery/modules/libhash
@@ -246,7 +246,7 @@ function hash_get_table()  {
   VARIABLES=`eval 'echo ${!'${TABLE_NAME}'*}'`
   
   for i in $VARIABLES; do
-  	echo -n "${!i}${separator}"
+    echo -n "${!i}${separator}"
   done
   
 }
diff --git a/var/lib/sorcery/modules/liblock b/var/lib/sorcery/modules/liblock
index 010da47..82ff964 100755
--- a/var/lib/sorcery/modules/liblock
+++ b/var/lib/sorcery/modules/liblock
@@ -111,12 +111,12 @@ #  fi
 
   while find $LOCK_DIR -mindepth 1 -maxdepth 1 -name "$1.*" | grep -q '';
   do    
-		#^^^ look if a lock exists of the given type (ugly code)
+    #^^^ look if a lock exists of the given type (ugly code)
     global_clean_resources
     local SLEEP=$(( ${RANDOM} % ${MAX_SLEEP} ))
     sleep "$SLEEP"
   done 
-	#theoretically, someone could create a lock now... tiny race
+  #theoretically, someone could create a lock now... tiny race
   trylock_resources "$@"
 }
 
@@ -186,8 +186,8 @@ 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)
+    while read file; do
+      # check if the process still exist (we use procfs mounted on /proc)
       if [ ! -d "${file}" ]; then
           debug "global_clean_resources" "removing stale lock ${file}"
           rm -f "${file}" 2>/dev/null &&
@@ -198,8 +198,8 @@ global_clean_resources()
 }
 
 #---------------------------------------------------------------------
-##	@param Name of file to lock
-##	@param <file> ... (optional)
+## @param Name of file to lock
+## @param <file> ... (optional)
 ##
 ## 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
@@ -212,37 +212,37 @@ ##
 #---------------------------------------------------------------------
 function lock_file()
 {
-	debug "liblock" "$FUNCNAME - $*"
-	local FILE
-	lock_resources $( 
-		for FILE in "$@" ; do
-			echo file $FILE
-		done
-	)
+  debug "liblock" "$FUNCNAME - $*"
+  local FILE
+  lock_resources $( 
+    for FILE in "$@" ; do
+      echo file $FILE
+    done
+  )
 }
 
 
 #---------------------------------------------------------------------
-##	@param Name of file to unlock
-##	@param <file> ... (optional)
+## @param Name of file to unlock
+## @param <file> ... (optional)
 ##
 ## Unlocks a file so that another process can lock and modify it.
 ##
 #---------------------------------------------------------------------
 function unlock_file()
 {
-	debug "liblock" "$FUNCNAME - $*"
-	local FILE
-	unlock_resources $(
-		for FILE in "$@" ; do
-			echo file $FILE
-		done
-	)
+  debug "liblock" "$FUNCNAME - $*"
+  local FILE
+  unlock_resources $(
+  for FILE in "$@" ; do
+    echo file $FILE
+  done
+  )
 }
 
 #---------------------------------------------------------------------
-##	@param File to start transaction on
-##	@param <file> ... (optional)
+## @param File to start transaction on
+## @param <file> ... (optional)
 ##
 ## 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
@@ -252,7 +252,7 @@ ## making any changes to the files. All 
 ## 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
+## @return The name of a temporary file that should be written to
 ## instead of the real file.
 ##
 #---------------------------------------------------------------------
@@ -292,8 +292,8 @@ function lock_start_transaction()
 }
 
 #---------------------------------------------------------------------
-##	@param File to commit transaction of
-##	@param <file> ... (optional)
+## @param File to commit transaction of
+## @param <file> ... (optional)
 ##
 ## Commits the changes made to the files as atomicaly as possible
 ## Before this func is called, the files remain unchanged.
@@ -337,8 +337,8 @@ function lock_commit_transaction()
 }
 
 #---------------------------------------------------------------------
-##	@param File to stop the transaction of
-##	@param file ... (optional)
+## @param File to stop the transaction of
+## @param file ... (optional)
 ##
 ## Stops a transaction. Causes the changes to the file(s) to be
 ## ignored/undone.
diff --git a/var/lib/sorcery/modules/libmisc b/var/lib/sorcery/modules/libmisc
index b11e519..37c7064 100755
--- a/var/lib/sorcery/modules/libmisc
+++ b/var/lib/sorcery/modules/libmisc
@@ -68,8 +68,8 @@ ## Argument is a string to check if the 
 ## not
 #--------------------------------------------------------------------
 function isdigit() {
-	echo $1 | grep '[[:digit:]]+' >> /dev/null 2>&1 &&
-	return 0
+  echo $1 | grep '[[:digit:]]+' >> /dev/null 2>&1 &&
+  return 0
 }
 
 #--------------------------------------------------------------------
@@ -79,8 +79,8 @@ ##
 ## Argumtemt is a string to check if it contains all chars a-zA-Z
 #--------------------------------------------------------------------
 function isalpha() {
-	echo $1 | grep '[[:alpha:]]+' >> /dev/null 2>&1 &&
-	return 0
+  echo $1 | grep '[[:alpha:]]+' >> /dev/null 2>&1 &&
+  return 0
 }
 
 #---------------------------------------------------------------------
@@ -329,9 +329,9 @@ function sound()  {
     on)  SOUND_FILE=$SOUND_DIRECTORY/$SOUND_THEME/$1
          if  [  -e  $SOUND_FILE  ];  then
            (  cd  /  ;  play  $SOUND_FILE  2>/dev/null  & )
-	   debug "libmisc" "Playing $SOUND_FILE"
-	 else
-	   debug "libmisc" "Error playing $SOUND_FILE: no such file"
+           debug "libmisc" "Playing $SOUND_FILE"
+         else
+           debug "libmisc" "Error playing $SOUND_FILE: no such file"
          fi
     ;;
   esac
@@ -1156,10 +1156,10 @@ function smgl_which() {
       BREAK=yes
     fi
   }
-	if [ -z "$1" -o -z "$2" ]; then
-		echo "smgl_which: Not enough arguments"
-		return 1
-	fi
+  if [ -z "$1" -o -z "$2" ]; then
+    echo "smgl_which: Not enough arguments"
+    return 1
+  fi
   location=$(iterate smgl_which_sub : "$PATH")
   if [[ "$location" ]]  ; then
     eval "$2=$location"
diff --git a/var/lib/sorcery/modules/libresurrect b/var/lib/sorcery/modules/libresurrect
index 7e9cd34..b74a6d1 100755
--- a/var/lib/sorcery/modules/libresurrect
+++ b/var/lib/sorcery/modules/libresurrect
@@ -401,9 +401,9 @@ function resurrect_sub() {
 
 
 #------------------------------------------------------------------------
-## @param from	File we might want to install
-## @param to	File to replace
-## @param savetime	Backup time if necessary (optional, defaults to
+## @param from        File we might want to install
+## @param to          File to replace
+## @param savetime    Backup time if necessary (optional, defaults to
 ##                      $(date +'%Y%m%d%H%M')
 #------------------------------------------------------------------------
 function real_install_config_file() {
@@ -430,10 +430,10 @@ function real_install_config_file() {
 }
 
 #------------------------------------------------------------------------
-## @param from	File we might want to install
-## @param to	File to replace
-## @param savetime	Backup time if necessary
-## @param md5_log	MD5 log for previous version of the spell,
+## @param from          File we might want to install
+## @param to            File to replace
+## @param savetime      Backup time if necessary
+## @param md5_log       MD5 log for previous version of the spell,
 #                       must be in root form
 #------------------------------------------------------------------------
 function internal_install_config_file() {
@@ -490,9 +490,9 @@ function internal_install_config_file() 
 }
 
 #------------------------------------------------------------------------
-## @param from	File we might want to install
-## @param to	File to replace
-## @param savetime	Backup time if necessary
+## @param from          File we might want to install
+## @param to            File to replace
+## @param savetime      Backup time if necessary
 ##
 ## Present the user with the following menu
 ## (0) trash $to and install over it
diff --git a/var/lib/sorcery/modules/libscreen b/var/lib/sorcery/modules/libscreen
index 401a6cc..db635e5 100755
--- a/var/lib/sorcery/modules/libscreen
+++ b/var/lib/sorcery/modules/libscreen
@@ -4,9 +4,9 @@ #-----
 ## Output a short message about using libscreen
 #-----
 function screen_quick_intro() {
-	message "${MESSAGE_COLOR}Using screen mode. Watch the bottom for notices."
-	message "${MESSAGE_COLOR}Press ^A-n and ^A-p to cycle through windows."
-	message "${MESSAGE_COLOR}Screen help is available with ^A-? (control-a ?)${DEFAULT}"
+  message "${MESSAGE_COLOR}Using screen mode. Watch the bottom for notices."
+  message "${MESSAGE_COLOR}Press ^A-n and ^A-p to cycle through windows."
+  message "${MESSAGE_COLOR}Screen help is available with ^A-? (control-a ?)${DEFAULT}"
 }
 
 #-----
diff --git a/var/lib/sorcery/modules/libsecurity b/var/lib/sorcery/modules/libsecurity
index 285155a..9325ea5 100755
--- a/var/lib/sorcery/modules/libsecurity
+++ b/var/lib/sorcery/modules/libsecurity
@@ -217,7 +217,7 @@ function gaze_checkmd5syntax () {
     fi
   fi
   echo -en "${DEFAULT_COLOR}"
-	
+
 }
 
 #---------------------------------------------------------------------
@@ -278,7 +278,7 @@ #---------------------------------------
 function gaze_md5check() {
 
   message "${MESSAGE_COLOR}Going to check the md5 sums for the requested item, section or"
-	message "grimoire by testing your current collection of sources...${DEFAULT_COLOR}"
+  message "grimoire by testing your current collection of sources...${DEFAULT_COLOR}"
 
   source /etc/sorcery/config
 
diff --git a/var/lib/sorcery/modules/libsorcery b/var/lib/sorcery/modules/libsorcery
index 0e33b66..12ec692 100755
--- a/var/lib/sorcery/modules/libsorcery
+++ b/var/lib/sorcery/modules/libsorcery
@@ -31,10 +31,13 @@ function update_sorcery_scripts() {
     if [[ `codex_find_spell_by_name basesystem` ]] ; then
       if ! spell_ok basesystem  ; then
         cast basesystem
-      fi
-      if [ "$UPDATEFIX" == on ] ; then
+      fi &&
+      if [[ "$UPDATEFIX" == on ]] ; then
         cleanse --fix basesystem
       fi
+      if [[ $? != 0 ]] ; then
+        query "Would you like to continue anyway?" y || return 1
+      fi
     fi
   }
 
@@ -326,10 +329,10 @@ function save_binaries()  {
     then
       if  [  -h  $LINE  ];  then
         DEST=$( readlink "$LINE" )
-				mkdir -p $( dirname $OLD_BINS/$LINE )
+        mkdir -p $( dirname $OLD_BINS/$LINE )
         ln  -sf  $DEST  $OLD_BINS/$LINE
       else
-			  mkdir -p $( dirname $OLD_BINS/$LINE )
+        mkdir -p $( dirname $OLD_BINS/$LINE )
         cp  $LINE  $OLD_BINS/$LINE
       fi
       echo       $OLD_BINS/$LINE >> $SAVED
@@ -341,9 +344,9 @@ function save_binaries()  {
   unlock_file $SAVED
 
   for dir in $( find $OLD_BINS )
-	do
-	  if [[ -d $dir ]]
-		then
+  do
+    if [[ -d $dir ]]
+    then
       export PATH=$( envar_prepend_path "$dir" "$PATH" )
     fi
   done
@@ -450,7 +453,7 @@ #---------------------------------------
 function files()  {
 
   while  read       ITEM;   do
- 	
+ 
     if  [     -f  "$ITEM"  ]   &&
         !  [  -h  "$ITEM"  ];  then
       echo "$ITEM"
@@ -862,12 +865,15 @@ ##
 #---------------------------------------------------------------------
 function update_install_queue()  {
   local line spell curr_version curr_updated page_dir info curr_patchlevel
-  local curr_sec_patch
+  local curr_sec_patch count size
   local tmp_queue=$TMP_DIR/install_queue
   touch $tmp_queue
 
   message  "${CHECK_COLOR}Generating list of spells to update... ${DEFAULT_COLOR} "
+  count=0
+  size=$(all_spell_status | wc -l)
   for  line  in  `all_spell_status`;  do
+    progress_bar $count $size 50
     #0=spell, 1=date, 2=status, 3=version
     explode "$line" ":" "info"
     spell=${info[0]}
@@ -883,8 +889,9 @@ function update_install_queue()  {
                                    "$curr_updated" "$tmp_queue"
       fi
     )
+  let count++
   done
-
+  clear_line
   lock_file $INSTALL_QUEUE
   rm  -f  $INSTALL_QUEUE
   sort $tmp_queue | uniq > $INSTALL_QUEUE
@@ -1233,37 +1240,6 @@ function boost() {
 
 
 #---------------------------------------------------------------------
-## @Stdout spelllist
-## Returns a list of all installed spells that use linux-pam
-##
-## NOTE: this will become useless when triggers are introduced.
-##
-#---------------------------------------------------------------------
-function find_pam_aware()  { (
-
-  cat  $SPELL_STATUS    |
-  while  read  LINE;  do
-
-     SPELL="`echo  $LINE  |  cut  -d  :  -f1`"
-    STATUS="`echo  $LINE  |  cut  -d  :  -f3`"
-
-    if  [  "$STATUS"  ==  "installed"  ]   ||
-        [  "$STATUS"  ==  "held"       ];  then
-
-      SPELL_DIRECTORY=`codex_find_spell_by_name  $SPELL`
-
-      if    [  -d  "$SPELL_DIRECTORY/pam.d"  ]  &&
-            [  "$SPELL"  !=  "linux-pam"              ]
-      then  echo  $SPELL
-      fi
-
-    fi
-  done
-
-) }
-
-
-#---------------------------------------------------------------------
 ##
 ## Given a list of source files, returns true if each file exists.
 ##
diff --git a/var/lib/sorcery/modules/libspell b/var/lib/sorcery/modules/libspell
new file mode 100644
index 0000000..79ecde0
--- /dev/null
+++ b/var/lib/sorcery/modules/libspell
@@ -0,0 +1,207 @@
+#!/bin/bash
+#---------------------------------------------------------------------
+## @Synopsis Functions for running spell files.
+## @Copyright (C) 2006 The Source Mage Team <http://www.sourcemage.org>
+## @Contributers Andrew Stitt <astitt at sourcemage.org>
+##
+## This file implements SourceMage's spell file inheritence scheme.
+## In a nutshell, sorcery implements a default for each and every spell
+## file, usually this is "true". There can be an override at the grimoire
+## or section level, in addition to the spell file itself. This means
+## you can write a spell level PRE_BUILD, do some stuff then call
+## default_pre_build, which will run a section level PRE_BUILD if it
+## exists, or run a grimoire level PRE_BUILD if that exists, or run the
+## sorcery supplied default. See bug 10914.
+#---------------------------------------------------------------------
+
+#---------------------------------------------------------------------
+## Setup default functions for spell files. Several of the core functions
+## are declared here as false so they exist, but are re-defined when in
+## the proper context. This is merely a safety valve.
+#---------------------------------------------------------------------
+function load_spell_file_functions() {
+  for each in $(
+    cat << EOF
+PREPARE:prepare
+CONFIGURE:configure
+DEPENDS:depends
+
+PRE_SUB_DEPENDS:pre_sub_depends
+SUB_DEPENDS:sub_depends
+
+CONFLICTS:conflicts
+
+PRE_BUILD:pre_build
+BUILD:build
+PRE_INSTALL:pre_install
+INSTALL:install
+POST_BUILD:post_build
+POST_INSTALL:post_install
+FINAL:final
+
+UP_TRIGGERS:up_triggers
+TRIGGERS:triggers
+TRIGGER_CHECK:trigger_check
+
+DOWNLOAD:download
+
+PRE_REMOVE:pre_remove
+POST_REMOVE:post_remove
+
+PRE_RESURRECT:pre_resurrect
+POST_RESURRECT:post_resurrect
+EOF
+); do
+    local NAME=${each%:*}
+    local name=${each#*:}
+
+    # Create the four libapi entry points for each file
+    eval "function default_${name}() {
+      real_default_${name}
+    }"
+    eval "function default_section_${name}() {
+      real_default_section_${name}
+    }"
+    eval "function default_grimoire_${name}() {
+      real_default_grimoire_${name}
+    }"
+    eval "function default_sorcery_${name}() {
+      real_default_sorcery_${name}
+    }"
+
+
+    # real_default_<file> always refers to the level above in the hierarchy.
+    # (section, grimoire or sorcery).
+    # its defined here as false, but is re-declared at various stages.
+    eval "function real_default_${name}() {
+      false
+    }"
+
+    # These two functions run the section/grimoire function and update
+    # the real_default_<file> function. Ignore this generic declaration,
+    # it is changed at runtime to private_default_<section|grimoire>_generic.
+    eval "function real_default_section_${name}() {
+      false
+    }"
+    eval "function real_default_grimoire_${name}() {
+      false
+    }"
+
+    # If there isnt a sorcery default function, declare one as "true".
+    # Note that, the right thing happens regardless of what order lib files
+    # are sourced in.
+    declare -F real_default_sorcery_${name} &>/dev/null ||
+    eval "function real_default_sorcery_${name}() {
+      true
+    }"
+  done
+}
+load_spell_file_functions
+
+
+#---------------------------------------------------------------------
+## Run a section level file, or the default grimoire level function.
+#---------------------------------------------------------------------
+private_default_section_generic() {
+  eval "function real_default_${2}() {
+    default_grimoire_${2}
+  }"
+  if test -x "$SECTION_DIRECTORY/${1}"; then
+    source "$SECTION_DIRECTORY/${1}"
+  else
+    default_grimoire_${2}
+  fi;rc=$?
+  eval "function real_default_${2}() {
+    default_section_${2}
+  }"
+  return $rc
+}
+
+#---------------------------------------------------------------------
+## Run a grimoire level file, or the default sorcery level function.
+#---------------------------------------------------------------------
+private_default_grimoire_generic() {
+  eval "function real_default_${2}() {
+    default_sorcery_${2}
+  }"
+  if test -x "$GRIMOIRE/${1}"; then
+    source "$GRIMOIRE/${1}"
+  else
+    default_sorcery_${2}
+  fi;rc=$?
+  eval "function real_default_${2}() {
+    default_grimoire_${2}
+  }"
+  return $rc
+}
+
+#---------------------------------------------------------------------
+## Core entry point for sorcery to run a spell file.
+## Arms real_default_*_file functions then runs the spell file/cmd/function
+#---------------------------------------------------------------------
+function run_spell_file() {
+  local rc=0
+  local spell_file=$1
+  local function_suffix=$2
+  local spell_cmd_var=${1}_CMD
+  local spell_cmd=${!spell_cmd_var}
+
+  # this is mostly used for messages like "<spell> checking dependencies"
+  local pre_function=$3
+
+  eval "function real_default_${function_suffix}() {
+    default_section_${function_suffix}
+  }"
+  eval "function real_default_section_${function_suffix}() {
+    private_default_section_generic "${spell_file}" ${function_suffix}
+  }"
+  eval "function real_default_grimoire_${function_suffix}() {
+    private_default_grimoire_generic ${spell_file} ${function_suffix}
+  }"
+
+  persistent_load &&
+  if test -x "$SCRIPT_DIRECTORY/$spell_file"; then
+    [[ $pre_function ]] && $pre_function
+    . $SCRIPT_DIRECTORY/$spell_file
+  elif [[ "$spell_cmd" ]] ; then
+    [[ $pre_function ]] && $pre_function
+    $spell_cmd
+  else
+    default_${function_suffix}
+  fi;rc=$?
+  persistent_save
+
+  # restore these, so they're always false except when needed
+  eval "function real_default_${function_suffix}() {
+    false
+  }"
+  eval "function real_default_section_${function_suffix}() {
+    false
+  }"
+  eval "function real_default_grimoire_${function_suffix}() {
+    false
+  }"
+  return $rc
+}
+
+#------------------------------------------------------------------------
+##=back
+##
+##=head1 LICENSE
+##
+## 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
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This software is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this software; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+##
+#------------------------------------------------------------------------
+
diff --git a/var/lib/sorcery/modules/libstage b/var/lib/sorcery/modules/libstage
index 3c3bbeb..40b2a31 100755
--- a/var/lib/sorcery/modules/libstage
+++ b/var/lib/sorcery/modules/libstage
@@ -70,19 +70,23 @@ function stage_install_directory()
 {
   local DIR=$1
   local PERMISSION=$(stat -c %a "${STAGE_DIRECTORY}/TRANSL/${DIR}")
+  local OWNER=$(stat -c %U "${STAGE_DIRECTORY}/TRANSL/${DIR}")
+  local GROUP=$(stat -c %G "${STAGE_DIRECTORY}/TRANSL/${DIR}")
   if [[ ! -d $(dirname "${INSTALL_ROOT}/$DIR") ]]
   then
     # this shouldn't happen but just in case
     message "${PROBLEM_COLOR}Ah, not preserving permissions making $(dirname $DIR)${DEFAULT_COLOR}" &&
     mkdir -p $(dirname "${INSTALL_ROOT}/$DIR")
   fi &&
-  message "${FILE_COLOR}$PERMISSION $DIR${DEFAULT_COLOR}" &&
+  message "${FILE_COLOR}$PERMISSION $OWNER:$GROUP $DIR${DEFAULT_COLOR}" &&
   if [[ -d "$DIR" ]]
   then
-    chmod "$PERMISSION" "${INSTALL_ROOT}/$DIR"
+    chmod "$PERMISSION" "${INSTALL_ROOT}/$DIR" &&
+    chown $OWNER:$GROUP "${INSTALL_ROOT}/$DIR"
   else
     mkdir "$DIR"   &&
-    chmod "$PERMISSION" "${INSTALL_ROOT}/$DIR"
+    chmod "$PERMISSION" "${INSTALL_ROOT}/$DIR" &&
+    chown $OWNER:$GROUP "${INSTALL_ROOT}/$DIR"
   fi
 }
 
@@ -90,8 +94,10 @@ function stage_install_file()
 {
   local FILE=$1
   local PERMISSION=$(stat -c %a "${STAGE_DIRECTORY}/TRANSL/$FILE")
+  local OWNER=$(stat -c %U "${STAGE_DIRECTORY}/TRANSL/$FILE")
+  local GROUP=$(stat -c %G "${STAGE_DIRECTORY}/TRANSL/$FILE")
   local SAVE="$CONFIG_STAGE_DIRECTORY/$SPELL/current/$FILE"
-  message "${FILE_COLOR}$PERMISSION $FILE${DEFAULT_COLOR}"
+  message "${FILE_COLOR}$PERMISSION $OWNER:$GROUP $FILE${DEFAULT_COLOR}"
   case $2 in
     config)
       if [[ -e "${INSTALL_ROOT}/$FILE" ]]
@@ -105,7 +111,7 @@ function stage_install_file()
       ;;
     *)
       cp -fdp "$STAGE_DIRECTORY/TRANSL/$FILE" "${INSTALL_ROOT}/$FILE" 
-			;;
+      ;;
   esac
 }
 
@@ -113,7 +119,7 @@ function stage_install_symlink()
 {
   local FILE=$1
   local SAVE=$CONFIG_STAGE_DIRECTORY/$FILE.$(date +%Y%m%d%H%M%S)
-  message "${FILE_COLOR}Symlink $FILE${DEFAULT_COLOR}"
+  message "${FILE_COLOR}Symlink $FILE -> $(readlink "$STAGE_DIRECTORY/TRANSL/$FILE")${DEFAULT_COLOR}"
   case $2 in
     config)
       if [[ -e "${INSTALL_ROOT}/$FILE" ]]
@@ -131,6 +137,68 @@ function stage_install_symlink()
   esac
 }
 
+function stage_install_fifo()
+{
+  local FILE=$1
+  local SAVE=$CONFIG_STAGE_DIRECTORY/$FILE.$(date +%Y%m%d%H%M%S)
+  local PERMISSION=$(stat -c %a "${STAGE_DIRECTORY}/TRANSL/$FILE")
+  local OWNER=$(stat -c %U "${STAGE_DIRECTORY}/TRANSL/$FILE")
+  local GROUP=$(stat -c %G "${STAGE_DIRECTORY}/TRANSL/$FILE")
+  message "${FILE_COLOR}Fifo $PERMISSION $OWNER:$GROUP $FILE${DEFAULT_COLOR}"
+  case $2 in
+    config)
+      if [[ -e "${INSTALL_ROOT}/$FILE" ]]
+      then
+        touch "${INSTALL_ROOT}/$FILE" &&
+        mkdir -p $(dirname $SAVE) &&
+        mkfifo "${INSTALL_ROOT}/$SAVE" &&
+        chmod $PERMISSION "${INSTALL_ROOT}/$SAVE" &&
+        chown $OWNER:$GROUP "${INSTALL_ROOT}/$SAVE"
+      else
+        mkfifo "${INSTALL_ROOT}/$FILE" &&
+        chmod $PERMISSION "${INSTALL_ROOT}/$FILE" &&
+        chown $OWNER:$GROUP "${INSTALL_ROOT}/$FILE"
+      fi
+      ;;
+    *)
+      mkfifo "${INSTALL_ROOT}/$FILE" &&
+      chmod $PERMISSION "${INSTALL_ROOT}/$FILE" &&
+      chown $OWNER:$GROUP "${INSTALL_ROOT}/$FILE"
+      ;;
+  esac
+}
+
+function stage_install_char_block()
+{
+  local FILE=$1
+  local PERMISSION=$(stat -c %a "${STAGE_DIRECTORY}/TRANSL/$FILE")
+  local MAJOR=$(stat -c %t "${STAGE_DIRECTORY}/TRANSL/$FILE")
+  local MINOR=$(stat -c %T "${STAGE_DIRECTORY}/TRANSL/$FILE")
+  local OWNER=$(stat -c %U "${STAGE_DIRECTORY}/TRANSL/$FILE")
+  local GROUP=$(stat -c %G "${STAGE_DIRECTORY}/TRANSL/$FILE")
+  local SAVE=$CONFIG_STAGE_DIRECTORY/$FILE.$(date +%Y%m%d%H%M%S)
+  local TYPE=$3
+  message "${FILE_COLOR}${PERMISSION} $OWNER:$GROUP $TYPE $MAJOR $MINOR $FILE${DEFAULT_COLOR}"
+  case $2 in
+    config)
+      if [[ -e "${INSTALL_ROOT}/$FILE" ]]
+      then
+        touch "${INSTALL_ROOT}/$FILE" &&
+        mkdir -p $(dirname $SAVE) &&
+        mknod -m "${PERMISSION}" "${INSTALL_ROOT}/$SAVE" "${TYPE}" "${MAJOR}" "${MINOR}" &&
+        chown $OWNER:$GROUP "${INSTALL_ROOT}/$SAVE"
+      else
+        mknod -m "${PERMISSION}" "${INSTALL_ROOT}/$FILE" "${TYPE}" "${MAJOR}" "${MINOR}" &&
+        chown $OWNER:$GROUP "${INSTALL_ROOT}/$FILE"
+      fi
+      ;;
+    *)
+      mknod -m "${PERMISSION}" "${INSTALL_ROOT}/$FILE" "${TYPE}" "${MAJOR}" "${MINOR}" &&
+      chown $OWNER:$GROUP "${INSTALL_ROOT}/$FILE"
+      ;;
+  esac
+}
+
 function set_stage_root_paths()
 {
   local bindir libdir
@@ -140,7 +208,7 @@ function set_stage_root_paths()
   done
   for libdir in /lib /usr/lib
   do
-    export LD_LIBRARY_PATH=$( envar_prepend_path $STAGE_DIRECTORY/$libdir $LD_LIBRARY_PATH )
+    export LD_LIBRARY_PATH=$( envar_prepend_path $STAGE_DIRECTORY/TRANSL/$libdir $LD_LIBRARY_PATH )
   done
 }
 
@@ -154,6 +222,15 @@ function stage_install_list()
   if [[ -h $STAGE_DIRECTORY/TRANSL/$1 ]]
   then
     stage_install_symlink "$@"
+  elif [[ -b $STAGE_DIRECTORY/TRANSL/$1 ]]
+  then
+    stage_install_char_block "$@" b
+  elif [[ -c $STAGE_DIRECTORY/TRANSL/$1 ]]
+  then
+    stage_install_char_block "$@" c
+  elif [[ -p $STAGE_DIRECTORY/TRANSL/$1 ]]
+  then
+    stage_install_fifo "$@" 
   elif [[ ! -d $STAGE_DIRECTORY/TRANSL/$1 ]]
   then
     stage_install_file "$@"
diff --git a/var/lib/sorcery/modules/libstate b/var/lib/sorcery/modules/libstate
index 22fd760..0fb6af7 100755
--- a/var/lib/sorcery/modules/libstate
+++ b/var/lib/sorcery/modules/libstate
@@ -148,14 +148,12 @@ ## @param dependency spell
 ## @Stdout list of options
 ##
 ## Returns a list of options for ./configure from $1
-## If the second argument is given, returns options for the
-## matching pair of spell:dependency
 ## Primarily aimed at generating $OPTS contents
 ##
 ## Prints out one line of output
 #---------------------------------------------------------------------
 function get_depends_options()
-{ # $1=depends_status $2=spell [$3]=dependency spell
+{ # $1=depends_status $2=spell
 
   local depends_status=$1
   shift
@@ -165,10 +163,9 @@ function get_depends_options()
     return
   }
 
-  local START="$(esc_str $1):"
-  [ -n "$2" ] && START="${START}$(esc_str $2):"
+  local START="$(esc_str $1)"
   debug "libstate" "get_depends_options() - START=$START"
-  awk -F ':' "/^$START/ { if (\$3 == \"on\") OPTS = OPTS \" \" \$5; else OPTS = OPTS \" \" \$6; } END { print OPTS; }" $depends_status
+  awk -F ':' -v start=$START "{ if (\$1 == start) if (\$3 == \"on\") OPTS = OPTS \" \" \$5; else OPTS = OPTS \" \" \$6; } END { print OPTS; }" $depends_status 2> /dev/null
 }
 
 
diff --git a/var/lib/sorcery/modules/libsummon b/var/lib/sorcery/modules/libsummon
index c152800..97c36b2 100755
--- a/var/lib/sorcery/modules/libsummon
+++ b/var/lib/sorcery/modules/libsummon
@@ -40,14 +40,7 @@ function summon_spell() {
     # and instead jump through hoops to get the return code correctly
     ( local rc=1
       run_details    &&
-      persistent_load &&
-      if test -x $SCRIPT_DIRECTORY/DOWNLOAD ; then
-        . $SCRIPT_DIRECTORY/DOWNLOAD
-      else
-        default_download
-      fi &&
-      persistent_save
-      # save the rc, then unlock
+      run_spell_file DOWNLOAD download
       rc=$?
 
       if [[ $rc == 0 ]]; then
@@ -89,7 +82,7 @@ ## 
 ## Call acquire_src for each SOURCEx_URL
 ##
 #-------------------------------------------------------------------------
-function real_default_download() {
+function real_default_sorcery_download() {
   $STD_DEBUG
   local SOURCE_NUMBER
   for SOURCE_NUMBER in $(real_get_source_nums X); do
diff --git a/var/lib/sorcery/modules/libtablet b/var/lib/sorcery/modules/libtablet
index 7f5236e..1caa2b5 100755
--- a/var/lib/sorcery/modules/libtablet
+++ b/var/lib/sorcery/modules/libtablet
@@ -51,7 +51,7 @@ ##   "tablet chapter" A spell's director
 ##      $TABLET_PATH/$SPELL/...
 ##   "tablet page" A specific instance of a spell in a chapter eg:
 ##      $TABLET_PATH/$SPELL/<timestamp>/...
-##	this is sometimes called a tablet dir, but I'm trying to phase that out
+##   this is sometimes called a tablet dir, but I'm trying to phase that out
 ##
 ## Accessors Routines (thus far):
 ##        tablet_get_spell_file
diff --git a/var/lib/sorcery/modules/libtrack b/var/lib/sorcery/modules/libtrack
index c42ccf3..8cb33d0 100755
--- a/var/lib/sorcery/modules/libtrack
+++ b/var/lib/sorcery/modules/libtrack
@@ -97,7 +97,7 @@ function real_invoke_installwatch()  {
     export  INSTW_ROOTPATH=$STAGE_DIRECTORY
     export  INSTW_TRANSL=0
     export  INSTW_BACKUP=0
-    export  INSTW_DBGLVL=4
+    export  INSTW_DBGLVL=${INSTALLWATCH_DEBUG_LEVEL}
     export  INSTW_EXCLUDE="$INSTALLWATCH_UNSTAGED_PATHS"
     export  LD_PRELOAD=/usr/lib/installwatch.so
   fi
@@ -142,7 +142,7 @@ function parse_iw()  {
   # it is EXTREMELY IMPORTANT that this variable contains an actual
   # tab character and not some number of spaces. Otherwise BAD THINGS
   # will happen.
-  local TAB="	"
+  local TAB=$'\t'
   OMIT_IN="${TAB}rename\|${TAB}symlink\|${TAB}unlink"
 
   grep -v "$OMIT_IN" $INPUT | cut -f3 | grep "^/" | sed 's#^//#/#g'
diff --git a/var/lib/sorcery/modules/libtriggers b/var/lib/sorcery/modules/libtriggers
index 1029e23..50a3c73 100755
--- a/var/lib/sorcery/modules/libtriggers
+++ b/var/lib/sorcery/modules/libtriggers
@@ -18,11 +18,7 @@ #---------------------------------------
 function run_triggers() {
   debug "libtriggers" "Starting run_triggers() on $SPELL"
 
-  if [ -x $SCRIPT_DIRECTORY/TRIGGERS ]; then
-    persistent_load
-    . $SCRIPT_DIRECTORY/TRIGGERS
-    persistent_save
-  fi
+  run_spell_file TRIGGERS triggers
 
 }
 
diff --git a/var/lib/sorcery/modules/libunpack b/var/lib/sorcery/modules/libunpack
index 8225df5..4202ee7 100755
--- a/var/lib/sorcery/modules/libunpack
+++ b/var/lib/sorcery/modules/libunpack
@@ -226,7 +226,7 @@ function unpack_core() {
   case  "$2"  in
             bzip2|gzip|compress*|tar)
                     tar   --no-same-owner --no-same-permissions -xf \
-		          /dev/stdin 2> /dev/null  ||  cat > /dev/null ;;
+                    /dev/stdin 2> /dev/null  ||  cat > /dev/null ;;
               Zip)  cat /dev/stdin >/dev/null   #get rid of unused output
                     unzip  -q  "$1"                                    ;;
               RPM)  cpio  -idm < /dev/stdin                            ;;
diff --git a/var/lib/sorcery/modules/liburl b/var/lib/sorcery/modules/liburl
index 36c4979..bda5293 100755
--- a/var/lib/sorcery/modules/liburl
+++ b/var/lib/sorcery/modules/liburl
@@ -141,15 +141,15 @@ function url_download_expand_sort() {
 }
 
 #---------------------------------------------------------------------
-## @param target	Expected target file or tree, this is only a
+## @param target        Expected target file or tree, this is only a
 ##                      suggestion, and the download handler may ignore it.
-## @param url_list	List of urls to get the target from
-## @param hints		Hints, these help the function determine what
-##			type of thing it is downloading or other tunables.
-## @param udl_target	Name of variable in which to store the name of the
-##			result directory or file
-## @param udl_type	Name of the variable in which to store the type of
-##			thing downloaded
+## @param url_list      List of urls to get the target from
+## @param hints         Hints, these help the function determine what
+##                      type of thing it is downloading or other tunables.
+## @param udl_target    Name of variable in which to store the name of the
+##                      result directory or file
+## @param udl_type      Name of the variable in which to store the type of
+##                      thing downloaded
 ##
 ## @return 0 if file could be downloaded
 ## @return 1 otherwise



More information about the SM-Commit mailing list