Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to test-1.13 sorcery by Jaka Kranjc (7c8d984b745792719e7c03bc9335f30a4fd8e682)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Jaka Kranjc <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to test-1.13 sorcery by Jaka Kranjc (7c8d984b745792719e7c03bc9335f30a4fd8e682)
  • Date: Mon, 24 Mar 2008 11:07:14 -0500

GIT changes to test-1.13 sorcery by Jaka Kranjc <lynxlynxlynx AT sourcemage.org>:

ChangeLog | 1586
++++++++++-----------
etc/sorcery/config | 26
etc/sorcery/mirrors/KERNEL | 515 +-----
etc/sorcery/mirrors/PERL_CPAN | 151 +
etc/sorcery/state | 2
etc/sorcery/version | 2
old-changelogs/ChangeLog-1.13 | 733 +++++++++
usr/sbin/alter | 80 -
usr/sbin/cabal | 18
usr/sbin/cast | 270 ++-
usr/sbin/cleanse | 244 +--
usr/sbin/confmeld | 335 ++++
usr/sbin/delve | 159 +-
usr/sbin/dispel | 205 +-
usr/sbin/gaze | 811 +++++++---
usr/sbin/invoke | 58
usr/sbin/scribbler | 12
usr/sbin/scribe | 108 -
usr/sbin/sorcery | 141 +
usr/sbin/summon | 40
usr/share/man/man1/gaze.1 | 16
usr/share/man/man5/grimoire.5 | 34
usr/share/man/man8/alter.8 | 2
usr/share/man/man8/cast.8 | 27
usr/share/man/man8/cleanse.8 | 17
usr/share/man/man8/confmeld.8 | 76 +
usr/share/man/man8/dispel.8 | 19
usr/share/man/man8/scribe.8 | 3
usr/share/man/man8/sorcery.8 | 2
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/build/run_compiler | 5
var/lib/sorcery/modules/build_api/api1 | 57
var/lib/sorcery/modules/build_api/api2 | 196 +-
var/lib/sorcery/modules/build_api/common | 156 +-
var/lib/sorcery/modules/dl_handlers/dl_cvs | 8
var/lib/sorcery/modules/dl_handlers/dl_dir | 16
var/lib/sorcery/modules/dl_handlers/dl_file | 6
var/lib/sorcery/modules/dl_handlers/dl_git | 22
var/lib/sorcery/modules/dl_handlers/dl_rsync | 14
var/lib/sorcery/modules/dl_handlers/dl_svn | 22
var/lib/sorcery/modules/dl_handlers/dl_tla | 12
var/lib/sorcery/modules/libapi | 440 +++--
var/lib/sorcery/modules/libcast | 77 -
var/lib/sorcery/modules/libcodex | 304 ++--
var/lib/sorcery/modules/libcrossinstall | 6
var/lib/sorcery/modules/libdepends | 858 ++++++++---
var/lib/sorcery/modules/libdepengine | 2
var/lib/sorcery/modules/libdispel | 57
var/lib/sorcery/modules/libdownload | 13
var/lib/sorcery/modules/libgcc2 | 35
var/lib/sorcery/modules/libgpg | 8
var/lib/sorcery/modules/libgrimoire | 24
var/lib/sorcery/modules/libhash | 72
var/lib/sorcery/modules/libinitd | 6
var/lib/sorcery/modules/liblock | 177 +-
var/lib/sorcery/modules/libmedia | 24
var/lib/sorcery/modules/libmisc | 345 +++-
var/lib/sorcery/modules/libresurrect | 151 +
var/lib/sorcery/modules/libscreen | 14
var/lib/sorcery/modules/libsecurity | 26
var/lib/sorcery/modules/libsorcery | 465 ++++--
var/lib/sorcery/modules/libspell | 208 ++
var/lib/sorcery/modules/libstage | 263 +++
var/lib/sorcery/modules/libstate | 608 +++++---
var/lib/sorcery/modules/libsummon | 105 +
var/lib/sorcery/modules/libtablet | 187 +-
var/lib/sorcery/modules/libtrack | 259 ++-
var/lib/sorcery/modules/libtriggers | 25
var/lib/sorcery/modules/libunpack | 110 -
var/lib/sorcery/modules/liburl | 48
var/lib/sorcery/modules/url_handlers/url_cvs | 24
var/lib/sorcery/modules/url_handlers/url_default | 14
var/lib/sorcery/modules/url_handlers/url_dir | 16
var/lib/sorcery/modules/url_handlers/url_file | 6
var/lib/sorcery/modules/url_handlers/url_git | 17
var/lib/sorcery/modules/url_handlers/url_git_http | 121 +
var/lib/sorcery/modules/url_handlers/url_http | 5
var/lib/sorcery/modules/url_handlers/url_rsync | 4
var/lib/sorcery/modules/url_handlers/url_smgl_tla | 18
var/lib/sorcery/modules/url_handlers/url_svn | 49
var/lib/sorcery/modules/url_handlers/url_svn_http | 131 +
var/lib/sorcery/modules/url_handlers/url_svn_https | 131 +
var/lib/sorcery/modules/url_handlers/url_svn_ssh | 127 +
var/lib/sorcery/protected | 1
124 files changed, 7960 insertions(+), 4147 deletions(-)

New commits:
commit 7c8d984b745792719e7c03bc9335f30a4fd8e682
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

1.14.0 release
brute-sync from devel

diff --git a/ChangeLog b/ChangeLog
index 43b9f52..be8781e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,38 +1,93 @@
2008-03-24 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * cast, cleanse, alter, summon, scribe, scribbler, ...: changed $0 to
+ respective name, so sorcery can be debugged with bashdb properly and
+ added exec to these calls so one process is saved
* cast.8, cast: -B is recursive, so mention it #14371

-2008-03-15 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
- * gaze, gaze.1: added note about gaze depends working only on enabled
deps
+2008-03-19 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * confmeld.8: fixed title, thanks to wich

2008-03-15 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * cast.8: added missing switches except the dead --url, capitalised
* cleanse: added "--tablet coalesce" to the help
+ * gaze, gaze.1: added note about gaze depends working only on enabled
deps
+
+2008-03-14 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * libsecurity: don't use a hardcoded path in gaze_checkmd5s
+ * libresurrect: unset the var, not its contents
+ added a commented out fix to get post-ressurect triggers working
further

2008-03-07 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* scribbler: fixed message when scribbling from a missing grimoire
#14353

2008-03-03 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * cleanse: broken runtime providers don't need to be recast if
switched
don't display cast/dispel commands if none are needed and print a
newline between each menu
+ * libstage: read the link only once when transfering links and quote
them

2008-02-29 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* libmisc: fixed consolidate_params so it can take "-[eEn]" as values
too;
before they were passed to echo and ignored, breaking dispel -e
* gaze: small grammar fix in gaze_show_spells_by_status

+2008-02-25 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * libdispel: remove any config stages upon dispel
+
+2008-02-23 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * libcast: remove the castfs log after it is copied to the system -
the logs
+ are big and can clog up /tmp (especially for tmpfs users).
Previously
+ they were deleted at the final cast TMP_DIR cleanup
+
+2008-02-20 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * common: better handling of empty config stages
+
2008-02-19 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* gaze: don't falsely return 1 in gaze version

2008-02-11 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* url, compile_config: better conditional sourcing #14304

+2008-02-10 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * confmeld: made the date of staging human readable
+
2008-02-06 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* libunpack: improved the error message in unpack_hash with info
which hash
is which

+2008-02-05 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * cast: made the confmeld message more explicit
+ * libstage: added a staged config removal routine, mostly for
leftover dirs
+ then made it accept another argument for convenience
+ * confmeld, common: made use of that routine
+ * confmeld: simplified removal code, now things get deleted right
after use
+ fixed passing of more than one argument
+ * libstage, confmeld, common: added locking calls
+
2008-02-04 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * confmeld: added options to just list all spells, configs or both
+ don't output anything when listing and there is nothing to show;
+ support passing spells or configs as arguments and only working on
them
+ * delve, libtablet: added 3 missing ;; - patch from Arvid Norlander
* *: comment fixes for bashdoc - modified patch from Arvid Norlander
+ * config, libressurect: added a variable to hold the default answer
for
+ the config merge query
+ * confmeld: added support for forcing merges, last part of #13618
+ add --help to --help
+ * confmeld.8: mention all the cool new features
+
+2008-02-03 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * libunpack: return 1 when no algorithm is allowed
+ * cast: call clean_resources in cast_cleanup
+ * libstage: really check if it is a file in stage_install_list, so
the else
+ error catch makes sense
+ * common: stage configs only if they are not identical to any
previously
+ staged config. Now confmeld will offer only the first of the set and
+ repeated castings won't clutter $CONFIG_STAGE_DIRECTORY

2008-02-02 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * libgpg, libunpack: added multisign support #13815
+ * gaze, libstate, libgrimoire: discard awk warnings
* gaze: import and export need root privileges #13789

2008-02-01 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
@@ -46,26 +101,92 @@
* scribe: output errors to stderr #13738 , fixed punctuation

2008-01-30 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * common, libtrack: preserve the old behaviour and include all logs
in the
+ md5 log (flak from #13835)
+ * confmeld: improved the output (more spacing and better messages)
+ * liburl: pass along all the arguments in url_verify
* url_http: pass along all the arguments in url_https_verify
* dl_wget: pass hints to dl_wget_set_options and use them
* url_http, dl_wget: support the no-check-certificate source hint
#14106

-2008-01-30 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
- * liburl: pass along all the arguments in url_verify
-
2008-01-29 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* local/README: fixed typo
+ * confmeld, libressurect: improved the merge message for better
readability
+ * libstage: don't stage excluded files in /etc as configs
+ * common, libtrack: save the md5sums of the files in the stage and
not the target
+ ones on the system, otherwise config merging breaks #13835
+
+2008-01-28 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * cast: suggest the user to run confmeld if there are any deferred
files.
+ fixes the second third of #13618
+ * confmeld: remove all empty dirs in the config staging area (cast is
+ leaving them behind)
+ * common: don't save empty staged config chapters
+ * libressurect: internal_install_config_file expects a md5 log in
root form
+ fixed staged install check in internal_install_config_file !="off"
also
+ matches the empty string, which currently happens when ressurecting
+
+2008-01-27 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * libstate: fixed query_spell_status to be regression free
+ (was breaking on "spells" with slashes in their names - in gaze)

2008-01-24 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* cast: fixed typo in pre-review-queue message #14228

2008-01-23 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
- * libtrigger: fixed bug #13466 - dispel_self was dispelling the
triggerer
- * libgrimoire: use the -p option to mkdir in real_mk_source_dir #14193
+ * libtrigger: fix fallback parameter in trigger(), which was luckily
not used
+ removed a redundant check in remove_triggers if the transaction
*file*
+ was a file; if it wasn't, the code would lock the trigger list
forever
+ fixed bug #13466 - dispel_self was dispelling the triggerer
+ * dispel.8: added --total-dispel and fixed some grammar
+ * libgrimoire: fixed private_installed_version to match regex chars
too
+ use the -p option to mkdir in real_mk_source_dir #14193
+ * dispel: fixed bug #13904 - downgrading was incomplete, use ressurect
+ * libresurrect: also restore the sub_depends info, mentioned in #13904
+
+2008-01-22 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * libstate: moved the subshell from the callers into
query_spell_status and
+ sped it up for a tiny bit due to expensive locking
+ locking in search_depends_status is too expensive
+ simplified the parameter check in add_depends and moved it before
the
+ possible removal of dependency info; disabled locking
+
+2008-01-21 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * liblock: don't overwrite the lock list in lock_start_transaction
#13345
+ don't quit when removing the old lock list
+ fixed typos in error messages
+ * libdepends: fixed a regression introduced in 2008-01-16

2008-01-18 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * liblock: lock_start_transaction now supports returning by reference
+ readded a local variable to store the transaction file name
+ * *: use lock_start_transaction by reference
* config: fixed bad SCREEN variable due to a missing $

+2008-01-16 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * libdepends: added more locking calls #7917
+ * libgrimoire: 100% speedup of private_installed_version;
unfortunately
+ speeding the lookup is not enough to counteract the needed locking
calls,
+ the function would get too slow
+ * liblock: lock_resources can only work on one resource at a time, so
+ simplify its callers for clarity and a small speedup
+ check if the lockdir and lockfile exist before trying to create them
+ * config: changed MAX_SLEEP to 2s
+
+2008-01-15 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * libstate: added use of locks (when reading files) and transactions
(when
+ modifying them) to the remaining functions. Part of #7917 that
+ hopefully fixes the annoying #13345
+ * build_api/common: accompanying changes to avoid double locking
+ * libressurect: accompanying changes to avoid double locking
+ * libsorcery: added a missin $ in pop_queue and locking to push_queue
+ and install_queue_history
+ * libdispel: added a transaction to reap_depends
+ * lib*: removed trailing whitespace
+
+2007-12-31 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * liblock: avoid two possible tiny race conditions
+
2007-11-30 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* libdepends: finally satisfactorily fixed the sorcery rebuild
pausing for
hours #13735
@@ -77,17 +198,36 @@
* scribe: fixed error message when swapping nonexsistant grimoires
#13253
* gaze: fixed matching of spell and short during gaze search #9433

+2007-11-21 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * libsummon: fail on any text/ mimetype when checking the tarball
source
+ sanity
+
2007-11-14 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* excluded: removed /var/yp - the one spell that uses it, installs
config
files there #11831
+ * libdepends: removed extra space from the subdepends message #13992
+ * libstate: fixed strictness of subdependency matching on removal
#13993
+ removed a stray '' with no effect
+ * libtrack: disable staging when /dev/null is not a device #13315
+ * api2: improved the message when castfs fails the sanity check
+ * libstate, libtrack, url_http, url_git, url_git_http: fixed comments
+ * confmeld: added parameter parsing and enabled the display of help
+ * confmeld.8, *.8: added basic manual page (part of #13618) and
references

2007-10-30 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* libdepends: fixed some more quoting regressions since stable. Should
eliminate some bad provider query defaults

+2007-09-11 Arwed v. Merkatz <v.merkatz AT gmx.net>
+ * libmisc: support rxvt-unicode for terminal title setting
+
2007-08-28 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * scribe: fixed a bad message when updating local grimoires
+ * libsummon: fixed the source_sanity function header
+ * gaze, gaze.1: added missing spell files to parse() and the manpage
* libsorcery: fixed CXXFLAGS setting in optimise() to not also
include the
other CFLAGS_* variables #13965
+ * gaze: also numb sub_depends when searching for dependencies

2007-08-12 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* gaze: fixed bad temporary dir usage #13588
@@ -99,34 +239,251 @@
fixed scribe add rm -rfing if the passed (bad) argument is a dir
#13742

2007-08-11 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * libdepends: fixed a regression in private_add_depends;
+ probably fixes #13735
* libcodex: moved the load_libcompat call before the sourcing of
DETAILS in
codex_set_current_spell. This way fallbacks can be used there as
well,
which will among other things help a bit with #13883
- * libdepends: fixed a regression in private_add_depends;
- probably fixes #13735
- * gaze: fixed gaze newer breaking on bad input #10149
- also made it handle (too) many logs, patch from Arwed von Merkatz
#13903
* cleanse: fix md5sum check locale issue, patch from Thomas Orgis
#13713
+ also made it handle (too) many logs, patch from Arwed von Merkatz
#13903
+ added --logs to the man page
+ * gaze: fixed gaze newer breaking on bad input #10149
* libmisc: fix set_architecture not resetting the text color #13842
* libressurect: show unified diffs in real_handle_changed_config
#13830

2007-08-10 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* etc/sorcery/url: added default value for PERL_CPAN_URL #13673
+ * gaze: fixed PERL_CPAN_URL in mirrors list in gaze system-info #13553
+ Slightly modified patches from Andraž Levstik
+ * libcodex, libsorcery: fixed cast -Z queuing up-to-date spells #13503
+ * libmisc: updated select_list documentation and renamed one
variable,
+ so there is even less chance of a conflict

2007-08-09 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* url_handlers/url_http: fix url_ftp_verify to not pass a deprecated
wget
option. Now it works again. #13001
Also made it stricter when checking for target exsistance #13787

+2007-05-14 David Brown <dmlb2000 AT gmail.com>
+ * sorcery: added a castfs debug level option to sorcery debug dialog
+ and fixed the text and tabs
+ * config: made the CASTFS_DEBUG_LEVEL variable able to be set from
+ local config
+
2007-04-18 David Kowis <dkowis AT shlrm.org>
* gaze: Bug 13711, support force_depends in gaze dependencies.
- Patch from Jaka Kranjc
+ Patch from Jaka Kranjc.
+
+2007-03-31 David Brown <dmlb2000 AT gmail.com>
+ * libcast: use STAGED_INSTALL to create castfs debug log instead of a
+ file check
+
+2007-03-02 David Brown <dmlb2000 AT gmail.com>
+ * build_api/api2: check to make sure castfs is there before running
+ sanity
+
+2007-02-28 David Brown <dmlb2000 AT gmail.com>
+ * dl_handler/dl_git: fixed to use $target and move to the appropriate
+ $target location
+ * libtrack: removed place where castfs sanity check was happening for
a
+ higher level location
+ * build_api/api2: put the castfs sanity check at a higher level, fixes
+ (bug #13480)
+
+2007-02-27 David Brown <dmlb2000 AT gmail.com>
+ * libtrack: added sanity check function after castfs starts (bug
13480)
+
+2007-02-27 David Brown <dmlb2000 AT gmail.com>
+ * run_compiler: added a little self check so if DISTCC_DIR isn't set
+ it will succeed by checking / and not try to mkdir ''
+
+2007-02-26 Andraž "ruskie" Levstik <ruskie AT mages.ath.cx>
+ * gaze: added PERL_URL from mirrors list to print in system-info
+
+2007-02-26 Andrew Stitt <astitt AT sourcemage.org>
+ * config: turn VIEW_REPORTS off by default, bug 13445
+
+2007-02-24 David Brown <dmlb2000 AT gmail.com>
+ * cast: added and export DISTCC_DIR before run_build_spell
+ * compile_config: removed DISTCC_DIR
+ * run_compiler: check to make sure DISTCC_DIR exists then make it if
not
+
+2007-02-19 Andrew Stitt <astitt AT sourcemage.org>
+ * libmisc: select_list update documentation and mangle variable
+ names, bug 13458
+
+2007-02-19 Andrew Stitt <astitt AT sourcemage.org>
+ * libsummon, summon: fix bug 13412, summon --raw should work
+ with other summon facilities (force-download, source cache check).
+ Patch from Jaka Kranjc, modified for style/compatibility.
+
+2007-02-19 Andrew Stitt <astitt AT sourcemage.org>
+ * libmisc: fix bug 13356, improve performance of
+ list_find. Slightly modified patch from Jaka Kranjc.
+
+2007-01-20 Paul Mahon <pmahon AT sourcemage.org>
+ *libmisc: redirect some errors to stderr for bug 13380
+
+2007-01-01 David Brown <dmlb2000 AT gmail.com>
+ * delve: empty install root since that's handled by transfer stage
+ * libstage: forgot a prepended INSTALL_ROOT on directory
+ * config: added INSTALL_ROOT'ed local config area to ignore list
+
+2006-12-23 David Brown <dmlb2000 AT gmail.com>
+ * libtrack: track_manual needs to work when staged install is enabled
+ * build_api/api2: STAGED_INSTALL variable should be exported so delve
+ will have that variable set properly during INSTALL
+
+2006-12-21 David Brown <dmlb2000 AT gmail.com>
+ * libsorcery: filter/filter_in removed debugging and tabs from
+ previous commit (stupid me)
+
+2006-12-17 David Brown <dmlb2000 AT gmail.com>
+ * libsorcery: filter/filter_in removed /dev/null entry from both
functions
+
+2006-12-03 Andrew Stitt <astitt AT sourcemage.org>
+ * build_api/common: gather_docs delineates between files and
+ directories. Now *rc matches config files, but not directories
+ (ie src). Bug 13283.
+
+2006-12-02 Andrew Stitt <astitt AT sourcemage.org>
+ * libsorcery: fix filter() to use a temp file
+ * libsorcery: ldconfig is pointless when staging
+
+2006-11-30 David Brown <dmlb2000 AT gmail.com>
+ * libtrack: forgot to run stage root files list through exclude filter
+ * libtrack: is_castfs_installed quieted all the errors and output
+ messages saying if it's enabled or disabled
+ * build_api/api2: need to set STAGED_INSTALL if its not already set
+ * delve: set STAGED_INSTALL if its not already set
+
+2006-11-30 Andrew Stitt <astitt AT sourcemage.org>
+ * cleanse: fix typo, missing ;;
+
+2006-11-29 David Brown <dmlb2000 AT gmail.com>
+ * etc/sorcery/compile_config: set DISTCC_DIR env-var
+ * etc/sorcery/config: remove installwatch stuff added castfs stuff
+ * confmeld: fixed parsing of the path to generate the correct data
+ * delve: added transfer and install extras as stages also added
+ chroot checks since delve calls itself during the install stage.
+ stage install is now called transfer so lots of one liners for that
+ also swapped out installwatch checks for castfs checks
+ * var/lib/sorcery/build/run_compiler: added export of distcc dir
+ * build_api/api2: swapped out installwatch stuff for castfs stuff,
+ stuff includes checks and logfile variables. Also added the install
+ extras and transfer stages to the build process, this includes the
+ default sorcery functions and making the run functions
+ * build_api/common: added an old.libraries hack for when we remove
+ important libraries we save them first then library and run paths
+ to find them again. This is here for similar reasons as the old
+ binaries hack above it.
+ * libapi: added the new stages for install extras and transfer. Also
+ modified the comment so it reflects the changes made.
+ * libcast: swapped out installwatch log for castfs log creation
+ * libgrimoire: added some recursive umount checks for deaddir in
+ rm_source_dir so we don't remove system stuff if there's a bind
+ * libsorcery: added !filter syntax for spell filters. The !filter
+ takes presidence over the filter.
+ * libspell: added install extras and transfer magic to make sure
+ sorcery calls the new spell files if they exist
+ * libstage: swap out installwatch for castfs, this includes changing
+ out invoke devoke and prepare stage root and installwatch functions.
+ Also the installwatch check is now castfs check. The install log is
+ now created from a find of the stage root location instead of
parsing
+ installwatch logs.

2006-11-25 Andrew Stitt <astitt AT sourcemage.org>
- * cabal: apply patch from Dave Josephsen, bug 11708
+ * scribe: check for tar failure from unpacking, fixes bug 12387
+
+2006-11-25 Andrew Stitt <astitt AT sourcemage.org>
+ * libdepends: fix bug 11865, ignore stored sub-depends if the
+ requesting spell has already been processed.
+
+2006-11-25 Andrew Stitt <astitt AT sourcemage.org>
+ * cleanse: add runtime/suggest support to prune, bug 13250
+
+2006-11-25 Andrew Stitt <astitt AT sourcemage.org>
+ * cleanse: add runtime/suggest support to delint, bug 13246

-2006-08-18 Andrew Stitt <astitt AT sourcemage.org>
- * libstate, libapi: add is_depends_enabled, bug 12949
+2006-11-25 Andrew Stitt <astitt AT sourcemage.org>
+ * libinitd: fix bug 12958, improper use of INSTALL_ROOT.
+
+2006-11-25 Andrew Stitt <astitt AT sourcemage.org>
+ * libsummon: fix bug with file verification by using file -bi
+ to get cleaner mime-like file-type descriptions. Bug 13254,
+ patch from Jaka Kranjc.
+
+2006-11-25 Andrew Stitt <astitt AT sourcemage.org>
+ * cabal: apply patch from Dave Josephsen, bug 11708
+
+2006-11-25 Andrew Stitt <astitt AT sourcemage.org>
+ * libmisc: lock the persistent file on load and save it with
+ a transaction to prevent corruption from ctrl-c. Bug 13228
+
+2006-11-17 Andrew Stitt <astitt AT sourcemage.org>
+ * libtrack, libapi: add a routine to record modified config files,
+ this is an alternative to running install_config_files
+
+2006-11-14 Andrew Stitt <astitt AT sourcemage.org>
+ * protected: protect /etc/sysconfig/facilities to smooth over
+ the bumps from bug 13123.
+
+2006-11-14 Andrew Stitt <astitt AT sourcemage.org>
+ * libtrack: add initialization function so modified files list
+ is always known rather than being created on-demand.
+ * cast: initialize libtrack. This fixes bug 13123.
+
+2006-11-02 Andrew Stitt <astitt AT sourcemage.org>
+ * libsummon: fix bug 13173, add check for empty files in summon
+ sanity checker
+
+2006-11-02 Andrew Stitt <astitt AT sourcemage.org>
+ * etc/sorcery/config: single quote DOCS to prevent premature
+ glob expansion
+ * build_api/common: fix bug 12869, exclude executables from
+ gathered docs. Also did some much needed code cleanup.
+
+2006-10-31 Andrew Stitt <astitt AT sourcemage.org>
+ * etc/sorcery/config: remove sorcery path for archspecs
+
+2006-09-29 Andrew Stitt <astitt AT sourcemage.org>
+ * libdepends: properly rename default_sorcery_trigger_check
+ to real_default_sorcery_trigger_check
+
+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)
@@ -137,19 +494,198 @@
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: integrate fix for bug 12233, spells with regexps
- in names do not always become the default provider
+ * 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-06-23 Andrew Stitt <astitt AT sourcemage.org>
- * libtrack: add code so sorcery works with installwatch 7
+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
+ fast_up_depends as it is more correct.
+ * gaze: fix bug 10297, and remove fast_up_depends since it is
+ now the main implementation.
+ * libapi: expose show_up_depends as the spell api for gaze depends
+ functionality.
+
+2006-06-03 Andrew Stitt <astitt AT sourcemage.org>
+ * libdepends: fix bug 12603, optional depends on a provider does not
+ properly remember defaults of none.

-2006-06-08 Andrew Stitt <astitt AT sourcemage.org>
- * libtrack: suppress mkdir errors
+2006-05-28 Andrew Stitt <astitt AT sourcemage.org>
+ * 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
@@ -158,26 +694,92 @@
2006-05-28 Andrew Stitt <astitt AT sourcemage.org>
* libcast: fix bug 11902, conflicts are broken for multi-spell
conflicts

+2006-05-28 Andrew Stitt <astitt AT sourcemage.org>
+ * cast, sorcery, man8/cast.8, libcast, libsorcery: add cppflags
option,
+ bug 12327, patch from Thomas Orgis.
+
+2006-05-28 Andrew Stitt <astitt AT sourcemage.org>
+ * libdepends: workaround bug in bash 3.0-16, syntax for
+ intialization of local arrays is broken.
+
+2006-05-28 Andrew Stitt <astitt AT sourcemage.org>
+ * gaze: add system-info command, bug 11864, patch supplied
+ by Andraž Levstik. Additionally modified to print basesystem
+ depends and changed SMGL_COMPAT_ARCHS printing to be more robust.
+
+2006-05-28 Andrew Stitt <astitt AT sourcemage.org>
+ * gaze: fix bug 10459, enhance gaze maintainer, apply patch from
+ Jaka Kranjc
+
2006-05-23 Andrew Stitt <astitt AT sourcemage.org>
* build: update to work with git

-2006-03-26 Andrew Stitt <astitt AT sourcemage.org>
- * libsorcery: default to no fuzzy extension matching, bug 10761
+2006-05-12 Andrew Stitt <astitt AT sourcemage.org>
+ * libunpack: change parameters passed to tar, bug 11413

2006-05-12 Andrew Stitt <astitt AT sourcemage.org>
- * libunpack: change parameters passed to tar, bug 11413, pull
- * libunpack: pull change from David Brown: added
- --no-same-permissions to tar to fix permissions problems when
- untaring files with og+w
+ * sorcery: remove extra comma, bug 11767
+
+2006-05-11 Andrew Stitt <astitt AT sourcemage.org>
+ * libdepends: fix typo
+
+2006-05-09 Andrew Stitt <astitt AT sourcemage.org>
+ * cast: add -g parameter to allow custom grimoire selection and
ordering
+ * cast: remove --fix and --nofix (been deprecated for several
releases)
+
+2006-05-09 Andrew Stitt <astitt AT sourcemage.org>
+ * libapi: add runtime and suggest_depends, bugs 10110 and 10790.
+ Remove altruistic_sub_depends stub.
+ * dispel: add improved messages to handle new dependency states
+ * libdepends: Add new frontend routines for runtime/suggest
+ dependencies. Factor most common message calls into a
+ subroutine. Add controls for compute_install_depends functions
+ to work on either true dependencies as well as the full set.
+ Generalized the way UP_DEPENDS works because runtime/suggest depends
+ need it as well.
+ * libstate: Add new dependency states to sanity check
+ * cast: update to use generalized bonus spell mechanism
+ * gaze: add function stubs for runtime/suggest dependencies
+
+2006-05-03 Andrew Stitt <astitt AT sourcemage.org>
+ * gaze: fix bug 10465, gaze allows grimoire selection
+ * libresurrect: fix bug 10528, install_config_files marks files
+ as new or old, patch from Jaka Kranjc.

2006-05-01 Andrew Stitt <astitt AT sourcemage.org>
* libdepends: fix search for default provider

+2006-04-23 Andrew Stitt <astitt AT sourcemage.org>
+ * libsorcery: fix bug 8070, add pager timeout for changelog viewing
+ * config: add a pager timeout, and use less -F instead of -E,
+ see if people like -F better than -E.
+
+2006-04-23 Andrew Stitt <astitt AT sourcemage.org>
+ * libsummon: fix bug 9415, do some sanity checking in summon
+
+2006-04-23 Andrew Stitt <astitt AT sourcemage.org>
+ * dl_handlers/dl_svn: Do no interactive prompting
+
2006-04-21 Andrew Stitt <astitt AT sourcemage.org>
* libsummon: fix bug 11372, bad spells can make us unlock the wrong
resource, causing subsequent summons to hang. Also fix return code
propagation.

+2006-04-14 Andrew Stitt <astitt AT sourcemage.org>
+ * libmisc: add forkless basename and dirname functions using
+ bash variable expansions.
+ * libhash: add lookup routine that returns by reference
+ * libcodex: add routines to setup in-memory cache lookup hash, and
+ factor out code to setup spell paths from spell loading functions
+ * libtablet: fix bug 9386, optimize tablet_import_repair_files,
+ also tie up loose ends with cleanse related functions
+ * cleanse: update parameters to tablet_cleanse_chapter
+
+2006-04-13 Andrew Stitt <astitt AT sourcemage.org>
+ * libsorcery: consolidate history functions, bug 10282
+ modified patch from Jaka Kranjc. Also added a long overdue full
+ explaination changelog parsing awk script.
+
2006-04-12 Andrew Stitt <astitt AT sourcemage.org>
* gaze: fix bug 10144, fix viewing of install queue, patch from
Jaka Kranjc
@@ -196,23 +798,51 @@
* libtablet: allow special keyword 'all' to unconditionally
update a file in the tablet, bug 10869

-2006-04-04 Andrew Stitt <astitt AT sourcemage.org>
- * build: exclude .bzr metadata
+2006-04-05 Andrew Stitt <astitt AT sourcemage.org>
+ * gaze: backquoted $level in gaze usage message
+ * gaze: added support for viewing {,PRE_}SUB_DEPENDS file
+ (from Jaka Kranjc)

2006-04-04 Andrew Stitt <astitt AT sourcemage.org>
- * libunpack: move verification code out of unpack_file and into
- new verify_file function. Removed un-used inner loop.
- * libapi: add entry point for verify_file. Fixes bug 10684.
+ * libmisc: fix select_list default value selection, bug 10538
+ * cleanse, libcast, libgpg: update to slightly modified select_list
api

2006-04-04 Andrew Stitt <astitt AT sourcemage.org>
* libmisc: fix bug 10357, add extra check for a file incase theres
a directory named make.

+2006-04-03 Andrew Stitt <astitt AT sourcemage.org>
+ * libmisc: fix bug 10588, fix provider selection on timeout
+ * url_handlers/url_svn_https: add https handler for svn, bug 10370
+
+2006-04-02 Andrew Stitt <astitt AT sourcemage.org>
+ * build: fill in the version value on devel sorcery
+
+2006-04-02 Andrew Stitt <astitt AT sourcemage.org>
+ * dl_handlers/dl_svn: fix bug 10183, allow for username/password to be
+ passed on the command line
+
+2006-04-02 Andrew Stitt <astitt AT sourcemage.org>
+ * build: exclude .bzr metadata
+
+2006-03-26 Andrew Stitt <astitt AT sourcemage.org>
+ * libsorcery: default to no fuzzy extension matching, bug 10761
+
+2006-03-25 David Brown <dmlb2000 AT gmail.com>
+ * config: changed name TRACKED to GAZE_ALIEN_PATHS so it's a little
+ less ambiguous
+ * gaze: only other place the TRACKED var was used...
+
2006-03-25 Andrew Stitt <astitt AT sourcemage.org>
* libunpack: check for spell or actual command before assuming
verification cannot be done.

2006-03-25 Andrew Stitt <astitt AT sourcemage.org>
+ * libunpack: move verification code out of unpack_file and into
+ new verify_file function. Removed un-used inner loop.
+ * libapi: add entry point for verify_file. Fixes bug 10684.
+
+2006-03-25 Andrew Stitt <astitt AT sourcemage.org>
* libsorcery: remove LC_ALL hack
* cast: put slightly safer LC_ALL hack in cast around the build
phase. This fixes bug 10546, see also bug 2910.
@@ -233,9 +863,6 @@
Jeremy Blosser.

2006-03-20 Andrew Stitt <astitt AT sourcemage.org>
- * dispel: fix issues with failure codes in dispel+depends
-
-2006-03-20 Andrew Stitt <astitt AT sourcemage.org>
* build_api/common, cast: move pop_install_queue out of cast
and into run_spell_success, bug 10719

@@ -258,6 +885,13 @@
* config/url: add fallback mirror from David Kowis

2006-03-12 Andrew Stitt <astitt AT sourcemage.org>
+ * scribe: add command for keyword index creation
+ * man8/scribe.8: add info about reindex-keyword
+ * libcodex: add function to recreate keyword index, remove dead
+ code for keyword lookups
+ * config: add variable for name of keyword index file
+
+2006-03-12 Andrew Stitt <astitt AT sourcemage.org>
* libapi: add examples on how to use force_depends

2006-03-07 Andrew Stitt <astitt AT sourcemage.org>
@@ -266,6 +900,7 @@
2006-03-06 Andrew Stitt <astitt AT sourcemage.org>
* gaze: renice gaze, bug 10629
* libdepends, libapi: add force_depends, bug 10565
+ * dispel: fix issues with failure codes in dispel+depends
* man8/dispel.8, dispel: fix description of exile parameter

2006-03-01 Andrew Stitt <astitt AT sourcemage.org>
@@ -280,6 +915,11 @@
2006-02-25 Andrew Stitt <astitt AT sourcemage.org>
* libdepengine: ensure triggers force recompile, bug 10406

+2006-02-24 David Brown <dmlb2000 AT gmail.com>
+ * libsummon: fixed repackaging message to show color
+ * libunpack: fixed output of new hash allowed to have a space so it
+ looks nicer
+
2006-02-23 Andrew Stitt <astitt AT sourcemage.org>
* libmisc: fix find version parsing to catch '4.1' as well as 4.1.x.
Fix provided by "sobukus" on irc.
@@ -298,9 +938,25 @@
* libcast: add function for loading libcompat, bug 10423
* libcodex: load libcompat in all normal spell environments

+2006-02-05 Andrew Stitt <astitt AT sourcemage.org>
+ * libdepends: simplify sub-depends pre-processing, require that
+ spells always specify a PRE_SUB_DEPENDS file rather than jumping
+ through hoops to avoid needing one.
+ * libdispel: simplify when sub-depends are cleaned up
+ * cleanse: incorporate sub-depends simplifications
+
+2006-01-26 David Brown <dmlb2000 AT gmail.com>
+ * dl_git: added git download handler
+ * url_git: added git url handler
+ * libsummon: added git to the list of trees (needs to be fixed)
+
2006-01-26 Andrew Stitt <astitt AT sourcemage.org>
* dispel.8: update info for how to unexile something.

+2006-01-22 Andrew Stitt <astitt AT sourcemage.org>
+ * libmisc: fix query_string (and subsequently config_query_string)
+ to not timeout if the user starts typing, bug 7858.
+
2006-01-21 Andrew Stitt <astitt AT sourcemage.org>
* gaze: Fix bug 10358, set the pager to 'cat' when -q is
specified. Patch from Jaka Kranjc.
@@ -312,19 +968,40 @@
Jaka Kranjc.

2006-01-18 Andrew Stitt <astitt AT sourcemage.org>
- * gaze: fix bug 10415, add a trap for pipes so bash complains less
- about them when they break
+ * cleanse: fix bug 10411, cleanse --delint error with sub-depends

2006-01-18 Andrew Stitt <astitt AT sourcemage.org>
- * cast: integ change from devel to fix --deps, need to recompute
closure
+ * gaze: fix bug 10415, add a trap for pipes so bash complains less
+ about them when they break

2006-01-18 Andrew Stitt <astitt AT sourcemage.org>
* libcodex: fix bug 10350

2006-01-11 Andrew Stitt <astitt AT sourcemage.org>
+ * libcast: fix check for whether or not per spell cflags is enabled
+
+2006-01-11 Andrew Stitt <astitt AT sourcemage.org>
* gaze: remove gaze service (bug 10259).
* man1/gaze.1: remove gaze service (bug 10259).

+2006-01-11 Andrew Stitt <astitt AT sourcemage.org>
+ * build_api/api1, build_api/api2: fix bug 8463, build system
selection.
+ All phases in the build pipeline can be declared by specifying
+ <FILENAME>_CMD in DETAILS.
+
+2006-01-11 Andrew Stitt <astitt AT sourcemage.org>
+ * etc/sorcery/config: Add default value for per-spell-cflags (bug
7730).
+ * sorcery: Add per-spell-cflags to feature menu.
+ * libcast: Add function to present user with menu for cflags.
+ * libdepends: Call menu for cflags.
+ * libsorcery: Add user specified flags to $*FLAGS variables.
+
+2006-01-09 Andrew Stitt <astitt AT sourcemage.org>
+ * libapi: Add api for altruistic sub-depends
+ * libdepends: Add code to make altruistic sub-depends work
+ * cleanse, libdispel: Add special case for empty requester due
+ to altruistic sub-depends
+
2006-01-09 Andrew Stitt <astitt AT sourcemage.org>
* dl_handlers/dl_file: use generic url_crack not url_file_crack

@@ -334,8 +1011,22 @@
* gaze: update help info for gaze section, bug 10141.

2006-01-03 Andrew Stitt <astitt AT sourcemage.org>
- * libsorcery: change version stream for cleanup marker since we
- forgot about it in 1.13.
+ * libsorcery: Remove dead code for saving glibc and 'glibc-custom'
+ libraries, bug 10261.
+
+2006-01-03 Andrew Stitt <astitt AT sourcemage.org>
+ * libtrack: improve safe directory infrastructure, reseed $RANDOM
+ with the current nanoseconds to help avoid collisions. $RANDOM
+ and pipes are not interacting very randomly in bash 3.1.
+
+2006-01-03 Andrew Stitt <astitt AT sourcemage.org>
+ * libtablet: add some shortcuts to skip intensive tablet searching
+ when a parent function already knows the information
+ * libsorcery: properly handle missing tablets
+ * build_api/common: setup shortcut variables for libtablet, this
+ is needed because during install log creation, tablet accessors
+ are run and will perform sanity checks on the tablet, which fail,
+ because the install log doesnt exist yet.

2006-01-03 Andrew Stitt <astitt AT sourcemage.org>
* gaze: fix bugs 10258, make gaze history and gaze HISTORY
@@ -345,11 +1036,19 @@
* gaze.1: fix bug 10305, fix description of gaze compile in the
manual,
patch from Jaka Kranjc.

+2006-01-03 Andrew Stitt <astitt AT sourcemage.org>
+ * cast: fix --deps, need to recompute closure
+
2006-01-02 Andrew Stitt <astitt AT sourcemage.org>
* etc/sorcery/config: specifically disable aliases before doing
anything, aliases seem to be cropping up in strange places.

2005-12-17 Andrew Stitt <astitt AT sourcemage.org>
+ * libdepends: add support for PRE_SUB_DEPENDS file, bug 10199
+ * libstate: make add_depends better at making subsequent
+ dependency requests override previous ones, bug 10185
+
+2005-12-17 Andrew Stitt <astitt AT sourcemage.org>
* dispel: fix bug 10189, dispel with dependency options didn't
work right when multiple spells were specified
* gaze: fix bug 10162, make gaze grimoire -q more friendly,
@@ -360,6 +1059,9 @@
specified, spells or --all still needs to be specified, bug 10228.

2005-12-11 Andrew Stitt <astitt AT sourcemage.org>
+ * build_api/common: Remove uncomitted sub-depends files after cast
+
+2005-12-11 Andrew Stitt <astitt AT sourcemage.org>
* gaze: fix search so it can use terms that contain spaces, bug 10139.
* gaze: fix pager support bug 10188, patch from Jaka Kranjc.
* gaze: add gaze UP_TRIGGER support.
@@ -368,6 +1070,32 @@
* etc/sorcery/url: Remove unc sourceforge mirror, fix spacing and
FURLNUM variable.

+2005-12-08 Andrew Stitt <astitt AT sourcemage.org>
+ * libdepengine: updates to make code more readable, fix spelling and
+ a bug uncovered by a review of the unit tests
+
+2005-12-08 Andrew Stitt <astitt AT sourcemage.org>
+ * libdepends: fix typo that caused sub-depends to be ignored in
+ some cases
+
+2005-12-06 Karsten Behrmann <BearPerson AT sourcemage.org>
+ * libmisc: fix upvar to work nicely when passed content containing
+ special variables
+
+2005-12-05 Andrew Stitt <astitt AT sourcemage.org>
+ * Fixes bug 6811 for sub-depends support.
+ * etc/sorcery/state: Add line for sub-depends table.
+ * cast: load variable with provided sub-depends.
+ * cleanse: add code to clean up sub-depends table.
+ * build_api/common: Commit provided sub-depends to table.
+ * libapi: Add entries for sub_depends and is_depends_enabled functions
+ * libdepends: add code to process sub-depends
+ * libdispel: remove sub-depends when both spells are removed
+ * libstate: Add functions to interface with the sub-depends
+ table, also adjusted accessors for regular depends where they
+ were insufficient
+ * libtablet: Add routines to populate and access sub-depends info.
+
2005-11-30 Andrew Stitt <astitt AT sourcemage.org>
* libdepengine: fix bug 10159, dpgn_cast_spell_front can return
values other than 0 or 1 which confuses recurse_depends into
@@ -390,6 +1118,10 @@
2005-11-28 Andrew Stitt <astitt AT sourcemage.org>
* gaze: fix bug 10140, gaze -q search was broken

+2005-11-26 David Brown <dmlb2000 AT gmail.com>
+ * libunpack: added --no-same-permissions to tar to fix permissions
+ problems when untaring files with og+w
+
2005-11-26 Andrew Stitt <astitt AT sourcemage.org>
* liburl: fix bug 10121, url ranking was broken, specifically timeouts
could get larger than bash's max array size, causing an error
@@ -398,7 +1130,7 @@
2005-11-26 Andrew Stitt <astitt AT sourcemage.org>
* libmedia: fix menu nit, bug 10104
* libdispel: remove atypical files on dispel, bug 10030
- * etc/sorcery/config: add VERIFIED_UPSTREAM_HASH verification level,
+ * etc/sorceryconfig: add VERIFIED_UPSTREAM_HASH verification level,
bug 10122
* man8/sorcery.8: fix sorcery system-update description, bug 10136

@@ -406,6 +1138,22 @@
* etc/sorcery/url: remove mirror.isurf.ca, adam has disappeared
with no indication he is going to re-populate it.

+2005-11-23 Andrew Stitt <astitt AT sourcemage.org>
+ * liburl: fix url_crack to pass "$@" not just $1
+
+2005-11-22 Andrew Stitt <astitt AT sourcemage.org>
+ * dl_handlers/dl_svn: echo the command being used, do not assume http
+ is the protocol, instead let the url handler fill it in while
+ cracking the url.
+ * url_handlers/url_svn: use true svn:// urls by default rather than
+ assuming http://. If the hint "old_svn_compat" is specified
+ use old behavior of inserting http://. All svn based spells
+ in test grimoire already do this.
+ * url_handlers/url_svn_http, url_handlers/url_svn_ssh:
+ add handlers for svn+http and svn+ssh, these are trivially
+ similar to url_svn, common code used where possible.
+ * libsummon: include svn_ssh and svn_http as tree downloads
+
2005-11-22 Andrew Stitt <astitt AT sourcemage.org>
* mirrors/SOURCEFORGE: remove belnet and unc mirrors since they
apparently are not working well, bug 10060
@@ -415,7 +1163,7 @@
sort|uniq

2005-11-17 Andrew Stitt <astitt AT sourcemage.org>
- * libdepends: add code that was overlooked for bug 7488,
+ * libdepends: add code that wasnt overlooked for bug 7488,
moves previous persistent file to an abandoned directory which is
later used by config_query_* functions

@@ -427,6 +1175,8 @@
in dependency queries, bug 10073
* scribbler: fix bug 10056, missing backquote on a message,
patch from Eric Sandall.
+ * libsummon: fix bug 10041, print out the file that was actually
+ found during acquire_src, not the file that was requested.
* libmisc, libdepends: factor out common code from select_list and
select_provider, use a hash instead of an array in select_list to
fix bug 9836.
@@ -459,6 +1209,17 @@
not needed

2005-10-24 Andrew Stitt <astitt AT sourcemage.org>
+ * cast: Add parameters for lazy updates and recast optional
+ features (bugs 9171 and 9040)
+ * libdispel, dispel: Implement "--total-dispel" feature (bug 8465)
+ * libdepends: Add functions for lazy updates and recast optional
+ features
+ * libmisc: Add upvar function since this is happening a lot
+ * libsorcery: Factor our code for when spells need updates, bug 9171.
+ * libstate: Add function for searching spell status. Check for
+ config file before trying to write to it, bug 8848
+
+2005-10-24 Andrew Stitt <astitt AT sourcemage.org>
* libmisc: add find backwards compatibility

2005-10-24 David Brown <dmlb2000 AT gmail.com>
@@ -477,6 +1238,10 @@
branch on cleanse --sweep.

2005-10-14 Andrew Stitt <astitt AT sourcemage.org>
+ * dl_wget: remove spurious declaration of WGET_OPTIONS that
+ munged all the options previous set
+
+2005-10-14 Andrew Stitt <astitt AT sourcemage.org>
* libsorcery, sorcery: remove static flag altogether, people can now
use the custom optimization flags menu for such things.
Suggesting static through the pre-baked options is an
@@ -485,10 +1250,6 @@
2005-10-14 Andrew Stitt <astitt AT sourcemage.org>
* sorcery: change help for static option so that it includes warning.

-2005-10-14 Andrew Stitt <astitt AT sourcemage.org>
- * dl_wget: remove spurious declaration of WGET_OPTIONS that
- munged all the options previous set
-
2005-10-02 Andrew Stitt <astitt AT sourcemage.org>
* libdepends: fix case where upward depends is done on a provider

@@ -511,735 +1272,4 @@
fallback to old checkout tarball if scm update fails (bug 9846)

2005-09-24 Andrew Stitt <astitt AT sourcemage.org>
- * libtriggers: check for triggers file before trying to look at it
- * libdepends: Add message for up_triggers (bug 9827)
-
-2005-09-22 Andrew Stitt <astitt AT sourcemage.org>
- * gaze: add a --fast parameter to gaze depends to make it run quicker
- * man1/gaze.1: update documentation for gaze depends
- * libdepends: silence touch command
-
-2005-09-22 Andrew Stitt <astitt AT sourcemage.org>
- * libsorcery: fix path to ChangeLog, bug 9787
- * liburl: fix bug 9789, preserve spell defined order of urls
- also change the maximum number of urls to 10, 20 seems excessive
- * url_handlers/url_http: Dont include "Custom" url in url expansion
-
-2005-09-22 Andrew Stitt <astitt AT sourcemage.org>
- * libmisc: add functionality to look in abandoned persistency dir for
- old answers after a cast -r. (bug 7488)
- * etc/sorcery/state: add an entry for the abandoned persistency dir
- * build_api/common: expunge stale abandoned persistency data on
- successful cast.
-
-2005-09-22 David Brown <dmlb2000 AT gmail.com>
- * libapi: added persistent_read function see header for description
- * libmisc: added real_persistent_read function bug #8539
- * libtablet: added tablet_get_persistent_config as part of bug #8539
- returns the absolute path to the spell persistent config file
- removed the tablet_find_spell_file no one uses it.
-
-2005-09-19 Andrew Stitt <astitt AT sourcemage.org>
- * libcrossinstall: Update file header.
- * libmisc: Add some missing function headers. Remove unused
- parent_PIDs function, found no trace of usage as far back as 1.8.
- * libtrack: Add missing function header.
- * libdepends: Remove unused satisfy_depends function.
-
-2005-09-19 Eric Sandall <eric AT sandall.us>
- * sorcery: Removed work marker
-
-2005-09-19 Andrew Stitt <astitt AT sourcemage.org>
- * delve: fix usage message
-
-2005-09-17 Andrew Stitt <astitt AT sourcemage.org>
- * cast: make cast -B work again
-
-2005-09-10 Andrew Stitt <astitt AT sourcemage.org>
- * gaze: add --no-optionals flag to gaze dependencies (bug 9708)
- * man1/gaze.1: updated documentation to mention -c and
- --no-optionals flag to gaze dependencies
-
-2005-09-10 Andrew Stitt <astitt AT sourcemage.org>
- * dl_wget: remove file before trying to download it (bug 9749)
-
-2005-09-10 Andrew Stitt <astitt AT sourcemage.org>
- * scribe: fix bug 8220, verify rsync tree downloads. Factored
- common code out of scribe_add_worker and scribe_do_update,
- merged result together to reduce redundant redundancy :-).
- * libgpg: Add routines for downloading manifest and manifest
- signature, then verifying tree based on manifest.
- * etc/sorcery/url: add more variables for rsync and manifest urls
- * config: add a variable for the manifest algorithm
- * dl_rsync: fix progress/spinner issues
- * man8/scribe.8: document scribe add from rsync bug 8609
- * scribe: Added messages for what the official grimoire urls are
- (bug 9701).
-
-2005-09-10 Andrew Stitt <astitt AT sourcemage.org>
- * libgpg: replace call to which with call to smgl_which (bug 9752)
- * build_api/common: use $INSTALL_ROOT in install_pam_confs (bug 9750)
-
-2005-09-10 Andrew Stitt <astitt AT sourcemage.org>
- * libgpg: add some new functions for hashes
- * libunpack: use gpg for higher hashes instead of hashsum
- * sorcery: factor code for getting current hash algorithms into
- libgpg and call the new function.
-
-2005-09-09 Andrew Stitt <astitt AT sourcemage.org>
- * cast: remove some code left-over from a previous attempt at
- triggers and was accidentally commited (oops, brown-bag time).
-
-2005-09-08 Andrew Stitt <astitt AT sourcemage.org>
- * config: add default values for init/xinetd queries
- * sorcery: add yet another menu, users can set the default values
- of init.d and xinetd service installation (bug 8532)
- * libcast: integrate menu selectable defaults with init/xinetd queries
-
-2005-09-07 Andrew Stitt <astitt AT sourcemage.org>
- * libsorcery: make cleanse --sweep use edit_file() instead of $EDITOR
-
-2005-09-05 Andrew Stitt <astitt AT sourcemage.org>
- * cast: make -d imply -c, bug 9624
-
-2005-09-05 Andrew Stitt <astitt AT sourcemage.org>
- * libdepends: add some more debugging info to
- private_common_depends, add another output message for when an
- optional depends exists, but is disabled
-
-2005-09-05 David Brown <dmlb2000 AT gmail.com>
- * libsorcery: changed out hard coded run compiler dir for an env var
- * compile_config: added RUN_COMPILER_DIR for where the run_compiler
- script is located
-
-2005-09-05 David Brown <dmlb2000 AT gmail.com>
- * libunpack: added function comment headers (sucky ones probably) and
- removed tabs for 8 spaces removed redundant else statement in
- is_allowed_hash
- * sorcery: removed tabs for 8 spaces
- * libgpg: removed tabs for 8 spaces
-
-2005-09-04 Andrew Stitt <astitt AT sourcemage.org>
- * libtablet: add quotes on iterate calls, bug 9707
-
-2005-09-04 David Brown <dmlb2000 AT gmail.com>
- * config: added allow new hashes
- * sorcery: added option for allowing new hashes
- * libunpack: added unpack_file_user_query, added hash_user_query to
call
- unpack_file_user_query
- * libgpg: modified gpg_user_query to call unpack_file_user_query on a
- spell and reverted gpg_verify_signature to set the envar $4
-
-2005-09-03 Andrew Stitt <astitt AT sourcemage.org>
- * protected: avoid a rare race by protecting wget, its in basesystem
- so it ought not be removed anyway. This can be taken out if/when
- the download code and cast wget agree to lock wget.
-
-2005-09-03 Andrew Stitt <astitt AT sourcemage.org>
- * config: remove PROTECT_SORCERY flag, it actually isnt needed,
- it already gets set where appropriate.
- * libapi: add up_triggers to be used in experimental UP_TRIGGERS file
- * libdepends, libdepengine: Fix up support for run_script trigger
- * libdepends: add support for UP_TRIGGERS file
- * libhash: Add support for fields with spaces in their names
- make hash_get echo with quotes, this keeps newlines from getting
- reparsed as spaces
- * libtriggers: add a function to get the informative data from a
- run_script trigger.
-
-2005-09-03 Andrew Stitt <astitt AT sourcemage.org>
- * libmisc: remove cache_env and restore_env. they are unused
-
-2005-09-02 David Brown <dmlb2000 AT gmail.com>
- * libunpack: added some extra checks and messages for checking gpg
- keys and added the integrety checking levels (bug #9515)
- * sorcery: added the menus for bug #9515
- * libgpg: added the spell switch for $3 and made it act like hash
- failure
-
-2005-08-31 Andrew Stitt <astitt AT sourcemage.org>
- * libmisc: don't complain about sorcery var's during
- persistent_load bug 9416. fix apparently incomplete on/off
- switch for sorcery var complaining
-
-2005-08-31 Andrew Stitt <astitt AT sourcemage.org>
- * libdepengine: Addition of new library, this module handles
- walking the merged dependency and trigger tree, it replaces make.
- * cast: remove make specific code.
- * build_api/common: remove run_triggers function, put it in
libtriggers
- * libapi, libmisc, cast: remove RM_AT_END, its obsolesced by $TMP_DIR
- * libdepends: add support for importing trigger information
- during dependency resolution.
- * libcast: dont remove download log and download completion
- sentinal, otherwise if a spell is cast twice from a
- depends/trigger cycle it will hang forever.
- * libhash: add support for hashing keys with colons.
- * libtriggers: Break trigger execution out into another
- function. Add function to get triggerees.
-
-2005-08-30 David Brown <dmlb2000 AT gmail.com>
- * etc/sorcery/config: added enumeration for spells to use
- * usr/sbin/sorcery: made dialogs work
-
-2005-08-29 Andrew Stitt <astitt AT sourcemage.org>
- * libgpg: fix use of list_find
-
-2005-08-28 David Brown <dmlb2000 AT gmail.com>
- * libgpg: gpg_user_query fixed grimoire checking to be a little easier
- to add/remove gpg signed grimoires
- * config: added GPG_GRIMOIRE_LIST with a default set of gpg signed
- grimoires
-
-2005-08-28 David Brown <dmlb2000 AT gmail.com>
- * etc/sorcery/config: added GPG_VERIFY_SPELL_LEVEL default to level 0
- and added GPG_ALLOWED_HASHES sentinal value is "" same as allow all
- and added GPG_MAX_LEVEL so we can add more by changing the config
- * var/lib/sorcery/libgpg: removed message from gpg_verify_signature
- it now outputs the algorithm used to create the gpg signature
- * var/lib/sorcery/libunpack: added path message from libgpg to here
made
- variables local and added a few preliminary vars for use later
- * usr/sbin/sorcery: added some of the initial menu stuff
-
-2005-08-26 Eric Sandall <eric AT sandall.us>
- * usr/sbin/gaze: Have gaze pick the first file returned by ./find for
- `gaze voyeur` (Bug #9632)
-
-2005-08-26 David Brown <dmlb2000 AT gmail.com>
- * libunpack: bug 9625 changed cut to just pull the second field not
- everything after and including the second field
-
-2005-08-26 Andrew Stitt <astitt AT sourcemage.org>
- * cast: get rid of notorious '60' file
-
-2005-08-25 Andrew Stitt <astitt AT sourcemage.org>
- * libunpack: yse SOURCEn_GPG[m] instead of SOURCEn_GPGm
- remove useless eval
-
-2005-08-25 David Brown <dmlb2000 AT gmail.com>
- * libunpack: added comment in real_unpack_file about SOURCEn_*m vs.
- SOURCEn_*[m] confusion might end up ripping this out because of that
-
-2005-08-24 Andrew Stitt <astitt AT sourcemage.org>
- * scribe: add local rc to scribe_do_update, bug 9555
- * delve: fix bug 9566, any non-zero return value is failure
-
-2005-08-22 Andrew Stitt <astitt AT sourcemage.org>
- * libdispel: handle case of removing a spell that no longer
- exists, bug 9462
- * libinitd: mkdir /etc/sysconfig before trying to use stuff in
- it, bug 9509.
-
-2005-08-14 David Brown <dmlb2000 AT gmail.com>
- * var/lib/sorcery/modules/libapi: removed requires deprecated for good
-
-2005-08-14 Karsten Behrmann <BearPerson AT sourcemage.org>
- * cast, man8/cast.8: updated docs for --deps
-
-2005-07-30 Andrew Stitt <astitt AT sourcemage.org>
- * liburl: some performance adjustments for bug 9391, made
- url_expand_urls work more effectively, enhanced url_get_prefix
- to use bash only per suggestion from David Brown. Shorten the
- list of urls to a max of 20 so as to not totally slow down
- subsequent code.
- * url_default: slightly faster default validation and cracking
- routines. Avoid forking where possible.
-
-2005-07-30 Andrew Stitt <astitt AT sourcemage.org>
- * This change includes updates to the downloading code, it resolves
bugs
- 8209, 8150, 8993. It also makes several other enhancements
- more feasable and removes a number of layering issues.
- * libapi: Add acquire_src and download_src for download
- * libgpg: Minor updates for new api
- * liblock: Add a simple counter api
- * libmisc: Add function to get the SOURCE suffixes for a spell,
- add a function see if a command is a function
- * libsorcery: Minor updates for new api, remove INSTALL_ROOT
- from update code
- * libsummon: Call new downloading api, deal with packaging and
- repackaging of cvs/svn/etc. checkouts.
- * libunpack: Add a function for simple unpacking
- * liburl: Update for new downloading scheme
- * url_handlers/*: Update to new scheme, code for downloading
- branched to download handlers, update to new api set, add
- url_default to provide overridable defaults. Code for unpacking
- and repackaging of tarballs branched over to libsummon.
- * modules/dl_handlers/*: All downloading code from url_handlers
- branched here.
- * libdownload: Repurposed as a frontend for download handlers,
- now run by liburl
- * url_handlers/url_tla, url_handlers/url_smgl_tla: delete,
- branch, using new url prefix for smgl's custom tla url scheme
- so as not to conflict with future tla:// urls.
- * cast: api update call summon_spell instead of summon_spells
- * gaze: Updates for new grimoire files
- * scribe: Update for new api, add code for handling rsync/tree
- type adds/updates
- * summon: Updates for new api, move summon_spells here, fix raw
- mode to use new functions.
- * uninstall: Simple nitpick updates
- * etc/sorcery/url: Move hardcoded internet interfaces list and
- pon/poff calls into overridable variables here. Add an obvious
- way to switch over to grimoires from rsync.
-
-2005-07-30 Paul Mahon <pmahon AT sourcemage.org>
- * libmisc, libsorcery: Create variable to hold generic compatable
- architectures (bug 9078)
-
-2005-07-24 Andrew Stitt <astitt AT sourcemage.org>
- * mirrors/APACHE: remove dead mirror, bug 9337
- * solo: delete, all solo spells have their own SOLO file, bug 9110
- * cast: dont grep solo file if it does not exist
-
-2005-07-23 Andrew Stitt <astitt AT sourcemage.org>
- * libcast: start handling 'default providers' again in the init system
- add warnings about ESSENTIAL and RECOMMENDED init scripts
- * libinitd: update default provider query to work on
- a (persistent) variable not in the $SPELL_CONFIG, check for
- modified sysconfig file, remove code for enforcing ESSENTIAL
- init scripts, that is handled in libcast
- * libresurrect: fix several bugs: Don't remove the log files,
- they're still needed for config file checking and reaping old
- files. Fix bugs with removing leftover config files.
- * libtrack: Add a way to check and mark files as modified.
-
-2005-07-21 Paul Mahon <pmahon AT sourcemage.org>
- * api1, api2: Check that SCREEN==on before doing screen stuff (bug
9302)
- * cast: Make sure screen message is only printed once (bug 9293)
-
-2005-07-19 Andrew Stitt <astitt AT sourcemage.org>
- * libcodex: Add an additional variable for GRIMOIRE_NAME since
- basename $GRIMOIRE isn't always the grimoire name.
- * gaze: use GRIMOIRE_NAME where appropriate instead of basename
- $GRIMOIRE
-
-2005-07-18 Maurizio Boriani <baux AT sourcemage.org>
- * url_tla: Fix minor grep bug over archive name and cosmetic clean up.
-
-2005-07-18 Andrew Stitt <astitt AT sourcemage.org>
- * libunpack: propagate return code properly if verification fails
-
-2005-07-16 Andrew Stitt <astitt AT sourcemage.org>
- * libtablet: add new accessor functions for grimoire and section
filters
- * libsorcery: expand filter_generic to look at grimoire and
- section filters
- * libresurrect: fix to use new tablet api
-
-2005-07-16 Maurizio Boriani <baux AT sourcemage.org>
- * url_tla: Fix tla binary exist test and test if tla archive
- is already registered before doing so.
-
-2005-07-16 Paul Mahon <pmahon AT sourcemage.org>
- * libscreen, config, cast,sorcery: Addition of screen lib and
- integration of screen into cast
-
-2005-07-09 Karsten Behrmann <BearPerson AT sourcemage.org>
- * url_http: Carry wget exit status past variable assignment
-
-2005-07-09 Andrew Stitt <astitt AT sourcemage.org>
- * libunpack: GRIMOIRE_DIRECTORY -> GRIMOIRE,bug 9191, thanks dmlb2000.
-
-2005-07-07 Andrew Stitt <astitt AT sourcemage.org>
- * libsorcery: set SCRIPT_DIRECTORY in codex_set_current_spell_quick
-
-2005-07-02 Paul Mahon <pmahon AT sourcemage.org>
- * libmisc: addition of define_function
- * gaze: fix bug 9150, redefine functions that should be used in
DEPENDS
-
-2005-06-27 David Brown <dmlb2000 AT excite.com>
- * libunpack: line 142 removed extra quotes around the $GPGNUM
-
-2005-06-04 Andrew Stitt <astitt AT sourcemage.org>
- * libmisc: update documentation for real_query(), bug 8931
- used patch from Ondra Tomecka.
-
-2005-06-04 Andrew Stitt <astitt AT sourcemage.org>
- * sorcery, man/man8/sorcery.8: finish documentation for bug 8322
- use patch from Ondra Tomecka.
-
-2005-06-04 Andrew Stitt <astitt AT sourcemage.org>
- * cleanse: make cleanse --prune use cast -c instead of regular cast
- bug 9035
-
-2005-06-04 Andrew Stitt <astitt AT sourcemage.org>
- * dispel: fix dispel_children to properly pass back dispelled children
- bug 9044
-
-2005-06-01 Andrew Stitt <astitt AT sourcemage.org>
- * libdepends: fix show_depends to call iterate properly
-
-2005-05-30 Andrew Stitt <astitt AT sourcemage.org>
- * libresurrect: fix an issue caused when resurrecting something
- with symlinks to a directory.
-
-2005-05-30 Andrew Stitt <astitt AT sourcemage.org>
- * /etc/sorcery/config: add default values for dependency following
- defaults.
- * install: remove improperly installed sorcery manuals in /usr/man/
- * dispel: add dependenc following support, fixes bugs 5259 and 5634.
- * sorcery: add call to menu for user dependency following defaults
- * man8/dispel.8: update with info on dependency following
- * libdispel: Add dependency following default menus, a few minor
- updates to dispel_spell
- * libmisc: Use regular grep, not grep -E in list_find, -E makes
- it too hard to put spells (things with + characters in the name)
- in lists, unit tests pass.
- * libstate: Dont esc_str depends values in remove_depends_status
- since I think they aren't needed, unit tests pass.
-
-2005-05-30 Paul Mahon <pmahon AT sourcemage.org>
- * gaze: add compact mode to prevent loops
-
-2005-05-29 Seth Woolley <seth AT tautology.org>
- * libinitd: be sure to track unmodified init.d installs and when
- /etc/sysconfig/init doesn't exist, use a sane value of
- RUNLEVELS_DIR.
-
-2005-05-27 Andrew Stitt <astitt AT sourcemage.org>
- * libstate: Fix bug 8990, get_spell_provider doesnt always work.
-
-2005-05-23 Andrew Stitt <astitt AT sourcemage.org>
- * libhash: fix variable name typo in hash_reset
-
-2005-05-23 Andrew Stitt <astitt AT sourcemage.org>
- * scribe: keep track of return code in scribe update, bug 8859
-
-2005-05-23 Andrew Stitt <astitt AT sourcemage.org>
- * libmisc: make smgl_which slightly more robust
-
-2005-05-23 Andrew Stitt <astitt AT sourcemage.org>
- * libmedia, libsorcery: Yet more fixups for menu help items
- (bug 8959/8610)
-
-2005-05-15 Andrew Stitt <astitt AT sourcemage.org>
- * sorcery: fix custom optimization flags menu to show values
- like it used to, bug 8891.
-
-2005-05-10 Andrew Stitt <astitt AT sourcemage.org>
- * libresurrect: fix bug 8813, thanks Eric Sandall.
-
-2005-05-06 Andrew Stitt <astitt AT sourcemage.org>
- * libsorcery: fix invoke_build_dir, a missing $ made it such that
- ccache wouldnt get used unless one used distcc simultaneously.
-
-2005-05-02 Andrew Stitt <astitt AT sourcemage.org>
- * sorcery: accept 'sorcery help' as a way to request help, most
- other commands dont have preceeding --'s so this may make more
- sense to some. Bug 8786, thanks for the patch Ondra Tomecka.
- * man8/sorcery.8: update manual with 'sorcery help'
-
-2005-05-02 Andrew Stitt <astitt AT sourcemage.org>
- * cast: dont use -s in pass_four as per comments in bug 8761
- * etc/sorcery/config: unset MAKEFLAGS so values of -s etc dont
- get inherited.
-
-2005-05-01 Andrew Stitt <astitt AT sourcemage.org>
- * libmisc: send messages from mk_tmp_dirs to stderr
-
-2005-05-01 Andrew Stitt <astitt AT sourcemage.org>
- * libtablet, libsorcery: use SECURITY_PATCH instead of
- SECURITY_PATCHLEVEL, de-cripple the tablet creation portion
- of this enhancement, this concludes the sorcery portion of
- bug 8379.
-
-2005-05-01 Andrew Stitt <astitt AT sourcemage.org>
- * sorcery: fix bug 8322, modifications of the install queue from
- the command line, thanks Ondra Tomecka.
-
-2005-05-01 Andrew Stitt <astitt AT sourcemage.org>
- * cast: use -s when calling make to supress unneeded messages, bug
8761
-
-2005-05-01 Andrew Stitt <astitt AT sourcemage.org>
- * sorcery: make 'sorcery version' also work like sorcery
- --version, bug 8777.
-
-2005-05-01 Andrew Stitt <astitt AT sourcemage.org>
- * cast: --cflags, --cxxflags, --ldflags, and --no-opts imply -c,
- bug 8739.
-
-2005-05-01 Andrew Stitt <astitt AT sourcemage.org>
- * install: install man pages to /usr/share/doc instead of /usr/doc
- * libsorcery: run uninstall and the install log exist
- * uninstall: fix some problems with removing the install log before
- the script is done with it
-
-2005-04-30 Andrew Stitt <astitt AT sourcemage.org>
- * etc/sorcery/config: unset MAKELEVEL to fix an issue with
- multiply nested triggers, bug 8756
-
-2005-04-30 Andrew Stitt <astitt AT sourcemage.org>
- * cast: bandaid cast --queue code to work now that we pass "$@" around
-
-2005-04-29 Andrew Stitt <astitt AT sourcemage.org>
- * alter, cast, cleanse, delve, dispel, invoke, scribbler, scribe,
- sorcery, summon: Pass "$@" around to preserve parameter grouping
- also call a new routine that backquotes things, this helps get
- parameters through the su process from an unprivaledged user, bug
8738
- * libmisc: add function to consolidate parameters
-
-2005-04-28 Andrew Stitt <astitt AT sourcemage.org>
- * summon: fix poor wording in summon --help, thanks Geoffrey
- Derber for pointing this out.
-
-2005-04-27 Andrew Stitt <astitt AT sourcemage.org>
- * libunpack: fix bug 8732, check for file existence while unpacking
-
-2005-04-27 Andrew Stitt <astitt AT sourcemage.org>
- * libtablet: add some code for new PATCHLEVEL and to be named
- SECURITY_PATCHLEVEL concepts, actual storage of security
- patchlevel wont be done until the name is finalized
- * libsorcery: add some code to look at PATCHLEVEL (formerly
- known as UPDATED) and SECURITY_PATCHLEVEL in the regular sorcery
- queue code, add another similar function to find just security
- updates (bug 8379 and 8736)
- * sorcery: add a new sub-command queue-security for bug 8379
- * man8/sorcery.8: update manual to include info on queue-security
- sub-command
-
-2005-04-27 Andrew Stitt <astitt AT sourcemage.org>
- * libtablet: fix typo in repair updated, also do some sanity
- checking in the other repair routines
-
-2005-04-26 Andrew Stitt <astitt AT sourcemage.org>
- * scribbler: moved code into functions and modernize calls
- also always copy the spell and replicate the grimoire and
- section files so the spell can be self contained and inherit
- code properly (bug 8430)
- * libcodex: add special case for scribbled spells in
- codex_set_current_spell and codex_set_current_spell_quick
-
-2005-04-26 Paul Mahon <pmahon AT sourcemage.org>
- * run_compiler: Minor fix so the script path isn't assimed to be first
-
-2005-04-25 Andrew Stitt <astitt AT sourcemage.org>
- * libsorcery: enhance generate_keep_list to only look at files
- related to installed spells.
- * cleanse: add cleanse --sweep_all (bug 8663).
- * man/man8/cleanse.8: add entry for --sweep_all.
-
-2005-04-25 Andrew Stitt <astitt AT sourcemage.org>
- * libdispel: load the spell from the codex if the tablet isnt
- found, bug 8728
-
-2005-04-23 Andrew Stitt <astitt AT sourcemage.org>
- * libdownload: add line for ath wireless interfaces, bug 8634.
- * libdownload: make the error when unable to get online more
- friendly, bug 8656.
- * libmisc: add a simple implementation of which for our needs
- and since which is (correctly) not in basesystem, also add a
- wrapper to find make for us.
- * cast, cleanse, gaze, libgrimoire: find the real path to make when
- we dont want to call the function make(), bug 8642.
-
-2005-04-21 Andrew Stitt <astitt AT sourcemage.org>
- * libcrossinstall: fix bug 8647, use safe values for *_ROOT
- menus since if the user tries hard enough while hitting cancel
- they could get funny results.
- * alter, dispel, build_api/common, libresurrect, libsorcery,
- dispel, libdispel: Update cache tarball naming to use HOST
- not BUILD, this was only noticable on cross-compiling. This is bug
- 8648, thanks Benoit!
-
-2005-04-20 Andrew Stitt <astitt AT sourcemage.org>
- * libdepends: use a consistent sentence structure between the
- four depends permutations (bug 8613), also fix a bug where the
- description was ignored for non-optional depends on a provider.
-
-2005-04-20 Andrew Stitt <astitt AT sourcemage.org>
- * install: forcibly remove install.log (thereby avoiding a warning
- from rm about it not being there) and add the install.log to
- itself so its not alien.
-
-2005-04-19 Andrew Stitt <astitt AT sourcemage.org>
- * install: generate a special install.log file used to track
- sorcery's own files. This file is always the same name regardless
- of sorcery branch so its easy to find.
- * gaze: use the new sorcery install log to make sure gaze alien doesnt
- show sorcery as alien (bug 8381)
- * uninstall: trivial new uninstall script (bug 8596)
- * libsorcery: fix typo in libsorcery when sorcery update
- fails to download (bug 8628)
-
-2005-04-17 Andrew Stitt <astitt AT sourcemage.org>
- * libtablet: dont make the tablet state dir if it doesnt exist
- it just makes it tracked for no reason
- * libresurrect: fix bug 8620, the wrong path for the tablet was used
- if STATE_ROOT was not "". Also fix an issue with symlinks
- to directories.
-
-2005-04-17 Paul Mahon <pmahon AT sourcemage.org>
- * libdepends: function would block if depends or state files
- didn't exist
-
-2005-04-16 Andrew Stitt <astitt AT sourcemage.org>
- * sorcery, libcrossinstall: define dialog vars local so they
- dont stomp on each other (bug 8610)
-
-2005-04-16 Andrew Stitt <astitt AT sourcemage.org>
- * libsorcery: fix broken filter_in to work like filter when
- generating the RIDLIST and there are multiple filters (bug 8608)
-
-2005-04-15 Andrew Stitt <astitt AT sourcemage.org>
- * libresurrect: mkdir -p $BUILD_DIRECTORY in case we're
- resurrecting into an install_root (bug 8601)
- * cast: remove a harmless syntax error with the summon phase
- during resurrect
- * libmisc: only complain about strange /tmp/sorcery dir if it
- actually exists, it doesnt on new systems or those with tmpfs
- /tmp after reboot (bug 8599)
-
-2005-04-13 Andrew Stitt <astitt AT sourcemage.org>
- * libmisc: add a chmod a-s for the first level of temporary
- dirs in mk_tmp_dirs, this works around an iso bug introduced
- in 0.9.4-test3
-
-2005-04-12 Andrew Stitt <astitt AT sourcemage.org>
- * libsorcery: fix some issues with optimize finding archspecs
-
-2005-04-11 Andrew Stitt <astitt AT sourcemage.org>
- * libsorcery: expect there to be more than one archspec, use
- head -n 1 on find output
- * sorcery: enahnce menu to expect multiple instances of an archspec
- * etc/sorcery/config: archspecs can also be found in
- /usr/share/archspecs from the smgl-archspecs spell
-
-2005-04-11 Andrew Stitt <astitt AT sourcemage.org>
- * libtrack: qualify INSTALL_ROOT and STATE_ROOT with / before
- cding there
- * delve: cd to / before running spell success like cast does
-
-2005-04-09 Arjan Bouter <abouter AT sourcemage.org>
- * libresurrect: fixed the arguments test in real_install_config_file
-
-2005-04-08 Andrew Stitt <astitt AT sourcemage.org>
- * sorcery: add -f to rm command for replacing the restore script
-
-2005-04-08 Andrew Stitt <astitt AT sourcemage.org>
- * build_api/common: rm_source_dir before making cache archive (bug
8249)
- * etc/sorcery/config: add a SORCERY_PATH variable that people can
- override if necessary, defaults to /usr/sbin (where sorcery
- is installed). Fixes bug 8200.
-
-2005-04-06 Seth Woolley <seth AT tautology.org>
- * libunpack: correct locate_spell_file logic for secure mode.
- Thanks to David Michael Leo Brown, Jr. of linux-new fame.
-
-2005-04-06 Andrew Stitt <astitt AT sourcemage.org>
- * libsorcery: fix 'bug' 8567, remove spaces from CFLAGS,
- et. al. variables for broken configure scripts.
-
-2005-04-05 Seth Woolley <seth AT tautology.org>
- * libunpack: libunpack code cleanups, more refactors, and a
- single conditional statement to change between old and new
- world, and all old world code isolated ready for deletion.
- * libunpack: slightly different auditing api and the addition of
- multiple GPG or HASH support per source file (so you can have,
- say sha1 and md5 at the same time), also added checks for the
- spell needed to support higher bit hashes, with an advisory if
- it's not installed (so people can rank high bit hashes even
- though it isn't in basesystem and it will gracefully failover
- to lower bit-depths).
- * libunpack: IGNORE and MISSING support. MISSING will mostly be
- for a future auditing script as unpack_missing should never be
- activated in a real spell. IGNORE supports volatile,
- unversioned, and signature modes that let the user know why it
- is being ignored, and signatures are also silently skipped since
- they are not unpacked at all.
- * libapi: some api removals and one addition for easier patching
- where checks are needed (uncompress/guess_compressor pair)
-
-2005-04-05 Andrew Stitt <astitt AT sourcemage.org>
- * libtriggers: apply patch from Thomas Houssin to fix a bug
- introduced by my change yesterday. The function now uses
- iterate. Ive made some additional fixups to the code, namely
- using spaces instead of tabs for indenting and making the query
- more colorful.
-
-2005-04-04 Andrew Stitt <astitt AT sourcemage.org>
- * libtriggers: fix run_script trigger action (bug 8557)
-
-2005-04-04 Andrew Stitt <astitt AT sourcemage.org>
- * cleanse: pass the backup dir in --tablet_spell
-
-2005-04-04 Seth Woolley <seth AT tautology.org>
- * libgrimoire,libunpack: split out unpack stuff into new lib,
- then order it semantically by common/oldworld/newworld.
- * libunpack: add more documentation.
- * libapi: change references for the refactor.
-
-2005-04-04 Seth Woolley <seth AT tautology.org>
- * libgrimoire: correct documentation to be easier on the gurus
-
-2005-04-04 Paul Mahon <pmhon AT sourcemage.org>
- * libdepends: locate typo fixed
-
-2005-04-04 Seth Woolley <seth AT tautology.org>
- * build_api/api[12]: use unpack_file instead of unpack
- * libgrimoire: spell gpg checking. See format in unpack_file
- * libapi: some new api additions from libgrimoire
-
-2005-04-04 Andrew Stitt <astitt AT sourcemage.org>
- * build_api/api[12]: use >> instead of > for process substitution,
- this fixes super-debug log truncation (bug 7903)
- * url_http: make wget log all its output to stdout
- * cast: make summon_spells not redirect stderr, another thing
- that breaks super-debug
-
-2005-04-03 Andrew Stitt <astitt AT sourcemage.org>
- * cast: fix bug where if a spell is being resurrected and its
- source is being summoned the summon code can finish after the
- resurrect code and get an error
-
-2005-04-03 Andrew Stitt <astitt AT sourcemage.org>
- * cast: add a -b parameter to enable an option that forces all
- spells to implicitly depends on basesystem
- * libdepends: if FORCE_BASESYSTEM_DEPENDS is on then all spells
- (except basesystem and its depends) implicitly depend on basesystem
- * etc/sorcery/config: add FORCE_BASESYSTEM_DEPENDS (default off)
- * sorcery: greatly simplify rebuild by using libstate a routine
- call cast with -b to ensure a reasonable ordering of basesystem
- spells first (fixes bug 7762)
-
-2005-04-01 Andrew Stitt <astitt AT sourcemage.org>
- * libcast: break the FUNCTIONS file loading into a seperate function
- * libdispel: load the FUNCTIONS library (fix bug 8452)
-
-2005-04-01 Andrew Stitt <astitt AT sourcemage.org>
- * libtablet: add functions to import REPAIR files into the tablet
- make this also happen from the regular tablet cleanse path (bug
8494)
- * scribe: add call to run tablet-wide REPAIR file import after a
- scribe update
- * cleanse: add option to cleanse just one spell's tablet
- * man/man8/cleanse.8: update man page to have information about
- --tablet_spell option
-
-2005-03-26 Andrew Stitt <astitt AT sourcemage.org>
- * archspecs/ia32/intel/pentium3m: Add new archspec fixes bug 8504
- * archspecs/ia32/intel/pentium4m: Add code to work with gcc 3.3
-
-2005-03-18 Andrew Stitt <astitt AT sourcemage.org>
- * libresurrect: fix bug 8441, 'test -f' returns true, by adding
- quotes around the optional md5sum log it becomes 'test -f ""'
- which returns false as I had thought 'test -f' would do.
-
-2005-03-17 Andrew Stitt <astitt AT sourcemage.org>
- * libresurrect: specifically find spell specific configs file rather
- than use filter_configs due to our weird environment, also
- quote a number of filenames that were left unquoted.
- * libsorcery: redirect tablet functions in filter_generic to
- /dev/null and make them conditional on each other
- * libtablet: preserve the value of TABLET_PATH, whatever it
- might be in tablet_set_spell
-
-2005-03-17 Andrew Stitt <astitt AT sourcemage.org>
- * libresurrect: fix resurrect of a config file (bugs 8439 8438)
- * libtablet: make a less restrictive routine to dig up the tablet
- for a resurrect sandbox which obviously wont be self-referential
- or installed.
- * libsorcery: fix the way spell specific filters are searched for
- * libdispel: fix bug with POST_REMOVE and the tablet, the tablet
- gets removed before post_remove is called, postpone tablet
- removal until after post_remove is run. Also fix some problems
- with file name adjustment.
-
-2005-03-16 Andrew Stitt <astitt AT sourcemage.org>
- * Start 1.13 development stream.
+ * Start 1.14 development stream.
diff --git a/etc/sorcery/config b/etc/sorcery/config
index 29835d8..536136b 100755
--- a/etc/sorcery/config
+++ b/etc/sorcery/config
@@ -16,9 +16,10 @@ shopt -u expand_aliases
SOUND=${SOUND:=off}
SUSTAIN=${SUSTAIN:=on}
TMPFS=${TMPFS:=off}
- VIEW_REPORTS=${VIEW_REPORTS:=on}
+ VIEW_REPORTS=${VIEW_REPORTS:=off}
VOYEUR=${VOYEUR:=on}
PROMPT_DELAY=${PROMPT_DELAY:=150}
+ PAGER_TIMEOUT=${PAGER_TIMEOUT:=150}
MAX_CABALS=${MAX_CABALS:=16}
NET_SELECT=${NET_SELECT:=off}
MD5SUM_DL=${MD5SUM_DL:=ask_risky}
@@ -26,6 +27,7 @@ shopt -u expand_aliases
COMPRESSBIN=${COMPRESSBIN:=bzip2}
EXTENSION=${EXTENSION:=.bz2}
SET_TERM_TITLE=${SET_TERM_TITLE:=off}
+ PER_SPELL_CFLAGS=${PER_SPELL_CFLAGS:=off}
STRICT_SCM_UPDATE=${STRICT_SCM_UPDATE:=off}
NICE=${NICE:=+10}
UMASK=${UMASK:=0022}
@@ -51,7 +53,7 @@ FORCE_BASESYSTEM_DEPENDS=${FORCE_BASESYSTEM_DEPENDS:-off}
# -X: dont do screen init and deinit, gaze install
# of a small spell is effectively useless otherwise as
the
# screen is cleared afterwards.
- PAGER=${PAGER:=less -R -E -X -f}
+ PAGER=${PAGER:=less -R -F -X -f}
FILEPROG=${FILEPROG:=file}
DIALOGPROG=${DIALOGPROG:=dialog}

@@ -115,7 +117,7 @@ GRIMOIRE_MANIFEST_ALGORITHM=sha1
SGL_LIBRARY_MODULES=${SGL_LIBRARY}/modules
# system archspecs are still considered part of sorcery
# and are deliberatly not in INSTALL_ROOT
- ARCH_SPECS="/usr/share/archspecs ${SGL_LIBRARY}/archspecs"
+ ARCH_SPECS="/usr/share/archspecs"
EXCLUDED=${SGL_LIBRARY}/excluded
CODEX=${SGL_LIBRARY}/codex
PROTECTED=${SGL_LIBRARY}/protected
@@ -128,15 +130,18 @@ GRIMOIRE_MANIFEST_ALGORITHM=sha1

SPELL_INDEX_FILE=codex.index
PROVIDE_INDEX_FILE=provides.index
+ KEYWORD_INDEX_FILE=keyword.index

LOCK_DIR=/tmp/liblock-$UID
LOCK_TRANSACTIONS="$LOCK_DIR/liblock.locklist"
- MAX_SLEEP=5
+ MAX_SLEEP=3

TABLET_MAX_VERSION=1

SOURCE_CACHE=${SOURCE_CACHE:=/var/spool/sorcery}

+DEFAULT_CHANGED_CONFIG_ACTION=${DEFAULT_CHANGED_CONFIG_ACTION:-2}
+
# SECURITY NOTE: any script running as root must pick a
# more secure location for temp files that is not accessable
# by other users and override this variable.
@@ -147,8 +152,9 @@ GRIMOIRE_MANIFEST_ALGORITHM=sha1

SCREEN=${SCREEN:-off}

- TRACKED="/bin /boot /etc /lib /sbin /usr /var"
- DOCS="README* FAQ* CHAN* doc* DOC* conf SETUP LICENSE
COPYING NEWS"
+ GAZE_ALIEN_PATHS="/bin /boot /etc /lib /sbin /usr /var"
+ DOCS='README* FAQ* CHAN* DOC* SETUP LICENSE COPYING NEWS
*rc'
+ DOC_DIRS='doc* conf'
PROGRESS_SPINNER_CHARS='-\|/'

WHITESPACE_IFS=$' \t\n'
@@ -170,6 +176,14 @@ PROGRESS_SPINNER_CHARS='-\|/'

BUILD_DIRECTORY=${INSTALL_ROOT}/usr/src
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
+CASTFS_UNSTAGED_PATHS="/dev /proc /tmp /var/tmp /sys ${BUILD_DIRECTORY}
${SGL_LIBRARY} ${INSTALL_ROOT}/${SGL_LIBRARY} ${SOURCE_CACHE} ${CONFIG_CACHE}
${INSTALL_ROOT}/${CONFIG_CACHE} ${STATE_DIRECTORY} ${LOG_DIRECTORY}"
+# this value is a mask bits set mean output is done for that particular
+# component of castfs
+CASTFS_DEBUG_LEVEL=${CASTFS_DEBUG_LEVEL:=255}

# this makes appending the sorcery path idempotent
[ -z ${PATH##*$SORCERY_PATH*} ] || export PATH="$PATH:$SORCERY_PATH"
diff --git a/etc/sorcery/mirrors/KERNEL b/etc/sorcery/mirrors/KERNEL
index 01165fd..53a4bbb 100755
--- a/etc/sorcery/mirrors/KERNEL
+++ b/etc/sorcery/mirrors/KERNEL
@@ -1,488 +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
-Albania http://www.al.kernel.org
-Albania ftp://ftp.al.kernel.org
-Algeria http://www.dz.kernel.org
-Algeria ftp://ftp.dz.kernel.org
-"American Samoa" http://www.as.kernel.org
-"American Samoa" ftp://ftp.as.kernel.org
-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
-Angola http://www.ai.kernel.org
-Angola ftp://ftp.ai.kernel.org
-Anguilla http://www.ai.kernel.org
-Anguilla ftp://ftp.ai.kernel.org
+Andorra http://www.ad.kernel.org
Antarctica http://www.aq.kernel.org
-Antarctica ftp://ftp.aq.kernel.org
-"Antigua and Barbuda" http://www.ag.kernel.org
-"Antigua and Barbuda" ftp://ftp.ag.kernel.org
Argentina http://www.ag.kernel.org
-Argentina ftp://ftp.ag.kernel.org
-Armenia http://www.am.kernel.org
-Armenia ftp://ftp.am.kernel.org
Aruba http://www.aw.kernel.org
-Aruba ftp://ftp.aw.kernel.org
-"Ascension Island" http://www.ac.kernel.org
-"Ascension Island" ftp://ftp.ac.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
-Bahamas ftp://ftp.bs.kernel.org
-Bahrain http://www.bh.kernel.org
-Bahrain ftp://ftp.bh.kernel.org
-Bangladesh http://www.bd.kernel.org
-Bangladesh ftp://ftp.bd.kernel.org
Barbados http://www.bb.kernel.org
-Barbados ftp://ftp.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
-Belize ftp://ftp.bz.kernel.org
-Benin http://www.bj.kernel.org
-Benin ftp://ftp.bj.kernel.org
-Bermuda http://www.vm.kernel.org
Bermuda ftp://ftp.bm.kernel.org
-Bhutan http://www.bt.kernel.org
-Bhutan ftp://ftp.bt.kernel.org
-Bolivia http://www.bo.kernel.org
Bolivia ftp://ftp.bo.kernel.org
-"Bosnia and Herzegowina" http://www.ba.kernel.org
-"Bosnia and Herzegowina" ftp://ftp.ba.kernel.org
-Botswana http://www.bw.kernel.org
-Botswana ftp://ftp.bw.kernel.org
-"Bouvet Island" http://www.bv.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
-"British Indian Ocean Territory" http://www.io.kernel.org
-"British Indian Ocean Territory" ftp://ftp.io.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
-"Burkina Faso" http://www.bf.kernel.org
-"Burkina Faso" ftp://ftp.bf.kernel.org
-Burundi http://www.bi.kernel.org
-Burundi ftp://ftp.bi.kernel.org
-Cambodia http://www.kh.kernel.org
-Cambodia ftp://ftp.kh.kernel.org
-Cameroon http://www.cm.kernel.org
-Cameroon ftp://ftp.cm.kernel.org
-Canada http://www.ca.kernel.org
+Bulgaria http://www.bg.kernel.org
Canada ftp://ftp.ca.kernel.org
-"Canary Islands" http://www.ic.kernel.org
-"Canary Islands" ftp://ftp.ic.kernel.org
-"Cape Verde" http://www.cv.kernel.org
-"Cape Verde" ftp://ftp.cv.kernel.org
-"Cayman Islands" http://www.ky.kernel.org
-"Cayman Islands" ftp://ftp.ky.kernel.org
-"Central African Republic" http://www.cf.kernel.org
-"Central African Republic" ftp://ftp.cf.kernel.org
-"Ceuta, Melilla" http://www.ea.kernel.org
-"Ceuta, Melilla" ftp://ftp.ea.kernel.org
-Chad http://www.td.kernel.org
-Chad ftp://ftp.td.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
-"Christmas Island" http://www.cx.kernel.org
-"Christmas Island" ftp://ftp.cx.kernel.org
-"Clipperton Island" http://www.cp.kernel.org
-"Clipperton Island" ftp://ftp.cp.kernel.org
-"Cocos (Keeling) Islands" http://www.cc.kernel.org
-"Cocos (Keeling) Islands" ftp://ftp.cc.kernel.org
-Colombia http://www.co.kernel.org
+China http://www.cn.kernel.org
Colombia ftp://ftp.co.kernel.org
-Comoros http://www.km.kernel.org
-Comoros ftp://ftp.km.kernel.org
-"Congo, Republic of" http://www.cg.kernel.org
-"Congo, Republic of" ftp://ftp.cg.kernel.org
-"Congo, Democratic Republic of The" http://www.cd.kernel.org
-"Congo, Democratic Republic of The" ftp://ftp.cd.kernel.org
-"Cook Islands" http://www.ck.kernel.org
-"Cook Islands" ftp://ftp.ck.kernel.org
-"Costa Rica" http://www.cr.kernel.org
-"Costa Rica" ftp://ftp.cr.kernel.org
-"Co^te DIvoire" http://www.ci.kernel.org
-"Co^te DIvoire" ftp://ftp.ci.kernel.org
-Croatia http://www.hr.kernel.org
+Colombia http://www.co.kernel.org
Croatia ftp://ftp.hr.kernel.org
-Cyprus http://www.cy.kernel.org
-Cyprus ftp://ftp.cy.kernel.org
-"Czech Republic" http://www.cz.kernel.org
-"Czech Republic" ftp://ftp.cz.kernel.org
-Denmark http://www.dk.kernel.org
-Denmark ftp://ftp.dk.kernel.org
-"Diego Garcia" http://www.dg.kernel.org
-"Diego Garcia" ftp://ftp.dg.kernel.org
-Djibouti http://www.dj.kernel.org
-Djibouti ftp://ftp.dj.kernel.org
+Croatia http://www.hr.kernel.org
Dominica http://www.dm.kernel.org
-Dominica ftp://ftp.dm.kernel.org
-"Dominican Republic" http://www.do.kernel.org
-"Dominican Republic" ftp://ftp.do.kernel.org
-"East Timor" http://www.tp.kernel.org
-"East Timor" ftp://ftp.tp.kernel.org
-Ecuador http://www.ec.kernel.org
Ecuador ftp://ftp.ec.kernel.org
-Egypt http://www.eg.kernel.org
-Egypt ftp://ftp.eg.kernel.org
-"El Salvador" http://www.sv.kernel.org
-"El Salvador" ftp://ftp.sv.kernel.org
-"Equatorial Guinea" http://www.gq.kernel.org
-"Equatorial Guinea" ftp://ftp.gq.kernel.org
-Eritrea http://www.er.kernel.org
-Eritrea ftp://ftp.er.kernel.org
-Estonia http://www.ee.kernel.org
+Ecuador http://www.ec.kernel.org
Estonia ftp://ftp.ee.kernel.org
-Ethiopia http://www.et.kernel.org
-Ethiopia ftp://ftp.et.kernel.org
-"Falkland Islands (Malvinas)" http://www.fk.kernel.org
-"Falkland Islands (Malvinas)" ftp://ftp.fk.kernel.org
-"Faroe Islands" http://www.fo.kernel.org
-"Faroe Islands" ftp://ftp.fo.kernel.org
-Fiji http://www.fj.kernel.org
-Fiji ftp://ftp.fj.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
-France http://www.tengu-easynet-fr.lkams.kernel.org/pub/linux
-France http://www.numericable.lkams.kernel.org/pub/linux
-France ftp://ftp.ovh-new.lkams.kernel.org/pub/linux
-France ftp://ftp.minet-fr.lkams.kernel.org/pub/linux
-France
ftp://ftp.proxad.lkams.kernel.org/mirrors/ftp.kernel.org/linux/kernel
-France ftp://ftp.numericable.lkams.kernel.org/pub/linux
-"French Guiana" http://www.gf.kernel.org
-"French Guiana" ftp://ftp.gf.kernel.org
-"French Polynesia" http://www.pf.kernel.org
-"French Polynesia" ftp://ftp.pf.kernel.org
-"French Southern Territories" http://www.tf.kernel.org
-"French Southern Territories" ftp://ftp.tf.kernel.org
-Gabon http://www.ga.kernel.org
-Gabon ftp://ftp.ga.kernel.org
-Gambia http://www.gm.kernel.org
-Gambia ftp://ftp.gm.kernel.org
-Georgia http://www.ge.kernel.org
-Georgia ftp://ftp.ge.kernel.org
-Germany http://www.de.kernel.org
+France http://www.fr.kernel.org
Germany ftp://ftp.de.kernel.org
-Ghana http://www.gh.kernel.org
-Ghana ftp://ftp.gh.kernel.org
-Gibraltar http://www.gi.kernel.org
-Gibraltar ftp://ftp.gi.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
-Grenada ftp://ftp.gd.kernel.org
Guadeloupe http://www.gp.kernel.org
-Guadeloupe ftp://ftp.gp.kernel.org
-Guam http://www.gu.kernel.org
-Guam ftp://ftp.gu.kernel.org
Guatemala http://www.gt.kernel.org
-Guatemala ftp://ftp.gt.kernel.org
-Guernsey http://www.gg.kernel.org
-Guernsey ftp://ftp.gg.kernel.org
-Guinea http://www.gn.kernel.org
-Guinea ftp://ftp.gn.kernel.org
-Guinea-Bissau http://www.gw.kernel.org
-Guinea-Bissau ftp://ftp.gw.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
-Haiti ftp://ftp.ht.kernel.org
-"Heard and Mc Donald Islands" http://www.hm.kernel.org
-"Heard and Mc Donald Islands" ftp://ftp.hm.kernel.org
Honduras http://www.hn.kernel.org
-Honduras ftp://ftp.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
-India http://www.in.kernel.org
-India ftp://ftp.in.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
-"Isle of Man" http://www.im.kernel.org
-"Isle of Man" ftp://ftp.im.kernel.org
+Ireland http://www.ie.kernel.org
Israel http://www.il.kernel.org
-Israel ftp://ftp.il.kernel.org
-Italy http://www.it.kernel.org
Italy ftp://ftp.it.kernel.org
-Jamaica http://www.jm.kernel.org
-Jamaica ftp://ftp.jm.kernel.org
+Italy http://www.it.kernel.org
Japan http://www.jp.kernel.org
-Japan ftp://ftp.jp.kernel.org
-Jersey http://www.je.kernel.org
-Jersey ftp://ftp.je.kernel.org
-Jordan http://www.jo.kernel.org
-Jordan ftp://ftp.jo.kernel.org
-Kazakhstan http://www.kz.kernel.org
Kazakhstan ftp://ftp.kz.kernel.org
-Kenya http://www.ke.kernel.org
-Kenya ftp://ftp.ke.kernel.org
-Kiribati http://www.ki.kernel.org
-Kiribati ftp://ftp.ki.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
-Laos http://www.la.kernel.org
-Laos ftp://ftp.la.kernel.org
-Latvia http://www.lv.kernel.org
+Kyrgyzstan http://www.kg.kernel.org
Latvia ftp://ftp.lv.kernel.org
-Lebanon http://www.lb.kernel.org
-Lebanon ftp://ftp.lb.kernel.org
-Lesotho http://www.ls.kernel.org
-Lesotho ftp://ftp.ls.kernel.org
-Liberia http://www.lr.kernel.org
-Liberia ftp://ftp.lr.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
-Macau http://www.mo.kernel.org
-Macau ftp://ftp.mo.kernel.org
-Macedonia http://www.mk.kernel.org
-Macedonia ftp://ftp.mk.kernel.org
-Madagascar http://www.mg.kernel.org
-Madagascar ftp://ftp.mg.kernel.org
-Malawi http://www.mw.kernel.org
-Malawi ftp://ftp.mw.kernel.org
-Malaysia http://www.my.kernel.org
+Luxembourg http://www.lu.kernel.org
Malaysia ftp://ftp.my.kernel.org
-Maldives http://www.mv.kernel.org
-Maldives ftp://ftp.mv.kernel.org
-Mali http://www.ml.kernel.org
-Mali ftp://ftp.ml.kernel.org
-Malta http://www.mt.kernel.org
-Malta ftp://ftp.mt.kernel.org
-"Marshall Islands" http://www.mh.kernel.org
-"Marshall Islands" ftp://ftp.mh.kernel.org
+Malaysia http://www.my.kernel.org
Martinique http://www.mq.kernel.org
-Martinique ftp://ftp.mq.kernel.org
-Mauritania http://www.mr.kernel.org
-Mauritania ftp://ftp.mr.kernel.org
-Mauritius http://www.mu.kernel.org
-Mauritius ftp://ftp.mu.kernel.org
-Mayotte http://www.yt.kernel.org
-Mayotte ftp://ftp.yt.kernel.org
Mexico http://www.mx.kernel.org
-Mexico ftp://ftp.mx.kernel.org
-"Micronesia, Federated States of" http://www.fm.kernel.org
-"Micronesia, Federated States of" ftp://ftp.fm.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
-Mongolia http://www.mn.kernel.org
-Mongolia ftp://ftp.mn.kernel.org
-Montserrat http://www.ms.kernel.org
-Montserrat ftp://ftp.ms.kernel.org
-Morocco http://www.ma.kernel.org
-Morocco ftp://ftp.ma.kernel.org
-Mozambique http://www.mz.kernel.org
-Mozambique ftp://ftp.mz.kernel.org
-"Myanmar (Burma)" http://www.mm.kernel.org
-"Myanmar (Burma)" ftp://ftp.mm.kernel.org
-Namibia http://www.na.kernel.org
-Namibia ftp://ftp.na.kernel.org
-Nauru http://www.nr.kernel.org
-Nauru ftp://ftp.nr.kernel.org
-Nepal http://www.np.kernel.org
-Nepal ftp://ftp.np.kernel.org
-Netherlands http://www.nl.kernel.org
+Monaco http://www.mc.kernel.org
Netherlands ftp://ftp.nl.kernel.org
-"Netherlands Antilles" http://www.an.kernel.org
-"Netherlands Antilles" ftp://ftp.an.kernel.org
-"New Caledonia" http://www.nc.kernel.org
-"New Caledonia" ftp://ftp.nc.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
-Nicaragua ftp://ftp.ni.kernel.org
-Niger http://www.ne.kernel.org
-Niger ftp://ftp.ne.kernel.org
-Nigeria http://www.ng.kernel.org
-Nigeria ftp://ftp.ng.kernel.org
-Niue http://www.nu.kernel.org
-Niue ftp://ftp.nu.kernel.org
-"Norfolk Island" http://www.nf.kernel.org
-"Norfolk Island" ftp://ftp.nf.kernel.org
-"Northern Mariana Islands" http://www.mp.kernel.org
-"Northern Mariana Islands" ftp://ftp.mp.kernel.org
-Norway http://www.no.kernel.org
Norway ftp://ftp.no.kernel.org
-Oman http://www.om.kernel.org
-Oman ftp://ftp.om.kernel.org
-Pakistan http://www.pk.kernel.org
+Norway http://www.no.kernel.org
Pakistan ftp://ftp.pk.kernel.org
-Palau http://www.pw.kernel.org
-Palau ftp://ftp.pw.kernel.org
-"Palestinian Territory" http://www.ps.kernel.org
-"Palestinian Territory" ftp://ftp.ps.kernel.org
+Pakistan http://www.pk.kernel.org
Panama http://www.pa.kernel.org
-Panama ftp://ftp.pa.kernel.org
-"Papua New Guinea" http://www.py.kernel.org
-"Papua New Guinea" ftp://ftp.py.kernel.org
-Paraguay http://www.py.kernel.org
Paraguay ftp://ftp.py.kernel.org
-Peru http://www.pe.kernel.org
+Paraguay http://www.py.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
-"Pitcairn Islands" http://www.pn.kernel.org
-"Pitcairn Islands" ftp://ftp.pn.kernel.org
-Poland http://www.pl.kernel.org
+Philippines http://www.ph.kernel.org
Poland ftp://ftp.pl.kernel.org
-Portugal http://www.pt.kernel.org
-Portugal ftp://ftp.pt.kernel.org
-"Puerto Rico" http://www.pr.kernel.org
-"Puerto Rico" ftp://ftp.pr.kernel.org
-Qatar http://www.qa.kernel.org
-Qatar ftp://ftp.qa.kernel.org
-Reunion http://www.re.kernel.org
-Reunion ftp://ftp.re.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
-Rwanda http://www.rw.kernel.org
-Rwanda ftp://ftp.rw.kernel.org
-"Saint Helena" http://www.sh.kernel.org
-"Saint Helena" ftp://ftp.sh.kernel.org
-"Saint Kitts and Nevis" http://www.kn.kernel.org
-"Saint Kitts and Nevis" ftp://ftp.kn.kernel.org
-"Saint Lucia" http://www.lc.kernel.org
-"Saint Lucia" ftp://ftp.lc.kernel.org
-"Saint Pierre and Miquelon" http://www.pm.kernel.org
-"Saint Pierre and Miquelon" ftp://ftp.pm.kernel.org
-"Saint Vincent and The Grenadines" http://www.vc.kernel.org
-"Saint Vincent and The Grenadines" ftp://ftp.vc.kernel.org
-Samoa http://www.ws.kernel.org
-Samoa ftp://ftp.ws.kernel.org
-"San Marino" http://www.sm.kernel.org
-"San Marino" ftp://ftp.sm.kernel.org
-"Sa~o Tome and Principe" http://www.st.kernel.org
-"Sa~o Tome and Principe" ftp://ftp.st.kernel.org
-"Saudi Arabia" http://www.sa.kernel.org
-"Saudi Arabia" ftp://ftp.sa.kernel.org
-Senegal http://www.sn.kernel.org
-Senegal ftp://ftp.sn.kernel.org
-Seychelles http://www.sc.kernel.org
-Seychelles ftp://ftp.sc.kernel.org
-"Sierra Leone" http://www.sl.kernel.org
-"Sierra Leone" ftp://ftp.sl.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
-"Solomon Islands" http://www.sb.kernel.org
-"Solomon Islands" ftp://ftp.sb.kernel.org
-Somalia http://www.so.kernel.org
-Somalia ftp://ftp.so.kernel.org
-"South Africa" http://www.za.kernel.org
-"South Africa" ftp://ftp.za.kernel.org
-"South Georgia and The South Sandwich Islands" http://www.gs.kernel.org
-"South Georgia and The South Sandwich Islands" ftp://ftp.gs.kernel.org
-Spain http://www.es.kernel.org
+Slovenia http://www.si.kernel.org
Spain ftp://ftp.es.kernel.org
-"Sri Lanka" http://www.lk.kernel.org
-"Sri Lanka" ftp://ftp.lk.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
-Swaziland http://www.sz.kernel.org
-Swaziland ftp://ftp.sz.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
-Taiwan http://www.tw.kernel.org
-Taiwan ftp://ftp.tw.kernel.org
-Tajikistan http://www.tj.kernel.org
-Tajikistan ftp://ftp.tj.kernel.org
-Tanzania http://www.tz.kernel.org
-Tanzania ftp://ftp.tz.kernel.org
+Switzerland http://www.ch.kernel.org
Thailand http://www.th.kernel.org
-Thailand ftp://ftp.th.kernel.org
-Togo http://www.tg.kernel.org
-Togo ftp://ftp.tg.kernel.org
-Tokelau http://www.tk.kernel.org
-Tokelau ftp://ftp.tk.kernel.org
-Tonga http://www.to.kernel.org
-Tonga ftp://ftp.to.kernel.org
-"Trinidad and Tobago" http://www.ta.kernel.org
-"Trinidad and Tobago" ftp://ftp.ta.kernel.org
-Tunisia http://www.tn.kernel.org
-Tunisia ftp://ftp.tn.kernel.org
-Turkey http://www.tr.kernel.org
-Turkey ftp://ftp.tr.kernel.org
-Turkmenistan http://www.tm.kernel.org
Turkmenistan ftp://ftp.tm.kernel.org
-"Turks and Caicos Islands" http://www.tc.kernel.org
-"Turks and Caicos Islands" ftp://ftp.tc.kernel.org
-Tuvalu http://www.tv.kernel.org
-Tuvalu ftp://ftp.tv.kernel.org
-Uganda http://www.ug.kernel.org
-Uganda ftp://ftp.ug.kernel.org
-Ukraine http://www.ua.kernel.org
-Ukraine ftp://ftp.ua.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
-Uzbekistan http://www.uz.kernel.org
-Uzbekistan ftp://ftp.uz.kernel.org
-Vanuatu http://www.vu.kernel.org
-Vanuatu ftp://ftp.vu.kernel.org
-"Vatican City (Holy See)" http://www.va.kernel.org
-"Vatican City (Holy See)" ftp://ftp.va.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
-"Wallis and Futuna Islands" http://www.wf.kernel.org
-"Wallis and Futuna Islands" ftp://ftp.wf.kernel.org
-"Western Sahara" http://www.eh.kernel.org
-"Western Sahara" ftp://ftp.eh.kernel.org
-Yemen http://www.ye.kernel.org
-Yemen ftp://ftp.ye.kernel.org
-Yugoslavia http://www.yu.kernel.org
-Yugoslavia ftp://ftp.yu.kernel.org
-Zambia http://www.zm.kernel.org
-Zambia ftp://ftp.zm.kernel.org
-Zimbabwe http://www.zw.kernel.org
-Zimbabwe ftp://ftp.zw.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/state b/etc/sorcery/state
index 8b47938..01499cb 100755
--- a/etc/sorcery/state
+++ b/etc/sorcery/state
@@ -14,6 +14,7 @@
STATE_DIRECTORY=${STATE_ROOT}/var/state/sorcery
TABLET_PATH=${STATE_DIRECTORY}/tablet
DEPENDS_STATUS=${STATE_DIRECTORY}/depends
+ SUB_DEPENDS_STATUS=${STATE_DIRECTORY}/sub_depends
DEFAULT_DEPENDS=${STATE_DIRECTORY}/default_depends
DEFAULT_PROVIDERS=${STATE_DIRECTORY}/default_providers
UNCOMMITTED_DEPENDS=${STATE_DIRECTORY}/uncommitted
@@ -38,6 +39,7 @@ mkdir -p $LOG_DIRECTORY/md5sum &>/dev/null
mkdir -p $LOG_DIRECTORY/install &>/dev/null
mkdir -p $DEPENDS_CONFIG &>/dev/null
mkdir -p $INSTALL_CACHE &>/dev/null
+touch $SUB_DEPENDS_STATUS $DEPENDS_STATUS &>/dev/null

# I dont want to support reconfigurable state file locations, do not
# allow sourcing of a local one (2004-9-30 afk)
diff --git a/etc/sorcery/version b/etc/sorcery/version
index 21de374..850e742 100644
--- a/etc/sorcery/version
+++ b/etc/sorcery/version
@@ -1 +1 @@
-1.13.8-rc8
+1.14.0
diff --git a/old-changelogs/ChangeLog-1.13 b/old-changelogs/ChangeLog-1.13
new file mode 100644
index 0000000..9988c64
--- /dev/null
+++ b/old-changelogs/ChangeLog-1.13
@@ -0,0 +1,733 @@
+2005-09-24 Andrew Stitt <astitt AT sourcemage.org>
+ * libtriggers: check for triggers file before trying to look at it
+ * libdepends: Add message for up_triggers (bug 9827)
+
+2005-09-22 Andrew Stitt <astitt AT sourcemage.org>
+ * gaze: add a --fast parameter to gaze depends to make it run quicker
+ * man1/gaze.1: update documentation for gaze depends
+ * libdepends: silence touch command
+
+2005-09-22 Andrew Stitt <astitt AT sourcemage.org>
+ * libsorcery: fix path to ChangeLog, bug 9787
+ * liburl: fix bug 9789, preserve spell defined order of urls
+ also change the maximum number of urls to 10, 20 seems excessive
+ * url_handlers/url_http: Dont include "Custom" url in url expansion
+
+2005-09-22 Andrew Stitt <astitt AT sourcemage.org>
+ * libmisc: add functionality to look in abandoned persistency dir for
+ old answers after a cast -r. (bug 7488)
+ * etc/sorcery/state: add an entry for the abandoned persistency dir
+ * build_api/common: expunge stale abandoned persistency data on
+ successful cast.
+
+2005-09-22 David Brown <dmlb2000 AT gmail.com>
+ * libapi: added persistent_read function see header for description
+ * libmisc: added real_persistent_read function bug #8539
+ * libtablet: added tablet_get_persistent_config as part of bug #8539
+ returns the absolute path to the spell persistent config file
+ removed the tablet_find_spell_file no one uses it.
+
+2005-09-19 Andrew Stitt <astitt AT sourcemage.org>
+ * libcrossinstall: Update file header.
+ * libmisc: Add some missing function headers. Remove unused
+ parent_PIDs function, found no trace of usage as far back as 1.8.
+ * libtrack: Add missing function header.
+ * libdepends: Remove unused satisfy_depends function.
+
+2005-09-19 Eric Sandall <eric AT sandall.us>
+ * sorcery: Removed work marker
+
+2005-09-19 Andrew Stitt <astitt AT sourcemage.org>
+ * delve: fix usage message
+
+2005-09-17 Andrew Stitt <astitt AT sourcemage.org>
+ * cast: make cast -B work again
+
+2005-09-10 Andrew Stitt <astitt AT sourcemage.org>
+ * gaze: add --no-optionals flag to gaze dependencies (bug 9708)
+ * man1/gaze.1: updated documentation to mention -c and
+ --no-optionals flag to gaze dependencies
+
+2005-09-10 Andrew Stitt <astitt AT sourcemage.org>
+ * dl_wget: remove file before trying to download it (bug 9749)
+
+2005-09-10 Andrew Stitt <astitt AT sourcemage.org>
+ * scribe: fix bug 8220, verify rsync tree downloads. Factored
+ common code out of scribe_add_worker and scribe_do_update,
+ merged result together to reduce redundant redundancy :-).
+ * libgpg: Add routines for downloading manifest and manifest
+ signature, then verifying tree based on manifest.
+ * etc/sorcery/url: add more variables for rsync and manifest urls
+ * config: add a variable for the manifest algorithm
+ * dl_rsync: fix progress/spinner issues
+ * man8/scribe.8: document scribe add from rsync bug 8609
+ * scribe: Added messages for what the official grimoire urls are
+ (bug 9701).
+
+2005-09-10 Andrew Stitt <astitt AT sourcemage.org>
+ * libgpg: replace call to which with call to smgl_which (bug 9752)
+ * build_api/common: use $INSTALL_ROOT in install_pam_confs (bug 9750)
+
+2005-09-10 Andrew Stitt <astitt AT sourcemage.org>
+ * libgpg: add some new functions for hashes
+ * libunpack: use gpg for higher hashes instead of hashsum
+ * sorcery: factor code for getting current hash algorithms into
+ libgpg and call the new function.
+
+2005-09-09 Andrew Stitt <astitt AT sourcemage.org>
+ * cast: remove some code left-over from a previous attempt at
+ triggers and was accidentally commited (oops, brown-bag time).
+
+2005-09-08 Andrew Stitt <astitt AT sourcemage.org>
+ * config: add default values for init/xinetd queries
+ * sorcery: add yet another menu, users can set the default values
+ of init.d and xinetd service installation (bug 8532)
+ * libcast: integrate menu selectable defaults with init/xinetd queries
+
+2005-09-07 Andrew Stitt <astitt AT sourcemage.org>
+ * libsorcery: make cleanse --sweep use edit_file() instead of $EDITOR
+
+2005-09-05 Andrew Stitt <astitt AT sourcemage.org>
+ * cast: make -d imply -c, bug 9624
+
+2005-09-05 Andrew Stitt <astitt AT sourcemage.org>
+ * libdepends: add some more debugging info to
+ private_common_depends, add another output message for when an
+ optional depends exists, but is disabled
+
+2005-09-05 David Brown <dmlb2000 AT gmail.com>
+ * libsorcery: changed out hard coded run compiler dir for an env var
+ * compile_config: added RUN_COMPILER_DIR for where the run_compiler
+ script is located
+
+2005-09-05 David Brown <dmlb2000 AT gmail.com>
+ * libunpack: added function comment headers (sucky ones probably) and
+ removed tabs for 8 spaces removed redundant else statement in
+ is_allowed_hash
+ * sorcery: removed tabs for 8 spaces
+ * libgpg: removed tabs for 8 spaces
+
+2005-09-04 Andrew Stitt <astitt AT sourcemage.org>
+ * libtablet: add quotes on iterate calls, bug 9707
+
+2005-09-04 David Brown <dmlb2000 AT gmail.com>
+ * config: added allow new hashes
+ * sorcery: added option for allowing new hashes
+ * libunpack: added unpack_file_user_query, added hash_user_query to
call
+ unpack_file_user_query
+ * libgpg: modified gpg_user_query to call unpack_file_user_query on a
+ spell and reverted gpg_verify_signature to set the envar $4
+
+2005-09-03 Andrew Stitt <astitt AT sourcemage.org>
+ * protected: avoid a rare race by protecting wget, its in basesystem
+ so it ought not be removed anyway. This can be taken out if/when
+ the download code and cast wget agree to lock wget.
+
+2005-09-03 Andrew Stitt <astitt AT sourcemage.org>
+ * config: remove PROTECT_SORCERY flag, it actually isnt needed,
+ it already gets set where appropriate.
+ * libapi: add up_triggers to be used in experimental UP_TRIGGERS file
+ * libdepends, libdepengine: Fix up support for run_script trigger
+ * libdepends: add support for UP_TRIGGERS file
+ * libhash: Add support for fields with spaces in their names
+ make hash_get echo with quotes, this keeps newlines from getting
+ reparsed as spaces
+ * libtriggers: add a function to get the informative data from a
+ run_script trigger.
+
+2005-09-03 Andrew Stitt <astitt AT sourcemage.org>
+ * libmisc: remove cache_env and restore_env. they are unused
+
+2005-09-02 David Brown <dmlb2000 AT gmail.com>
+ * libunpack: added some extra checks and messages for checking gpg
+ keys and added the integrety checking levels (bug #9515)
+ * sorcery: added the menus for bug #9515
+ * libgpg: added the spell switch for $3 and made it act like hash
+ failure
+
+2005-08-31 Andrew Stitt <astitt AT sourcemage.org>
+ * libmisc: don't complain about sorcery var's during
+ persistent_load bug 9416. fix apparently incomplete on/off
+ switch for sorcery var complaining
+
+2005-08-31 Andrew Stitt <astitt AT sourcemage.org>
+ * libdepengine: Addition of new library, this module handles
+ walking the merged dependency and trigger tree, it replaces make.
+ * cast: remove make specific code.
+ * build_api/common: remove run_triggers function, put it in
libtriggers
+ * libapi, libmisc, cast: remove RM_AT_END, its obsolesced by $TMP_DIR
+ * libdepends: add support for importing trigger information
+ during dependency resolution.
+ * libcast: dont remove download log and download completion
+ sentinal, otherwise if a spell is cast twice from a
+ depends/trigger cycle it will hang forever.
+ * libhash: add support for hashing keys with colons.
+ * libtriggers: Break trigger execution out into another
+ function. Add function to get triggerees.
+
+2005-08-30 David Brown <dmlb2000 AT gmail.com>
+ * etc/sorcery/config: added enumeration for spells to use
+ * usr/sbin/sorcery: made dialogs work
+
+2005-08-29 Andrew Stitt <astitt AT sourcemage.org>
+ * libgpg: fix use of list_find
+
+2005-08-28 David Brown <dmlb2000 AT gmail.com>
+ * libgpg: gpg_user_query fixed grimoire checking to be a little easier
+ to add/remove gpg signed grimoires
+ * config: added GPG_GRIMOIRE_LIST with a default set of gpg signed
+ grimoires
+
+2005-08-28 David Brown <dmlb2000 AT gmail.com>
+ * etc/sorcery/config: added GPG_VERIFY_SPELL_LEVEL default to level 0
+ and added GPG_ALLOWED_HASHES sentinal value is "" same as allow all
+ and added GPG_MAX_LEVEL so we can add more by changing the config
+ * var/lib/sorcery/libgpg: removed message from gpg_verify_signature
+ it now outputs the algorithm used to create the gpg signature
+ * var/lib/sorcery/libunpack: added path message from libgpg to here
made
+ variables local and added a few preliminary vars for use later
+ * usr/sbin/sorcery: added some of the initial menu stuff
+
+2005-08-26 Eric Sandall <eric AT sandall.us>
+ * usr/sbin/gaze: Have gaze pick the first file returned by ./find for
+ `gaze voyeur` (Bug #9632)
+
+2005-08-26 David Brown <dmlb2000 AT gmail.com>
+ * libunpack: bug 9625 changed cut to just pull the second field not
+ everything after and including the second field
+
+2005-08-26 Andrew Stitt <astitt AT sourcemage.org>
+ * cast: get rid of notorious '60' file
+
+2005-08-25 Andrew Stitt <astitt AT sourcemage.org>
+ * libunpack: yse SOURCEn_GPG[m] instead of SOURCEn_GPGm
+ remove useless eval
+
+2005-08-25 David Brown <dmlb2000 AT gmail.com>
+ * libunpack: added comment in real_unpack_file about SOURCEn_*m vs.
+ SOURCEn_*[m] confusion might end up ripping this out because of that
+
+2005-08-24 Andrew Stitt <astitt AT sourcemage.org>
+ * scribe: add local rc to scribe_do_update, bug 9555
+ * delve: fix bug 9566, any non-zero return value is failure
+
+2005-08-22 Andrew Stitt <astitt AT sourcemage.org>
+ * libdispel: handle case of removing a spell that no longer
+ exists, bug 9462
+ * libinitd: mkdir /etc/sysconfig before trying to use stuff in
+ it, bug 9509.
+
+2005-08-14 David Brown <dmlb2000 AT gmail.com>
+ * var/lib/sorcery/modules/libapi: removed requires deprecated for good
+
+2005-08-14 Karsten Behrmann <BearPerson AT sourcemage.org>
+ * cast, man8/cast.8: updated docs for --deps
+
+2005-07-30 Andrew Stitt <astitt AT sourcemage.org>
+ * liburl: some performance adjustments for bug 9391, made
+ url_expand_urls work more effectively, enhanced url_get_prefix
+ to use bash only per suggestion from David Brown. Shorten the
+ list of urls to a max of 20 so as to not totally slow down
+ subsequent code.
+ * url_default: slightly faster default validation and cracking
+ routines. Avoid forking where possible.
+
+2005-07-30 Andrew Stitt <astitt AT sourcemage.org>
+ * This change includes updates to the downloading code, it resolves
bugs
+ 8209, 8150, 8993. It also makes several other enhancements
+ more feasable and removes a number of layering issues.
+ * libapi: Add acquire_src and download_src for download
+ * libgpg: Minor updates for new api
+ * liblock: Add a simple counter api
+ * libmisc: Add function to get the SOURCE suffixes for a spell,
+ add a function see if a command is a function
+ * libsorcery: Minor updates for new api, remove INSTALL_ROOT
+ from update code
+ * libsummon: Call new downloading api, deal with packaging and
+ repackaging of cvs/svn/etc. checkouts.
+ * libunpack: Add a function for simple unpacking
+ * liburl: Update for new downloading scheme
+ * url_handlers/*: Update to new scheme, code for downloading
+ branched to download handlers, update to new api set, add
+ url_default to provide overridable defaults. Code for unpacking
+ and repackaging of tarballs branched over to libsummon.
+ * modules/dl_handlers/*: All downloading code from url_handlers
+ branched here.
+ * libdownload: Repurposed as a frontend for download handlers,
+ now run by liburl
+ * url_handlers/url_tla, url_handlers/url_smgl_tla: delete,
+ branch, using new url prefix for smgl's custom tla url scheme
+ so as not to conflict with future tla:// urls.
+ * cast: api update call summon_spell instead of summon_spells
+ * gaze: Updates for new grimoire files
+ * scribe: Update for new api, add code for handling rsync/tree
+ type adds/updates
+ * summon: Updates for new api, move summon_spells here, fix raw
+ mode to use new functions.
+ * uninstall: Simple nitpick updates
+ * etc/sorcery/url: Move hardcoded internet interfaces list and
+ pon/poff calls into overridable variables here. Add an obvious
+ way to switch over to grimoires from rsync.
+
+2005-07-30 Paul Mahon <pmahon AT sourcemage.org>
+ * libmisc, libsorcery: Create variable to hold generic compatable
+ architectures (bug 9078)
+
+2005-07-24 Andrew Stitt <astitt AT sourcemage.org>
+ * mirrors/APACHE: remove dead mirror, bug 9337
+ * solo: delete, all solo spells have their own SOLO file, bug 9110
+ * cast: dont grep solo file if it does not exist
+
+2005-07-23 Andrew Stitt <astitt AT sourcemage.org>
+ * libcast: start handling 'default providers' again in the init system
+ add warnings about ESSENTIAL and RECOMMENDED init scripts
+ * libinitd: update default provider query to work on
+ a (persistent) variable not in the $SPELL_CONFIG, check for
+ modified sysconfig file, remove code for enforcing ESSENTIAL
+ init scripts, that is handled in libcast
+ * libresurrect: fix several bugs: Don't remove the log files,
+ they're still needed for config file checking and reaping old
+ files. Fix bugs with removing leftover config files.
+ * libtrack: Add a way to check and mark files as modified.
+
+2005-07-21 Paul Mahon <pmahon AT sourcemage.org>
+ * api1, api2: Check that SCREEN==on before doing screen stuff (bug
9302)
+ * cast: Make sure screen message is only printed once (bug 9293)
+
+2005-07-19 Andrew Stitt <astitt AT sourcemage.org>
+ * libcodex: Add an additional variable for GRIMOIRE_NAME since
+ basename $GRIMOIRE isn't always the grimoire name.
+ * gaze: use GRIMOIRE_NAME where appropriate instead of basename
+ $GRIMOIRE
+
+2005-07-18 Maurizio Boriani <baux AT sourcemage.org>
+ * url_tla: Fix minor grep bug over archive name and cosmetic clean up.
+
+2005-07-18 Andrew Stitt <astitt AT sourcemage.org>
+ * libunpack: propagate return code properly if verification fails
+
+2005-07-16 Andrew Stitt <astitt AT sourcemage.org>
+ * libtablet: add new accessor functions for grimoire and section
filters
+ * libsorcery: expand filter_generic to look at grimoire and
+ section filters
+ * libresurrect: fix to use new tablet api
+
+2005-07-16 Maurizio Boriani <baux AT sourcemage.org>
+ * url_tla: Fix tla binary exist test and test if tla archive
+ is already registered before doing so.
+
+2005-07-16 Paul Mahon <pmahon AT sourcemage.org>
+ * libscreen, config, cast,sorcery: Addition of screen lib and
+ integration of screen into cast
+
+2005-07-09 Karsten Behrmann <BearPerson AT sourcemage.org>
+ * url_http: Carry wget exit status past variable assignment
+
+2005-07-09 Andrew Stitt <astitt AT sourcemage.org>
+ * libunpack: GRIMOIRE_DIRECTORY -> GRIMOIRE,bug 9191, thanks dmlb2000.
+
+2005-07-07 Andrew Stitt <astitt AT sourcemage.org>
+ * libsorcery: set SCRIPT_DIRECTORY in codex_set_current_spell_quick
+
+2005-07-02 Paul Mahon <pmahon AT sourcemage.org>
+ * libmisc: addition of define_function
+ * gaze: fix bug 9150, redefine functions that should be used in
DEPENDS
+
+2005-06-27 David Brown <dmlb2000 AT excite.com>
+ * libunpack: line 142 removed extra quotes around the $GPGNUM
+
+2005-06-04 Andrew Stitt <astitt AT sourcemage.org>
+ * libmisc: update documentation for real_query(), bug 8931
+ used patch from Ondra Tomecka.
+
+2005-06-04 Andrew Stitt <astitt AT sourcemage.org>
+ * sorcery, man/man8/sorcery.8: finish documentation for bug 8322
+ use patch from Ondra Tomecka.
+
+2005-06-04 Andrew Stitt <astitt AT sourcemage.org>
+ * cleanse: make cleanse --prune use cast -c instead of regular cast
+ bug 9035
+
+2005-06-04 Andrew Stitt <astitt AT sourcemage.org>
+ * dispel: fix dispel_children to properly pass back dispelled children
+ bug 9044
+
+2005-06-01 Andrew Stitt <astitt AT sourcemage.org>
+ * libdepends: fix show_depends to call iterate properly
+
+2005-05-30 Andrew Stitt <astitt AT sourcemage.org>
+ * libresurrect: fix an issue caused when resurrecting something
+ with symlinks to a directory.
+
+2005-05-30 Andrew Stitt <astitt AT sourcemage.org>
+ * /etc/sorcery/config: add default values for dependency following
+ defaults.
+ * install: remove improperly installed sorcery manuals in /usr/man/
+ * dispel: add dependenc following support, fixes bugs 5259 and 5634.
+ * sorcery: add call to menu for user dependency following defaults
+ * man8/dispel.8: update with info on dependency following
+ * libdispel: Add dependency following default menus, a few minor
+ updates to dispel_spell
+ * libmisc: Use regular grep, not grep -E in list_find, -E makes
+ it too hard to put spells (things with + characters in the name)
+ in lists, unit tests pass.
+ * libstate: Dont esc_str depends values in remove_depends_status
+ since I think they aren't needed, unit tests pass.
+
+2005-05-30 Paul Mahon <pmahon AT sourcemage.org>
+ * gaze: add compact mode to prevent loops
+
+2005-05-29 Seth Woolley <seth AT tautology.org>
+ * libinitd: be sure to track unmodified init.d installs and when
+ /etc/sysconfig/init doesn't exist, use a sane value of
+ RUNLEVELS_DIR.
+
+2005-05-27 Andrew Stitt <astitt AT sourcemage.org>
+ * libstate: Fix bug 8990, get_spell_provider doesnt always work.
+
+2005-05-23 Andrew Stitt <astitt AT sourcemage.org>
+ * libhash: fix variable name typo in hash_reset
+
+2005-05-23 Andrew Stitt <astitt AT sourcemage.org>
+ * scribe: keep track of return code in scribe update, bug 8859
+
+2005-05-23 Andrew Stitt <astitt AT sourcemage.org>
+ * libmisc: make smgl_which slightly more robust
+
+2005-05-23 Andrew Stitt <astitt AT sourcemage.org>
+ * libmedia, libsorcery: Yet more fixups for menu help items
+ (bug 8959/8610)
+
+2005-05-15 Andrew Stitt <astitt AT sourcemage.org>
+ * sorcery: fix custom optimization flags menu to show values
+ like it used to, bug 8891.
+
+2005-05-10 Andrew Stitt <astitt AT sourcemage.org>
+ * libresurrect: fix bug 8813, thanks Eric Sandall.
+
+2005-05-06 Andrew Stitt <astitt AT sourcemage.org>
+ * libsorcery: fix invoke_build_dir, a missing $ made it such that
+ ccache wouldnt get used unless one used distcc simultaneously.
+
+2005-05-02 Andrew Stitt <astitt AT sourcemage.org>
+ * sorcery: accept 'sorcery help' as a way to request help, most
+ other commands dont have preceeding --'s so this may make more
+ sense to some. Bug 8786, thanks for the patch Ondra Tomecka.
+ * man8/sorcery.8: update manual with 'sorcery help'
+
+2005-05-02 Andrew Stitt <astitt AT sourcemage.org>
+ * cast: dont use -s in pass_four as per comments in bug 8761
+ * etc/sorcery/config: unset MAKEFLAGS so values of -s etc dont
+ get inherited.
+
+2005-05-01 Andrew Stitt <astitt AT sourcemage.org>
+ * libmisc: send messages from mk_tmp_dirs to stderr
+
+2005-05-01 Andrew Stitt <astitt AT sourcemage.org>
+ * libtablet, libsorcery: use SECURITY_PATCH instead of
+ SECURITY_PATCHLEVEL, de-cripple the tablet creation portion
+ of this enhancement, this concludes the sorcery portion of
+ bug 8379.
+
+2005-05-01 Andrew Stitt <astitt AT sourcemage.org>
+ * sorcery: fix bug 8322, modifications of the install queue from
+ the command line, thanks Ondra Tomecka.
+
+2005-05-01 Andrew Stitt <astitt AT sourcemage.org>
+ * cast: use -s when calling make to supress unneeded messages, bug
8761
+
+2005-05-01 Andrew Stitt <astitt AT sourcemage.org>
+ * sorcery: make 'sorcery version' also work like sorcery
+ --version, bug 8777.
+
+2005-05-01 Andrew Stitt <astitt AT sourcemage.org>
+ * cast: --cflags, --cxxflags, --ldflags, and --no-opts imply -c,
+ bug 8739.
+
+2005-05-01 Andrew Stitt <astitt AT sourcemage.org>
+ * install: install man pages to /usr/share/doc instead of /usr/doc
+ * libsorcery: run uninstall and the install log exist
+ * uninstall: fix some problems with removing the install log before
+ the script is done with it
+
+2005-04-30 Andrew Stitt <astitt AT sourcemage.org>
+ * etc/sorcery/config: unset MAKELEVEL to fix an issue with
+ multiply nested triggers, bug 8756
+
+2005-04-30 Andrew Stitt <astitt AT sourcemage.org>
+ * cast: bandaid cast --queue code to work now that we pass "$@" around
+
+2005-04-29 Andrew Stitt <astitt AT sourcemage.org>
+ * alter, cast, cleanse, delve, dispel, invoke, scribbler, scribe,
+ sorcery, summon: Pass "$@" around to preserve parameter grouping
+ also call a new routine that backquotes things, this helps get
+ parameters through the su process from an unprivaledged user, bug
8738
+ * libmisc: add function to consolidate parameters
+
+2005-04-28 Andrew Stitt <astitt AT sourcemage.org>
+ * summon: fix poor wording in summon --help, thanks Geoffrey
+ Derber for pointing this out.
+
+2005-04-27 Andrew Stitt <astitt AT sourcemage.org>
+ * libunpack: fix bug 8732, check for file existence while unpacking
+
+2005-04-27 Andrew Stitt <astitt AT sourcemage.org>
+ * libtablet: add some code for new PATCHLEVEL and to be named
+ SECURITY_PATCHLEVEL concepts, actual storage of security
+ patchlevel wont be done until the name is finalized
+ * libsorcery: add some code to look at PATCHLEVEL (formerly
+ known as UPDATED) and SECURITY_PATCHLEVEL in the regular sorcery
+ queue code, add another similar function to find just security
+ updates (bug 8379 and 8736)
+ * sorcery: add a new sub-command queue-security for bug 8379
+ * man8/sorcery.8: update manual to include info on queue-security
+ sub-command
+
+2005-04-27 Andrew Stitt <astitt AT sourcemage.org>
+ * libtablet: fix typo in repair updated, also do some sanity
+ checking in the other repair routines
+
+2005-04-26 Andrew Stitt <astitt AT sourcemage.org>
+ * scribbler: moved code into functions and modernize calls
+ also always copy the spell and replicate the grimoire and
+ section files so the spell can be self contained and inherit
+ code properly (bug 8430)
+ * libcodex: add special case for scribbled spells in
+ codex_set_current_spell and codex_set_current_spell_quick
+
+2005-04-26 Paul Mahon <pmahon AT sourcemage.org>
+ * run_compiler: Minor fix so the script path isn't assimed to be first
+
+2005-04-25 Andrew Stitt <astitt AT sourcemage.org>
+ * libsorcery: enhance generate_keep_list to only look at files
+ related to installed spells.
+ * cleanse: add cleanse --sweep_all (bug 8663).
+ * man/man8/cleanse.8: add entry for --sweep_all.
+
+2005-04-25 Andrew Stitt <astitt AT sourcemage.org>
+ * libdispel: load the spell from the codex if the tablet isnt
+ found, bug 8728
+
+2005-04-23 Andrew Stitt <astitt AT sourcemage.org>
+ * libdownload: add line for ath wireless interfaces, bug 8634.
+ * libdownload: make the error when unable to get online more
+ friendly, bug 8656.
+ * libmisc: add a simple implementation of which for our needs
+ and since which is (correctly) not in basesystem, also add a
+ wrapper to find make for us.
+ * cast, cleanse, gaze, libgrimoire: find the real path to make when
+ we dont want to call the function make(), bug 8642.
+
+2005-04-21 Andrew Stitt <astitt AT sourcemage.org>
+ * libcrossinstall: fix bug 8647, use safe values for *_ROOT
+ menus since if the user tries hard enough while hitting cancel
+ they could get funny results.
+ * alter, dispel, build_api/common, libresurrect, libsorcery,
+ dispel, libdispel: Update cache tarball naming to use HOST
+ not BUILD, this was only noticable on cross-compiling. This is bug
+ 8648, thanks Benoit!
+
+2005-04-20 Andrew Stitt <astitt AT sourcemage.org>
+ * libdepends: use a consistent sentence structure between the
+ four depends permutations (bug 8613), also fix a bug where the
+ description was ignored for non-optional depends on a provider.
+
+2005-04-20 Andrew Stitt <astitt AT sourcemage.org>
+ * install: forcibly remove install.log (thereby avoiding a warning
+ from rm about it not being there) and add the install.log to
+ itself so its not alien.
+
+2005-04-19 Andrew Stitt <astitt AT sourcemage.org>
+ * install: generate a special install.log file used to track
+ sorcery's own files. This file is always the same name regardless
+ of sorcery branch so its easy to find.
+ * gaze: use the new sorcery install log to make sure gaze alien doesnt
+ show sorcery as alien (bug 8381)
+ * uninstall: trivial new uninstall script (bug 8596)
+ * libsorcery: fix typo in libsorcery when sorcery update
+ fails to download (bug 8628)
+
+2005-04-17 Andrew Stitt <astitt AT sourcemage.org>
+ * libtablet: dont make the tablet state dir if it doesnt exist
+ it just makes it tracked for no reason
+ * libresurrect: fix bug 8620, the wrong path for the tablet was used
+ if STATE_ROOT was not "". Also fix an issue with symlinks
+ to directories.
+
+2005-04-17 Paul Mahon <pmahon AT sourcemage.org>
+ * libdepends: function would block if depends or state files
+ didn't exist
+
+2005-04-16 Andrew Stitt <astitt AT sourcemage.org>
+ * sorcery, libcrossinstall: define dialog vars local so they
+ dont stomp on each other (bug 8610)
+
+2005-04-16 Andrew Stitt <astitt AT sourcemage.org>
+ * libsorcery: fix broken filter_in to work like filter when
+ generating the RIDLIST and there are multiple filters (bug 8608)
+
+2005-04-15 Andrew Stitt <astitt AT sourcemage.org>
+ * libresurrect: mkdir -p $BUILD_DIRECTORY in case we're
+ resurrecting into an install_root (bug 8601)
+ * cast: remove a harmless syntax error with the summon phase
+ during resurrect
+ * libmisc: only complain about strange /tmp/sorcery dir if it
+ actually exists, it doesnt on new systems or those with tmpfs
+ /tmp after reboot (bug 8599)
+
+2005-04-13 Andrew Stitt <astitt AT sourcemage.org>
+ * libmisc: add a chmod a-s for the first level of temporary
+ dirs in mk_tmp_dirs, this works around an iso bug introduced
+ in 0.9.4-test3
+
+2005-04-12 Andrew Stitt <astitt AT sourcemage.org>
+ * libsorcery: fix some issues with optimize finding archspecs
+
+2005-04-11 Andrew Stitt <astitt AT sourcemage.org>
+ * libsorcery: expect there to be more than one archspec, use
+ head -n 1 on find output
+ * sorcery: enahnce menu to expect multiple instances of an archspec
+ * etc/sorcery/config: archspecs can also be found in
+ /usr/share/archspecs from the smgl-archspecs spell
+
+2005-04-11 Andrew Stitt <astitt AT sourcemage.org>
+ * libtrack: qualify INSTALL_ROOT and STATE_ROOT with / before
+ cding there
+ * delve: cd to / before running spell success like cast does
+
+2005-04-09 Arjan Bouter <abouter AT sourcemage.org>
+ * libresurrect: fixed the arguments test in real_install_config_file
+
+2005-04-08 Andrew Stitt <astitt AT sourcemage.org>
+ * sorcery: add -f to rm command for replacing the restore script
+
+2005-04-08 Andrew Stitt <astitt AT sourcemage.org>
+ * build_api/common: rm_source_dir before making cache archive (bug
8249)
+ * etc/sorcery/config: add a SORCERY_PATH variable that people can
+ override if necessary, defaults to /usr/sbin (where sorcery
+ is installed). Fixes bug 8200.
+
+2005-04-06 Seth Woolley <seth AT tautology.org>
+ * libunpack: correct locate_spell_file logic for secure mode.
+ Thanks to David Michael Leo Brown, Jr. of linux-new fame.
+
+2005-04-06 Andrew Stitt <astitt AT sourcemage.org>
+ * libsorcery: fix 'bug' 8567, remove spaces from CFLAGS,
+ et. al. variables for broken configure scripts.
+
+2005-04-05 Seth Woolley <seth AT tautology.org>
+ * libunpack: libunpack code cleanups, more refactors, and a
+ single conditional statement to change between old and new
+ world, and all old world code isolated ready for deletion.
+ * libunpack: slightly different auditing api and the addition of
+ multiple GPG or HASH support per source file (so you can have,
+ say sha1 and md5 at the same time), also added checks for the
+ spell needed to support higher bit hashes, with an advisory if
+ it's not installed (so people can rank high bit hashes even
+ though it isn't in basesystem and it will gracefully failover
+ to lower bit-depths).
+ * libunpack: IGNORE and MISSING support. MISSING will mostly be
+ for a future auditing script as unpack_missing should never be
+ activated in a real spell. IGNORE supports volatile,
+ unversioned, and signature modes that let the user know why it
+ is being ignored, and signatures are also silently skipped since
+ they are not unpacked at all.
+ * libapi: some api removals and one addition for easier patching
+ where checks are needed (uncompress/guess_compressor pair)
+
+2005-04-05 Andrew Stitt <astitt AT sourcemage.org>
+ * libtriggers: apply patch from Thomas Houssin to fix a bug
+ introduced by my change yesterday. The function now uses
+ iterate. Ive made some additional fixups to the code, namely
+ using spaces instead of tabs for indenting and making the query
+ more colorful.
+
+2005-04-04 Andrew Stitt <astitt AT sourcemage.org>
+ * libtriggers: fix run_script trigger action (bug 8557)
+
+2005-04-04 Andrew Stitt <astitt AT sourcemage.org>
+ * cleanse: pass the backup dir in --tablet_spell
+
+2005-04-04 Seth Woolley <seth AT tautology.org>
+ * libgrimoire,libunpack: split out unpack stuff into new lib,
+ then order it semantically by common/oldworld/newworld.
+ * libunpack: add more documentation.
+ * libapi: change references for the refactor.
+
+2005-04-04 Seth Woolley <seth AT tautology.org>
+ * libgrimoire: correct documentation to be easier on the gurus
+
+2005-04-04 Paul Mahon <pmhon AT sourcemage.org>
+ * libdepends: locate typo fixed
+
+2005-04-04 Seth Woolley <seth AT tautology.org>
+ * build_api/api[12]: use unpack_file instead of unpack
+ * libgrimoire: spell gpg checking. See format in unpack_file
+ * libapi: some new api additions from libgrimoire
+
+2005-04-04 Andrew Stitt <astitt AT sourcemage.org>
+ * build_api/api[12]: use >> instead of > for process substitution,
+ this fixes super-debug log truncation (bug 7903)
+ * url_http: make wget log all its output to stdout
+ * cast: make summon_spells not redirect stderr, another thing
+ that breaks super-debug
+
+2005-04-03 Andrew Stitt <astitt AT sourcemage.org>
+ * cast: fix bug where if a spell is being resurrected and its
+ source is being summoned the summon code can finish after the
+ resurrect code and get an error
+
+2005-04-03 Andrew Stitt <astitt AT sourcemage.org>
+ * cast: add a -b parameter to enable an option that forces all
+ spells to implicitly depends on basesystem
+ * libdepends: if FORCE_BASESYSTEM_DEPENDS is on then all spells
+ (except basesystem and its depends) implicitly depend on basesystem
+ * etc/sorcery/config: add FORCE_BASESYSTEM_DEPENDS (default off)
+ * sorcery: greatly simplify rebuild by using libstate a routine
+ call cast with -b to ensure a reasonable ordering of basesystem
+ spells first (fixes bug 7762)
+
+2005-04-01 Andrew Stitt <astitt AT sourcemage.org>
+ * libcast: break the FUNCTIONS file loading into a seperate function
+ * libdispel: load the FUNCTIONS library (fix bug 8452)
+
+2005-04-01 Andrew Stitt <astitt AT sourcemage.org>
+ * libtablet: add functions to import REPAIR files into the tablet
+ make this also happen from the regular tablet cleanse path (bug
8494)
+ * scribe: add call to run tablet-wide REPAIR file import after a
+ scribe update
+ * cleanse: add option to cleanse just one spell's tablet
+ * man/man8/cleanse.8: update man page to have information about
+ --tablet_spell option
+
+2005-03-26 Andrew Stitt <astitt AT sourcemage.org>
+ * archspecs/ia32/intel/pentium3m: Add new archspec fixes bug 8504
+ * archspecs/ia32/intel/pentium4m: Add code to work with gcc 3.3
+
+2005-03-18 Andrew Stitt <astitt AT sourcemage.org>
+ * libresurrect: fix bug 8441, 'test -f' returns true, by adding
+ quotes around the optional md5sum log it becomes 'test -f ""'
+ which returns false as I had thought 'test -f' would do.
+
+2005-03-17 Andrew Stitt <astitt AT sourcemage.org>
+ * libresurrect: specifically find spell specific configs file rather
+ than use filter_configs due to our weird environment, also
+ quote a number of filenames that were left unquoted.
+ * libsorcery: redirect tablet functions in filter_generic to
+ /dev/null and make them conditional on each other
+ * libtablet: preserve the value of TABLET_PATH, whatever it
+ might be in tablet_set_spell
+
+2005-03-17 Andrew Stitt <astitt AT sourcemage.org>
+ * libresurrect: fix resurrect of a config file (bugs 8439 8438)
+ * libtablet: make a less restrictive routine to dig up the tablet
+ for a resurrect sandbox which obviously wont be self-referential
+ or installed.
+ * libsorcery: fix the way spell specific filters are searched for
+ * libdispel: fix bug with POST_REMOVE and the tablet, the tablet
+ gets removed before post_remove is called, postpone tablet
+ removal until after post_remove is run. Also fix some problems
+ with file name adjustment.
+
+2005-03-16 Andrew Stitt <astitt AT sourcemage.org>
+ * Start 1.13 development stream.
diff --git a/usr/sbin/alter b/usr/sbin/alter
index e91e1d6..1d702d7 100755
--- a/usr/sbin/alter
+++ b/usr/sbin/alter
@@ -10,14 +10,14 @@
function alter_alter() {

if [ -z "$1" ]; then
- cat <<EOF > /dev/stderr && return 1
+ cat <<EOF > /dev/stderr && return 1
alter [ -a|--alter ] [ -n|--spell spellname ]
[ -v|--version version ]
command [ args ... ]
EOF
fi

-
+
if [ "$1" == "-n" -o "$1" == "--spell" ]; then SPELL="$2";shift;shift; fi
if [ "$1" == "-v" -o "$1" == "--version" ]; then VERSION="$2";shift;shift;
fi

@@ -78,7 +78,7 @@ EOF
function alter_md5_mend() {

SINGLE= #grab a single conflict only instead of all conflicts
- STORE_BASE=${STORE_BASE:=/var/log/sorcery/tmp} # */tmp are often small
+ STORE_BASE=${STORE_BASE:=/var/log/sorcery/tmp} # */tmp are often small
# by default for the backup
SPELL="$1"
VERSION="$(gaze -q installed "$SPELL")"
@@ -118,7 +118,7 @@ function alter_md5_mend() {
SPELLS="$(echo "$RESULTS" | cut -d' ' -f1 | sort | uniq)"
TOTSP="$(echo "$SPELLS" | wc -l)"
FILES="$(echo "$RESULTS" | cut -d' ' -f2 | sort | uniq)"
- if [ "$ARCHIVE" != "off" ]; then
+ if [ "$ARCHIVE" != "off" ]; then
STORE=$STORE_BASE/$SPELL-$VERSION.$$
mkdir -p "$STORE"
mkdir -p "$STORE/tmp/sorcery"
@@ -134,23 +134,23 @@ function alter_md5_mend() {
echo "$SPFLS" |
sed -e 's/[^a-zA-Z0-9*.+]/\\&/g' |
sed -e 's/.*/\\:&: d/' |
- sed -i -f - "$MD5SUM_LOGS/$SPVER"
+ sed -i -f - "$MD5SUM_LOGS/$SPVER"
if [ "$ARCHIVE" != "off" ]; then
if [ "$COMPRESSBIN" == "tar" ]; then
- echo "$SPFLS" |
+ echo "$SPFLS" |
tar -f $INSTALL_CACHE/$SPVER-*.tar \
-kx -T /dev/stdin -C "$STORE" 2> /dev/null
else
- echo "$SPFLS" |
+ echo "$SPFLS" |
tar --"$COMPRESSBIN" -f $INSTALL_CACHE/$SPVER-*.tar$EXTENSION \
-kx -T /dev/stdin -C "$STORE" 2> /dev/null
fi
fi
progress_bar $((++COUNT)) $TOTSP 60 > /dev/stderr
done
- clear_line > /dev/stderr
+ clear_line > /dev/stderr
)
- if [ "$ARCHIVE" != "off" ]; then
+ if [ "$ARCHIVE" != "off" ]; then
message "${MESSAGE_COLOR}Creating
${SPELL_COLOR}$SPELL-undo${DEFAULT_COLOR}${MESSAGE_COLOR} spell for
${SPELL_COLOR}$SPELL-$VERSION${DEFAULT_COLOR}${MESSAGE_COLOR}.${DEFAULT_COLOR}"
> /dev/stderr
ORIGSPELL="$SPELL"
SPELL="$SPELL-undo"
@@ -164,8 +164,8 @@ function alter_md5_mend() {
create_md5list "$INST_LOG" "$MD5S_LOG" # relative to STORE instead of
absolute
CACHE="$INSTALL_CACHE/$SPELL-$VERSION-$HOST.tar"
CACHE_COMP="${CACHE}${EXTENSION}"
- # No install log nor compile cache needed or wanted since we are
- # only doing md5sum deletions from other spells, the undeleted
+ # No install log nor compile cache needed or wanted since we are
+ # only doing md5sum deletions from other spells, the undeleted
# form should only restore the md5sums to the proper location.
create_cache_archive $INST_LOG $CACHE $CACHE_COMP
rm -rf "$STORE"
@@ -238,7 +238,7 @@ function alter_pre_link() {

alter_alter -n smgl-prelink '
/usr/sbin/prelink -v '"$ARGS"' | tee $TMP_DIR/prelink.$$.output
- grep "Prelinking\\|Linking" $TMP_DIR/prelink.$$.output |cut -d" " -f2 |
+ grep "Prelinking\\|Linking" $TMP_DIR/prelink.$$.output |cut -d" " -f2 |
sort | uniq |
while read PRELINKED; do
touch "$PRELINKED"
@@ -284,8 +284,8 @@ function alter_strip_all_do() {
if [ "$(md5sum < $TMP_DIR/tostrip.$$)" == "$(md5sum < "$STRIPFILE")"
]; then
echo "$STRIPFILE" already stripped, skipping.
rm $TMP_DIR/tostrip.$$
- else
- if [ "$(ldd $TMP_DIR/tostrip.$$ | md5sum)" == "$(ldd "$STRIPFILE"
| md5sum)" ]; then
+ else
+ if [ "$(ldd $TMP_DIR/tostrip.$$ | md5sum)" == "$(ldd "$STRIPFILE"
| md5sum)" ]; then
echo "$STRIPFILE stripped and verified."
# uncomment the following to make backups before mving stripped
bins
# mkdir -p "/var/log/sorcery/tmp/smgl-strip.$$/${STRIPFILE%/*}"
@@ -326,8 +326,8 @@ function alter_strip_do() {
if [ "$(md5sum < $TMP_DIR/tostrip.$$)" == "$(md5sum < "$STRIPFILE")"
]; then
echo "$STRIPFILE" already stripped, skipping.
rm $TMP_DIR/tostrip.$$
- else
- if [ "$(ldd $TMP_DIR/tostrip.$$ | md5sum)" == "$(ldd "$STRIPFILE"
| md5sum)" ]; then
+ else
+ if [ "$(ldd $TMP_DIR/tostrip.$$ | md5sum)" == "$(ldd "$STRIPFILE"
| md5sum)" ]; then
echo "$STRIPFILE stripped and verified."
# uncomment the following to make backups before mving stripped
bins
# mkdir -p "/var/log/sorcery/tmp/smgl-strip.$$/${STRIPFILE%/*}"
@@ -377,7 +377,7 @@ Run alter without arguments to see a basic syntax guide.

Alter has two main uses:

-"alter":
+"alter":
This is the basic use of alter. Any command run on its command line
will be run as if it was run at the end of the cast, inside the cast of
the spell that is being altered. By default, it operates on the spell
@@ -386,7 +386,7 @@ for adding files to spells. See md5mend to modify files
in spells by
replacing them with in an alter session. When used together, with alter
run first, then md5mend run second, you should end up with a rather
clean system. Running alter to touch a file, then md5mending, then
-dispelling the alter spell will remove a file from the sytem cleanly.
+dispelling the alter spell will remove a file from the sytem cleanly.
In all, any modification of an installed spell couild be done while
maintaining somewhat logical md5sum logs.

@@ -411,17 +411,17 @@ Alter has three shortcut uses:

"prelink", "strip-all", or "strip":
These are two commonly used alter shortcuts. Prelinking optimizes
-the link space among all the binaries on the system. Strip-all strips
-all the binaries on the system one by one, and confirms that they are
+the link space among all the binaries on the system. Strip-all strips
+all the binaries on the system one by one, and confirms that they are
sane before installing them.
The first time you run either prelink or strip, alter creates the
/etc/prelink.conf file if you don't already have one. This part can
take up to an hour depending on processor speed and how full your disks
are, or as little as five minutes. The content of the file is merely a
listing, one directory per line, of all the directories that contain
-binaries that should be touched by prelink or this version of strip.
-Feel free to ctrl-c this process and make it yourself if you are
-impatient. The script, however, is very thorough and accurate, so it's
+binaries that should be touched by prelink or this version of strip.
+Feel free to ctrl-c this process and make it yourself if you are
+impatient. The script, however, is very thorough and accurate, so it's
not a bad idea to simply let the script run its course.
Both prelink and strip take quite a while to run everything through
because the md5mend process will essentially have to touch every archive
@@ -429,20 +429,20 @@ and md5sum file on your system. Be sure you have
plenty of space
available for the caches (if you have ARCHIVE=on). 1.5 times the
installed uncompressed binary size (averages about 1-2 gigs on most
installs, less for servers, more for desktops).
- If you want to both strip and prelink, strip before you prelink
+ If you want to both strip and prelink, strip before you prelink
seems to work better.
If you run prelink and get lots of -fPIC warnings, try upgrading
some of the spells, if it doesn't work, file a bug and CC
seth AT tautology.org on it and he will add -fPIC to the CFLAGS of the spell
-(alternatively, do this yourself and append an attachment to the bug).
-zlib needs -DPIC -fPIC. Prelinking doesn't like non-PIC'd binaries. It
+(alternatively, do this yourself and append an attachment to the bug).
+zlib needs -DPIC -fPIC. Prelinking doesn't like non-PIC'd binaries. It
won't hurt anything, it will just ignore them.
In my experience (Seth), stripping decreases file size, but doesn't
increase the speed, and prelink makes the files slightly bigger
(negligible), but decreases load time, often dramatically for C++ apps
with many links (read: KDE).

- For further study, RTFS or drop into the freenode #sourcemage
+ For further study, RTFS or drop into the freenode #sourcemage
channel and ask swoolley or the room for some urls or questions.

FAQ:
@@ -452,7 +452,7 @@ FAQ:

Q: How do I strip debugging info from my whole system?
A: alter -z
-
+
Q: I recompiled some libraries, and it slowed down.
A: Recompiling makes prelinking pointless, rerun alter -p upon each
update.

@@ -468,13 +468,13 @@ FAQ:
Q: How do I undo an alter?
A: There's no exact undo, but it's good enough if you've been using
only spells and alter:
-
+
# you did this but regretted it
alter -n alter-to-remove -v 31337 touch /bin/file # an alter
alter -m alter-to-remove # md5mend it

# undo the above
- dispel alter-to-remove # do this step only if the
files
+ dispel alter-to-remove # do this step only if the files
# it touched aren't critical.
If
# they are, set REAP=no before.
dispel -d alter-to-remove-undo 31337 # to unpack the undo cache
@@ -504,7 +504,7 @@ EOF
function main() {

[ -z "$1" ] && cat <<EOF > /dev/stderr && exit 1
-alter: usage:
+alter: usage:
alter [ { -a | --alter } ] # -a/--alter are ignored as this is default
[ { -n | --spell } spell:=alter ]
[ { -v | --version } version:=<installed> ] command [ args ... ]
@@ -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

}
@@ -559,10 +559,10 @@ elif [[ "$1" == -h ]] ||
[[ "$1" == --help ]] ||
[[ -z "$1" ]]; then
main "$1"
-else
+else
echo "Enter the root password, please." 1>&2
PARAMS=$(consolidate_params "$@")
- su -c "$0 $PARAMS" root
+ exec su -c "alter $PARAMS" root
fi


diff --git a/usr/sbin/cabal b/usr/sbin/cabal
index 9718b8f..0b42fd3 100755
--- a/usr/sbin/cabal
+++ b/usr/sbin/cabal
@@ -18,7 +18,7 @@ function read_cabal_names() {
mkdir -p $CABAL_DIRECTORY

[ -f $CABAL_NAMES ] || return
-
+

eval `awk '{ print "CABALS[" NR-1 "]=\"" $0 "\""; }' "$CABAL_NAMES"`

@@ -45,7 +45,7 @@ function write_cabal_names() {
#---------------------
function print_cabal_names() {

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

#for (( COUNT = 0; COUNT != MAX_CABALS; COUNT++ )); do
# echo "${CABALS[$COUNT]}"
@@ -272,7 +272,7 @@ function cabal_key_menu() {

while

- HELP="Generate, distribute, and revoke ssh2 keys to cabal computers to
+ HELP="Generate, distribute, and revoke ssh2 keys to cabal computers to
enable root login without password prompts"
G_HELP="Create 2048 bit ssh2 dsa public/private keys for a cabal."
D_HELP="Install the public key on all computer members of cabal."
@@ -396,7 +396,7 @@ function cabal_copy() {

case $ORDER in
C) cat $CABAL_DIRECTORY/$CABAL |
- while read BOX; do
+ while read BOX; do
scp -i $CABAL_KEYS/$CABAL \
-r $SOURCE \
root@${BOX}:$DESTINATION \
@@ -404,7 +404,7 @@ function cabal_copy() {
done
;;
S) cat $CABAL_DIRECTORY/$CABAL |
- while read BOX; do
+ while read BOX; do
scp -i $CABAL_KEYS/$CABAL \
-r $SOURCE \
root@${BOX}:$DESTINATION
@@ -431,7 +431,7 @@ function cabal_execute() {

case $ORDER in
C) cat $CABAL_DIRECTORY/$CABAL |
- while read BOX; do
+ while read BOX; do
echo "execing box $BOX" && ssh -n -i $CABAL_KEYS/$CABAL \
root@${BOX} \
"$COMMAND" \
@@ -440,7 +440,7 @@ function cabal_execute() {
;;

S) cat $CABAL_DIRECTORY/$CABAL |
- while read BOX; do
+ while read BOX; do
echo "execing box $BOX" && ssh -n -i $CABAL_KEYS/$CABAL \
root@${BOX} \
"$COMMAND"
@@ -474,7 +474,7 @@ function cabal_enchantment_menu() {
HELP=""
C_HELP="Copy files and directories to cabals via scp"
E_HELP="Execute commands on cabals"
- S_HELP="Show the output of previously execute concurrent commands and
+ S_HELP="Show the output of previously execute concurrent commands and
copies"
TITLE="Enchantment Menu"

@@ -558,7 +558,7 @@ function show_file() {
if [ -n "${PAGER}" ]
then
PAGER=`which less`
-fi
+fi

DIALOG="${DIALOGPROG} --stdout"

diff --git a/usr/sbin/cast b/usr/sbin/cast
index 2cb3e99..3459443 100755
--- a/usr/sbin/cast
+++ b/usr/sbin/cast
@@ -21,19 +21,16 @@ Usage: cast [parameters] [spell]

Optional Parameters:

- --cflags Custom CFLAGS
- --cxxflags Custom CXXFLAGS
- --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 and
- --ldflags
+ for those found in --cflags, --cxxflags,
+ --cppflags and --ldflags.

-V [on|off] Override \$VOYEUR setting

--f | --fix Discover and fix broken spells
--n | --nofix Discover, but do not fix broken spells
- (Both deprecated, use cleanse instead)
-
-d | --download Force download of sources (overwrite existing
files)

@@ -41,23 +38,40 @@ 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
+ NOTE: If there are any cross-grimoire
+ dependencies on unspecified grimoires they
+ will not work. The target spell will
+ not be found. To avoid this, specify all
+ relevant grimoires to the -g parameter
+ in the order you wish them to be searched.
+
-R | --recast-down Recursively recast depended-upon spells, even
if they are already installed...
-B | --recast-up Recursively recast dependent spells, even
if they are already installed...

+-O | --recast-optional [option] If a spell being built has spells which
+ 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.
+
+-Z | --lazy-updates [option] Perform updates on installed spells that
+ 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

@@ -67,13 +81,14 @@ EOF

#---------------------------------------------------------------------
## @Aguments Arguments of cast
-## @Globals DEPS_ONLY RECONFIGURE COMPILE
-## @Globals FORCE_DOWNLOAD SOURCE_CACHE SILENT FIX NOFIX SEPARATE
-## @Globals BASE_URL INSTALL_QUEUE
+## @Globals DEPS_ONLY RECONFIGURE COMPILE
+## @Globals FORCE_DOWNLOAD SOURCE_CACHE SILENT SEPARATE
+## @Globals BASE_URL INSTALL_QUEUE
##
#---------------------------------------------------------------------
function process_parameters() {

+ local n
while [ -n "$1" ]; do

if echo "" $1 | grep -q "^ -"; then
@@ -82,24 +97,28 @@ function process_parameters() {

--cflags) export OVERRIDE_CFLAGS="$2"; COMPILE="-c"; shift 2
;;
--cxxflags) export OVERRIDE_CXXFLAGS="$2"; COMPILE="-c"; shift 2
;;
+ --cppflags) export OVERRIDE_CPPFLAGS="$2"; COMPILE="-c"; shift 2
;;
--ldflags) export OVERRIDE_LDFLAGS="$2"; COMPILE="-c"; shift 2
;;
--no-opts) export NO_OPTIMIZATION_FLAGS=1; COMPILE="-c"; shift 1
;;
-V) export VOYEUR_OVERRIDE="$2"; shift 2
;;
--deps) export DEPS_ONLY="$1"; shift 1
;;
+ -g|--grimoire*) export OVERRIDE_GRIMOIRES="$2"; shift 2
;;
-r|--reconfigure) RECONFIGURE="$1"; COMPILE="-c"; shift 1
;;
-R|--recast-down) RECAST_DOWN="$1"; shift 1
;;
-B|--recast-up) RECAST_UP="$1"; shift 1
;;
+-O|--recast-optional) get_option "$2" "$DEFAULT_RECAST_OPTIONALS" \
+ RECAST_OPTIONALS n
+ shift
$n ;;
+ -Z|--lazy-updates) get_option "$2" "$DEFAULT_LAZY_DEPENDS_UPDATE" \
+ LAZY_DEPENDS_UPDATES n
+ shift
$n ;;
-b|--force-base-dep) FORCE_BASESYSTEM_DEPENDS=on; shift 1
;;
-c|--compile) COMPILE="$1"; shift 1
;;
-d|--download) export FORCE_DOWNLOAD="$1"; COMPILE="-c"; shift 1
;;
--from) export SOURCE_CACHE=$2; shift 2
;;
--silent) SILENT="$1"; shift 1
;;
- -f|--fix) export FIX="$1"; shift 1
;;
- -n|--nofix) export FIX="--fix"
- export NOFIX="$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
@@ -107,7 +126,7 @@ function process_parameters() {
else

shift
-
+
fi

done
@@ -120,6 +139,7 @@ function process_parameters() {
## switches rather.
#---------------------------------------------------------------------
function strip_parameters() {
+ local x n

while [ -n "$1" ]; do

@@ -130,22 +150,23 @@ function strip_parameters() {
--deps) shift 1 ;;
--cflags) shift 2 ;;
--cxxflags) shift 2 ;;
+ --cppflags) shift 2 ;;
--ldflags) shift 2 ;;
--no-opts) shift 1 ;;
-V) shift 2 ;;
+ -g|--grimoire*) shift 2 ;;
-R|--recast-down) shift 1 ;;
-B|--recast-up) shift 1 ;;
+ -O|--recast-optional) get_option "$2" "" x n ; shift $n ;;
+ -Z|--lazy-updates) get_option "$2" "" x n ; shift $n ;;
-b|--force-base-dep) shift 1 ;;
-r|--reconfigure) shift 1 ;;
--from) shift 2 ;;
--silent) shift 1 ;;
- -f|--fix) shift 1 ;;
- -n|--nofix) shift 1 ;;
-c|--compile) shift 1 ;;
-d|--download) shift 1 ;;
-s) shift 1 ;;
--url) shift 2 ;;
- --pam) shift 1 ;;
--queue) shift 1 ;;
*) shift 1 ;;

@@ -155,7 +176,7 @@ function strip_parameters() {

echo $1
shift
-
+
fi

done
@@ -163,6 +184,25 @@ function strip_parameters() {
}

#---------------------------------------------------------------------
+## Look for optional parameter and use default otherwise
+## specify via upvar how much to shift parameters
+#---------------------------------------------------------------------
+function get_option() {
+ local param=$1
+ local default=$2
+ local answer=$3
+ local up_shift=$4
+ local _answer=$2
+ local _up_shift=1
+ case "$param" in
+ always|ask-yes|ask-no|ignore) _answer=$param; _up_shift=2 ;;
+ *) _answer=$default ;;
+ esac
+ upvar "$answer" "$_answer"
+ upvar "$up_shift" "$_up_shift"
+}
+
+#---------------------------------------------------------------------
## Cast a single spell. When this function is called, all dependencies
## have been taken care of and we are allowed to cast this.
## @Globals SPELL
@@ -172,7 +212,7 @@ function cast_spell() { (
debug "cast" "Casting spell [$SPELL]"
set_term_title "Casting spell [$SPELL]"

- run_details
+ run_details
load_build_api || return 1

# these both prompt, and prompting should NOT occur at this point
@@ -191,30 +231,39 @@ function cast_spell() { (
fi

verify_sources || return 1
-
+
# wait for solo casts, to finish and ensure that others can't
acquire_cast_lock

# all this needs to reorganized and stuff...later

- IW_LOG="$TMP_DIR/$SPELL.iw"
+ export IW_LOG="$TMP_DIR/$SPELL.iw"

#some minor discussion occured about having this, i'll leave it out for now
activity_log "cast" "$SPELL" "$VERSION" "start"

# must declare OPS before sourcing config
local OPTS
- run_spell_config
+ export OPTS
+ run_spell_config
+
+ libtrack_init

- # this should probably be moved...
- spell_depends=$(hash_get uncommitted_hash $SPELL)
- test -e $spell_depends &&
+ local spell_depends spell_sub_depends
+ get_uncommitted_depends_file $SPELL spell_depends
+ test -e $spell_depends &&
OPTS="$OPTS $(get_depends_options $spell_depends $SPELL)"
-
+
+ get_uncommitted_sub_depends_file $SPELL spell_sub_depends
+ test -e $spell_sub_depends &&
+ local PROCESSED_SUB_DEPENDS=$(cut -f3 -d: $spell_sub_depends|tr '\n' ' ')
+
# HACK for bug 2910 and 10546
local saved_lc_all=$LC_ALL
export LC_ALL=C

+ export DISTCC_DIR="$SOURCE_DIRECTORY/.distcc"
+
# this will run through the whole build process
run_build_spell
rc=$?
@@ -269,16 +318,16 @@ function pass_one() {

SPELLS_TO_CAST=$(hash_get_table_fields "to_cast"|tr '\n' ' ')

- SPELLS="$SPELLS ${UP_DEPENDS[*]}"
+ SPELLS="$SPELLS ${BONUS_SPELLS[*]}"

# special case of no spell making it through dependency resolution
# or if DEPS_ONLY is set, there arent any dependent spells to cast
- if [ -z "$SPELLS_TO_CAST" ] ; then
+ if [ -z "$SPELLS_TO_CAST" ] ; then
local cannot_cast=$(hash_get_table_fields "bad_spells")
message "${PROBLEM_COLOR}No spells to cast!${DEFAULT_COLOR}"
message "${MESSAGE_COLOR}Cannot cast these spells:${DEFAULT_COLOR}"
message "---------------------------"
- message "${PROBLEM_COLOR}${cannot_cast}" | tr '[:blank:]' '\n' | column
+ message "${PROBLEM_COLOR}${cannot_cast}" | tr '[:blank:]' '\n' | column
message "${DEFAULT_COLOR}"
exit 1
fi
@@ -313,13 +362,13 @@ function pass_one() {
SPELLS_TO_CAST=$(hash_get_table_fields "deps_only"|tr '\n' ' ')
hash_reset deps_only
hash_reset looked_at
- if [ -z "$SPELLS_TO_CAST" ] ; then
+ if [ -z "$SPELLS_TO_CAST" ] ; then
local parents=$(hash_get_table_fields "to_cast")
message "${PROBLEM_COLOR}No spells to cast!${DEFAULT_COLOR}"
message "${MESSAGE_COLOR}None of the spells have dependencies" \
"to cast:${DEFAULT_COLOR}"
message "---------------------------"
- message "${PROBLEM_COLOR}${parents}" | tr '[:blank:]' '\n' | column
+ message "${PROBLEM_COLOR}${parents}" | tr '[:blank:]' '\n' | column
message "${DEFAULT_COLOR}"
exit 1
fi
@@ -340,10 +389,10 @@ function pass_one() {
#---------------------------------------------------------------------
## @Arguments Spells to be cast
## @Stdout the "Spells are to be cast" message.
-## @Stdin User interface, y or n
+## @Stdin User interface, y or n
## @Globals SEPARATE
## Asks whether you want to cast the listed spells or not.
-## Returns if not.
+## Returns if not.
## Then it starts pass three and four by calling make.
## Depending on SEPARATE it starts pass three in the background
## or not.
@@ -357,7 +406,7 @@ function pass_two() {

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

if ! query "Do you want to cast these spells?" "y" ; then
@@ -365,10 +414,10 @@ 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"
+ ( CAST_PASS="three"
depengine_entry_point "$SPELLS" "$SPELLS_TO_CAST"
if [[ $SCREEN_NAME ]] ; then
screen_notify "$SCREEN_NAME" "Done downloading"
@@ -388,16 +437,16 @@ function pass_two() {
touch $TMP_DIR/pass_three.done &>/dev/null
) &
fi
-
+
debug "cast" "Starting stage four make."
-
+
(
- CAST_PASS="four"
+ CAST_PASS="four"
depengine_entry_point "$SPELLS" "$SPELLS_TO_CAST"
touch $TMP_DIR/pass_four.done
)

-
+
# pass three might not finish, give it a short amount of time to complete
# in case its near the end of a download or something, if after a minute
# it doesn't finish just kill everything off.
@@ -407,7 +456,7 @@ function pass_two() {
if ! test -e $TMP_DIR/pass_three.done; then
message "Download pass has not completed yet, pausing momentarily"
fi
- while ! test -e $TMP_DIR/pass_three.done; do
+ while ! test -e $TMP_DIR/pass_three.done; do
sleep 5
let i+=5
if [[ $i -gt 60 ]] ; then
@@ -451,8 +500,8 @@ function pass_three() {
# Neither tail not cat work properly on FIFOs so a while loop will
# have to be used
screen_new_window "$SCREEN_NAME" $SCREEN_SUMMON_WIN "Summon $SPELL" \
- /bin/bash -c 'while : ; do
- read LINE && echo $LINE || sleep 0.1 ;
+ /bin/bash -c 'while : ; do
+ read LINE && echo $LINE || sleep 0.1 ;
done < '$TMP_DIR/download.fifo
sleep 0.1
fi
@@ -461,12 +510,12 @@ function pass_three() {
screen_name_window "$SCREEN_NAME" $SCREEN_SUMMON_WIN "Summon $SPELL"
# symlink the d/l log to the fifo
ln -s $TMP_DIR/download.fifo $download_log
- else
+ else
# normal non-screen cast, create a normal file
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)
@@ -480,7 +529,7 @@ function pass_three() {
return
fi
fi
-
+
if [[ $SEPARATE ]] ; then
summon_spell "$SPELL" >"$download_log"
else
@@ -488,7 +537,7 @@ function pass_three() {
summon_spell "$SPELL" > "$download_log"
unlock_file $download_log
fi
-
+
# This is to notify show_downloading/cast_spell that it is done with
# this source
touch "${download_log}.done"
@@ -499,7 +548,7 @@ function pass_three() {
## @Globals SPELL COMPILE
## Sets SPELL to spellname.
## Calls trigger "pre_cast"
-## If COMPILE is not set and it can be resurrected
+## If COMPILE is not set and it can be resurrected
## (can_resurrect SPELL) it calls resurrect with SPELL as argument.
## Otherwise it calls cast_spell.
## If resurrect or cast_spell returned 0 it calls trigger "cast"
@@ -519,7 +568,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
@@ -556,6 +605,7 @@ function pass_four() {
function pass_five() {

debug "cast" "Function : pass_five"
+ local rc=0

# must exist or we get problems with checks here.
touch $SUCCESS_LIST
@@ -563,7 +613,7 @@ function pass_five() {
touch $CHECK_TRIGGERS_SUCCESS
touch $CHECK_TRIGGERS_FAILURE
touch $CONFLICT_LIST
-
+
debug "pass_five" "SUCCESS LIST is : `cat $SUCCESS_LIST 2>/dev/null`"
debug "pass_five" "FAILED LIST is : `cat $FAILED_LIST 2>/dev/null`"
debug "pass_five" "CONFLICT LIST is : `cat $CONFLICT_LIST 2>/dev/null`"
@@ -578,11 +628,11 @@ function pass_five() {
for item in `cat $SUCCESS_LIST 2>/dev/null`; do
message "$item"
done | column
-
- set_term_title "Casting successfull."
+
+ set_term_title "Casting successful."
message "${DEFAULT_COLOR}"

- fi
+ fi

if [ -s $CHECK_TRIGGERS_SUCCESS ] ; then
message "${DEFAULT_COLOR}"
@@ -605,7 +655,7 @@ function pass_five() {
fi

local NOT_CAST
- NOT_CAST=$( { hash_get_table_fields to_cast
+ NOT_CAST=$( { hash_get_table_fields to_cast
cat $SUCCESS_LIST
cat $FAILED_LIST
cat $CHECK_TRIGGERS_SUCCESS
@@ -627,13 +677,13 @@ function pass_five() {
done | column
message "${DEFAULT_COLOR}"
fi
-
+
#
- # To check for failed spells, we only need to see what is remaining in the
+ # To check for failed spells, we only need to see what is remaining in the
# install queue.
#
if [ -s $FAILED_LIST ] ; then
-
+
message "${DEFAULT_COLOR}"
message "${MESSAGE_COLOR}Spells that encountered problems:"
message "---------------------------------${PROBLEM_COLOR}"
@@ -644,10 +694,10 @@ function pass_five() {

set_term_title "Casting failed."
message "${DEFAULT_COLOR}"
- return 1
+ rc=1
+
+ fi

- fi
-
if [[ "$CAST_QUEUE" == "yes" ]] ; then
if [ -s $INSTALL_QUEUE ] ; then
message "${MESSAGE_COLOR}The install queue is not empty, "
@@ -657,17 +707,35 @@ function pass_five() {
message "$item"
done | column
message "${DEFAULT_COLOR}"
- return 1
+ rc=1
fi
fi
- debug "cast" "End of pass_five"

+ # check if confmeld should be run
+ local spell deferred_list
+ while read spell; do
+ # ignore the date - previously deferred files should be merged too
+ if [[ -d $CONFIG_STAGE_DIRECTORY/$spell ]]; then
+ deferred_list="$spell $deferred_list"
+ fi
+ done < $SUCCESS_LIST
+ if [[ $deferred_list ]]; then
+ message "${MESSAGE_COLOR}Cast deferred installing some configuration
files."
+ message "The following spells have new pending updates: "
+ message "---------------------------------$SPELL_COLOR"
+ message "$deferred_list" | column
+ message "${MESSAGE_COLOR}Please run confmeld to merge them into your
system."
+ message "$DEFAULT_COLOR"
+ fi
+
+ debug "cast" "End of pass_five"
+ return $rc
}

#---------------------------------------------------------------------
## @Arguments Spells to cast
## @Globals CAST_PASS
-##
+##
## Starts the passes and sets CAST_PASS accordingly.
#---------------------------------------------------------------------
function pass_zero() {
@@ -686,7 +754,7 @@ function pass_zero() {

#---------------------------------------------------------------------
## @STDOUT User information ("Cleaning up as well as I can...")
-## That function is being called when the process receives
+## That function is being called when the process receives
## SIGINT. It then calls cleanup.
#---------------------------------------------------------------------
function int_trap()
@@ -697,7 +765,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
}
@@ -708,11 +776,12 @@ function int_trap()
function cast_cleanup() {
$STD_DEBUG
cleanup_tmp_dir $TMP_DIR
+ clean_resources
}

#---------------------------------------------------------------------
## @Arguments arguments of cast
-## @Globals FIX CAST_PASS
+## @Globals CAST_PASS
## @return 0 always
## Starts prameter processing and casts the given spells.
## The list of given spells is being searched for invalid spells
@@ -723,11 +792,13 @@ function main() {
debug "cast" "main() - $*"
local T_SPELLS
process_parameters "$@"
+ SPELLS=`strip_parameters "$@"`

if [[ "$CAST_QUEUE" == yes ]] ; then

touch "$INSTALL_QUEUE"
- local tfile=$(lock_start_transaction "$INSTALL_QUEUE")
+ local tfile
+ lock_start_transaction "$INSTALL_QUEUE" tfile
grep -Ev '^$' $INSTALL_QUEUE > $tfile
lock_commit_transaction "$INSTALL_QUEUE"
if [ -s $INSTALL_QUEUE ]; then
@@ -740,7 +811,7 @@ function main() {
fi

SPELLS=$(<$INSTALL_QUEUE)
- else
+ else
message "${MESSAGE_COLOR}Install queue is empty${DEFAULT_COLOR}"
exit
fi
@@ -748,6 +819,10 @@ function main() {
SPELLS=`strip_parameters "$@"`
fi

+ if [[ $OVERRIDE_GRIMOIRES ]] ; then
+ codex_set_grimoires $OVERRIDE_GRIMOIRES
+ fi
+
for spell in $SPELLS ; do
codex_does_spell_exist $spell
if [ $? -eq 0 ] ; then
@@ -783,7 +858,7 @@ elif [ "$UID" -gt 0 ]; then

echo "Enter the root password, please."
PARAMS=$(consolidate_params "$@")
- su -c "$0 $PARAMS" root
+ exec su -c "cast $PARAMS" root

elif [ ${0:0:5} != "/tmp/" ]; then

@@ -797,32 +872,35 @@ elif [ ${0:0:5} != "/tmp/" ]; then
export CHECK_TRIGGERS_SUCCESS="$TMP_DIR/check_trigger_success_list"
export CHECK_TRIGGERS_FAILURE="$TMP_DIR/check_trigger_failure_list"
lock_file $SAFE_CAST
-
- cp $0 $SAFE_CAST
+
+ # $0 can be bashdb, but we want to copy cast
+ smgl_which cast PATH_TO_CAST
+ cp "$PATH_TO_CAST" $SAFE_CAST
+
chmod +x $SAFE_CAST
exec bash $SAFE_CAST "$@"
-
+
else
export TOP_LEVEL=${TOP_LEVEL:-$SHLVL}
if [[ $NICE != "0" ]] ; then
renice $NICE -p $$ >/dev/null
fi
-
+
# If we are in a screen, weird things happen if we make another screen.
- # So disable screen mode if we are in a screen aready which wasn't started
+ # So disable screen mode if we are in a screen aready which wasn't started
# by smgl. We also have to make sure this is the top level cast so the SA
# won't see the message over and over and over
if [[ $TERM == screen ]] &&
[[ $TOP_LEVEL == $SHLVL ]] &&
[[ $SCREEN == on ]] &&
- [[ ! $SCREEN_NAME ]]
+ [[ ! $SCREEN_NAME ]]
then
export SCREEN_OVERRIDE=no
message "${MESSAGE_COLOR}Although screen mode is enabled, you already
seem to be in a another"
message "screen session. Screen-in-screen is disabled."
message "Continuing with screen mode off.${DEFAULT_COLOR}"
fi
-
+
# Disable screen mode if the appropriate env var is set
if [[ $SCREEN_OVERRIDE ]] &&
[[ $SCREEN == on ]]
@@ -831,9 +909,9 @@ else
debug "cast" "Turning $SCREEN_OVERRIDE screen mode"
fi

- # If screen mode is on, but we aren't in screen, start a new session
- # Call to screen_start never exits
- if [[ $SCREEN == on ]] &&
+ # If screen mode is on, but we aren't in screen, start a new session
+ # Call to screen_start never exits
+ if [[ $SCREEN == on ]] &&
[[ $TERM != screen ]]
then
SCREEN_NAME="ScreenCast $*"
@@ -842,24 +920,24 @@ else
echo "WTF?? We should not get here. screen_start execs!"
exit 1
fi
-
+
# If running in screen, screen mode is on, screen was started by us
# and finally, it hasn't been initialized yet.
- if [[ $TERM == screen ]] &&
- [[ $SCREEN == on ]] &&
- [[ $SCREEN_NAME ]] &&
+ if [[ $TERM == screen ]] &&
+ [[ $SCREEN == on ]] &&
+ [[ $SCREEN_NAME ]] &&
[[ ! $SCREEN_INITIALIZED ]]
then
debug "cast" "Initializing screen windows"
screen_name_window "$SCREEN_NAME" $SCREEN_MAIN_WIN "Main"

# Start debugging window if debugging is on and not set to /dev*
- if [[ $DEBUG ]] &&
+ if [[ $DEBUG ]] &&
[[ ${DEBUG#/dev} == $DEBUG ]]
- then
+ 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

@@ -879,7 +957,7 @@ else
if [[ $SCREEN_NAME ]] && [[ $TOP_LEVEL -eq $SHLVL ]] ; then
screen_notify "$SCREEN_NAME" "Done casting"
message -n "Press enter to exit screen."
- read
+ read
screen_quit "$SCREEN_NAME"
fi
exit $rc
diff --git a/usr/sbin/cleanse b/usr/sbin/cleanse
index af1e584..3e91c3e 100755
--- a/usr/sbin/cleanse
+++ b/usr/sbin/cleanse
@@ -2,7 +2,7 @@

#---------------------------------------------------------------------
## This script should clean up the sorcery files, particularly
-## the depends and packages files. It should validate the files
+## the depends and packages files. It should validate the files
## remove corrupted lines, and ensure the information all agrees
## with itself. It is also to clean out unused lines and files.
##
@@ -35,45 +35,45 @@
#--------------------
function usage()
{
- local s=$(basename $0)
+ local s="cleanse"
cat << EOF
-Invoke $s with one of the arguments below.
+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 clean up the tablet
--tablet coalesce clean up the tablet and hardlink duplicate files
---tablet_spell clean up the tablet for one spell
---logs cleans old logs in the same way a system-update does
+--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 $*"
}


@@ -99,10 +99,10 @@ function args()
while [ $# -gt 0 ] ; do
arg=$1
shift
-
+
case $arg in
--help) usage ;;
- --delint)
+ --delint)
if [[ $1 == full ]] ; then
delint full
let rc+=$?
@@ -156,7 +156,7 @@ function args()
fi
;;
--tablet_spell)
- tablet_cleanse_chapter $TABLET_PATH/$1 $BACKUPDIR
+ tablet_cleanse_chapter $TABLET_PATH/$1 $BACKUPDIR yes
let rc+=$?
shift
;;
@@ -181,18 +181,18 @@ function delint()
if [[ $1 == full ]] ; then
cond=''
fi
-
+
lock_file $DEPENDS_STATUS
-
+
message "Pass one (malformed depends lines)"
# This grep will pull out malformed lines from the depends file
- regex='^[^:]*:[^:]*:(on|off):(optional|required):'
+ regex='^[^:]*:[^:]*:(on|off):(optional|required|suggest|runtime):'
lines=$(grep -v -E "$regex" $DEPENDS_STATUS)
if [[ $lines ]] ; then
message "The following malformed lines were found"
message "and will cause problems with the following passes:"
message "$lines"
- if query "Do you want them removed" "n" ; then
+ if query "Do you want them removed" "n" ; then
message "Removing lines..."
grep -E "$regex" $DEPENDS_STATUS > $TMP_DIR/delint.1
mv $TMP_DIR/delint.1 $DEPENDS_STATUS
@@ -205,19 +205,19 @@ function delint()
return 1
fi
fi
-
+
generic_remove_stale "$DEPENDS_STATUS" depends two

message "Pass three (duplicate depends entries)"
for LINE in $( sed -n 's/^\([^:]*\):\([^:]*\):.*$/\1:\2/p' $DEPENDS_STATUS
| sed 's/+/\\+/' | sort | uniq -d ) ; do
message
options=()
- eval $(awk '/^'$LINE':/{
- if(!ENTRIES[$0]) {
+ eval $(awk '/^'$LINE':/{
+ if(!ENTRIES[$0]) {
printf("options[%d]=\"%s\"\n", count++, $0); ENTRIES[$0]=1;
} }' $DEPENDS_STATUS)
if [ ${#options[@]} -gt 1 ] ; then
- select_list choice 0 "${options[@]}"
+ select_list choice "" "${options[@]}"
message "Removing other entries and keeping selected entry"
else
choice="${options[0]}"
@@ -230,10 +230,16 @@ function delint()

unlock_file $DEPENDS_STATUS

+ touch $SUB_DEPENDS_STATUS
+ lock_file $SUB_DEPENDS_STATUS
+ generic_remove_duplicate "$SUB_DEPENDS_STATUS" sub_depends four
+ generic_remove_stale "$SUB_DEPENDS_STATUS" sub_depends five
+ unlock_file $SUB_DEPENDS_STATUS
+
touch $TRIGGER_LIST
lock_file $TRIGGER_LIST
- generic_remove_duplicate "$TRIGGER_LIST" trigger four
- generic_remove_stale "$TRIGGER_LIST" trigger five
+ generic_remove_duplicate "$TRIGGER_LIST" trigger six
+ generic_remove_stale "$TRIGGER_LIST" trigger seven
unlock_file $TRIGGER_LIST

message "Delint done."
@@ -258,13 +264,13 @@ function generic_remove_stale() {
local tmp=$TMP_DIR/delint.$2.stale
local t
awk -F: '
- BEGIN {
- while (getline < "'$SPELL_STATUS'")
- Installed[$1] = 1;
- }
- {
- if ( ! Installed[$1])
- print $0;
+ BEGIN {
+ while (getline < "'$SPELL_STATUS'")
+ Installed[$1] = 1;
+ }
+ {
+ if ( ! Installed[$1])
+ print $0;
}' "$1" |tee $tmp
t=$(wc -l $tmp | awk '{print $1;}')
message "\t$t bad lines, $(( $(wc -l $1| cut -f1 -d' ') - t))" \
@@ -292,29 +298,29 @@ function prune_depends()
local action=""
local LINE DISPEL_LIST CAST_LIST
local choice options provider spell
-
+
# actualy do the actions, or just output what should be done
if [[ $1 == doit ]] ; then
action="doit"
fi
-
+
# Lock the depends file so no one messes with it while it's being worked on
- lock_file $DEPENDS_STATUS
-
+ lock_file $DEPENDS_STATUS
+
# Get a list of bad dependencies
# Output is in the form "SPELL DEPENDENCY optional/reqired PROVIDER"
bad=( $( awk -F: '
- BEGIN {
- while (getline < "'$SPELL_STATUS'")
- Installed[$1] = 1;
- }
- $3=="on"{
- if($2 ~ "[(].*[)]")
- prov=gensub("^.*\\((.*)\\).*$", "\\1", 1, $2);
+ BEGIN {
+ while (getline < "'$SPELL_STATUS'")
+ Installed[$1] = 1;
+ }
+ $3=="on"{
+ if($2 ~ "[(].*[)]")
+ prov=gensub("^.*\\((.*)\\).*$", "\\1", 1, $2);
else
prov="__BLANK__";
gsub("\\(.*\\)", "", $2)
- if ( Installed[$1] && ! Installed[$2] && $2!="")
+ if ( Installed[$1] && ! Installed[$2] && $2!="")
printf("%s %s %s %s\n", $1, $2, $4, prov);
}' $DEPENDS_STATUS ) )

@@ -323,69 +329,81 @@ 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" )
+ if [[ $3 == suggest ]] || [[ $3 == runtime ]]; then
+ options=( "Switch from $2 to ${provider}" )
+ else
+ options=( "Switch from $2 to ${provider} and recompile" )
+ fi
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
+ if [[ $3 == required ]] || [[ $3 == runtime ]]; then
options=( "Ignore" "Dispel $1" "Cast $2" "${options[@]}" )
elif [[ $3 == optional ]] ; then
options=( "Ignore" "Dispel $1" "Cast $2" "Recast $1 without $2"
"${options[@]}" )
+ elif [[ $3 == suggest ]] ; then
+ options=( "Ignore" "Dispel $1" "Cast $2" "Disable $2 in $1"
"${options[@]}" )
fi
-
+
#Get the user's choice of action
- select_list choice 0 "${options[@]}"
+ select_list choice "" "${options[@]}"
case ${choice} in
I*) message "Ignoring." ;;
- D*) echo $1 >> $TMP_DIR/prune.dispel ;;
+ Dispel*) echo $1 >> $TMP_DIR/prune.dispel ;;
C*) echo $2 >> $TMP_DIR/prune.cast ;;
R*) echo $1 >> $TMP_DIR/prune.cast
# Revise choice in the depends file
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
- ;;
- *) message "We should never get here."
+ Disable*)
+ sed 's/^\('$1':'$2':\)on\(:suggest:.*\)$/\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
+ if [[ $3 == required ]] || [[ $3 == optional ]]; then
+ echo $1 >>$TMP_DIR/prune.cast
+ fi
+ ;;
+ *) message "We should never get here."
exit 1
;;
esac
echo
shift 4
done
-
- unlock_file $DEPENDS_STATUS
-
+
+ unlock_file $DEPENDS_STATUS
+
# put the spells in two files for later perusal
if [[ $action ]] ; then
- [ -s $TMP_DIR/prune.dispel ] &&
+ [ -s $TMP_DIR/prune.dispel ] &&
dispel $( sort $TMP_DIR/prune.dispel | uniq )
- [ -s $TMP_DIR/prune.cast ] &&
+ [ -s $TMP_DIR/prune.cast ] &&
cast -c $( sort $TMP_DIR/prune.cast | uniq )
else
local prune_dispel prune_cast t
@@ -413,7 +431,7 @@ function packages()
local spell t LINE
message "Fixing packages..."
lock_file $SPELL_STATUS
-
+
message "Pass 1 (bad lines)"
sed -n '/^[^:]*:[^:]*:[^:]*:[^:]*$/!p' $SPELL_STATUS >
$TMP_DIR/packages.bad
if [ -s $TMP_DIR/packages.bad ] ; then
@@ -425,7 +443,7 @@ function packages()
message "\tRemoving bad entries"
mv $TMP_DIR/packages.good $SPELL_STATUS
fi
-
+
message "Pass 2 (non-existant spells)"
t=""
for spell in $( sed -n 's/^\([^:]*\):.*$/\1/p' $SPELL_STATUS ) ; do
@@ -441,7 +459,7 @@ function packages()
message "these spells went. They may have been deprecated and then"
message "removed. You may want to dispel these if that is the case."
fi
-
+
message "Pass 3 (duplicate entries)"
t=$(
for LINE in $( sed -n 's/^\([^:]*\):\([^:]*\):.*$/\1/p' $SPELL_STATUS |
sort | uniq -d ) ; do
@@ -453,7 +471,7 @@ function packages()
message "\tRemoving bad entries"
mv $TMP_DIR/packages.3 $SPELL_STATUS
fi
-
+
unlock_file $SPELL_STATUS
message "Done fixing packages."
}
@@ -521,15 +539,15 @@ function cleanse_fix()
echo
echo ".PHONY : all $SPELLS"
) > $MAKEFILE
-
+
# load our ldd hash with the spells we know we'll care about
# but no more then necessary
cleanse_fix_init_ldd_check $($REAL_MAKE -s -f $MAKEFILE all 2>/dev/null)

local PASSED FIXED HOPELESS TOTALNR CURNR unused
-
+
CURNR=0
-
+
if [ $FIX == quick ] ; then
TOTALNR=0 #counting them like this doesn't seem to take substantial time
for unused in $SPELLS ; do let TOTALNR++ ; done
@@ -620,11 +638,11 @@ function cleanse_fix_spell() {
return 1
fi

- cast -c $SPELL &&
+ cast -c $SPELL &&
cleanse_fix_run_checks $SPELL &&
FIXED="${FIXED}${SPELL}"$'\n' &&
return 0
-
+
# if we get here the spell is deemed hopeless

HOPELESS="${HOPELESS}${SPELL}"$'\n'
@@ -663,7 +681,7 @@ function cleanse_fix_run_checks() {
## @FIXME The skipped directories should be made configurable somewhere
## @return 0 The files were all in existance
## @return 1 At least one file was found missing
-##
+##
#-----------------------
function cleanse_fix_find_check() {
if [ "$FIND_CHECK" == "off" ] ; then
@@ -706,7 +724,7 @@ function cleanse_fix_find_check() {
if [[ $BADLIST ]] ; then
message "${PROBLEM_COLOR}The following files from" \
"${SPELL_COLOR}${SPELL}${DEFAULT_COLOR}" \
- "${PROBLEM_COLOR}don't exist: "$'\n'"${DEFAULT_COLOR}"
+ "${PROBLEM_COLOR}don't exist: "$'\n'"${DEFAULT_COLOR}"
message "$BADLIST"

return 1
@@ -722,9 +740,9 @@ function cleanse_fix_find_check() {
## what library directories a spell has libraries in, this is because
## some spells have their own private libraries and arent happy if
## they dont know where they are
-##
+##
#-----------------------
-function cleanse_fix_init_ldd_check() {
+function cleanse_fix_init_ldd_check() {
if [ "$LDD_CHECK" == "off" ] ; then
return 0
fi
@@ -751,7 +769,7 @@ function cleanse_fix_init_ldd_check() {
## Check that all libraries the spell binaries need exist
## @return 0 The libraries have their requirements met
## @return 1 At least one library isnt happy
-##
+##
#-----------------------
function cleanse_fix_ldd_check() { (
if [ "$LDD_CHECK" == "off" ] ; then
@@ -823,7 +841,7 @@ function cleanse_fix_ldd_check() { (
## Check that all symlink targets exist
## @return 0 The symlinks point to real files
## @return 1 At least one symlink doesnt have its target
-##
+##
#-----------------------
function cleanse_fix_sym_check() {
if [ "$SYM_CHECK" == "off" ] ; then
@@ -882,7 +900,7 @@ function cleanse_fix_sym_check() {
## Verify the md5sum of all the files
## @return 0 The md5sum of a file is incorrect
## @return 1 At least one md5sum is wrong
-##
+##
#-----------------------
function cleanse_fix_md5sum_check() {

@@ -976,20 +994,20 @@ function cleanse_fix_md5sum_check() {
# the wrong place a future improvement would be
# to use iterate or some other method that is not naive to
# filenames with spaces in them
- tfile=`lock_start_transaction $INSTALL_LOG`
+ lock_start_transaction "$INSTALL_LOG" tfile
sed "s${A}^$LINE\$${A}${A}" $INSTALL_LOG|tr -s '\n' > $tfile
lock_commit_transaction $INSTALL_LOG
message -n '.'

- tfile=`lock_start_transaction $MD5_LOG`
+ lock_start_transaction "$MD5_LOG" tfile
sed "s$A.* $LINE\$${A}${A}" $MD5_LOG|tr -s '\n' > $tfile
lock_commit_transaction $MD5_LOG
message -n '.'

test -d $POSSESSED_LOGS || mkdir -p $POSSESSED_LOGS
-
+
possessed=$POSSESSED_LOGS/$SPELL-$2
- tfile=`lock_start_transaction $possessed`
+ lock_start_transaction "$possessed" tfile
echo $LINE >> $tfile
# remove duplicates
cp $tfile $TMP_DIR/$SPELL.possessed.$$
@@ -1029,7 +1047,7 @@ if [ $UID -eq 0 ] ; then
# Make sure root is running this
if [ $# -eq 0 ] ; then
# IF there are no args, assume the full treatment is desired
- exec $0 --packages --delint --logs --prune doit --tablet --sweep --fix
+ exec cleanse --packages --delint --logs --prune doit --tablet --sweep
--fix
fi

mk_tmp_dirs backup /tmp/cleanse
@@ -1053,5 +1071,5 @@ else
message "You must be root to run this command."
message "Switching to root user..."
PARAMS=$(consolidate_params "$@")
- exec su -c "$0 $PARAMS" root
+ exec su -c "cleanse $PARAMS" root
fi
diff --git a/usr/sbin/confmeld b/usr/sbin/confmeld
new file mode 100755
index 0000000..2364696
--- /dev/null
+++ b/usr/sbin/confmeld
@@ -0,0 +1,335 @@
+#!/bin/bash
+#---------------------------------------------------------------------
+## @Synopsis merge the config files located in the config stage directory to
the system.
+## @Copyright Other additions/corrections Copyright 2002 by the Source Mage
Team
+## Script to install staged config files.
+#---------------------------------------------------------------------
+
+#-----
+## Help... hmm... I wonder what it does...
+#-----
+function help()
+{
+ cat << EOF
+Melds the staged config files from $CONFIG_STAGE_DIRECTORY
+
+Examples:
+confmeld
+confmeld -l
+confmeld nano
+confmeld /etc/sysconfig/facilities
+
+Optional Parameters:
+-h, --help will just print this help
+-l, --list will just list all the spells and their staged configs
+-c, --list-configs will just list all the staged configs
+-s, --list-spells will just list all the spells with staged configs
+-q, --no-column don't column the output
+-f, --force <action> always use do <action> when merging
+
+where <action> can be one of:
+discard-new do nothing
+discard-old trash the old config and install over it
+use-old leave the old config in its place and backup the new
one
+use-new backup the old config and install the new one in its
place
+
+Optional arguments:
+You can invoke confmeld with a spell name or a staged config as an argument.
+Confmeld will then work only on that argument.
+
+EOF
+ exit 1
+}
+
+#--------------------------------------------------------------------
+## List all the configs in the config stage root
+##
+## @stdout a list of all configs in the config stage root
+#--------------------------------------------------------------------
+function all_config_files()
+{
+ find $CONFIG_STAGE_DIRECTORY -type f
+}
+
+#--------------------------------------------------------------------
+## List all uniq config *filenames* in the config stage directory
+##
+## @stdout a list of all uniq configs in the stage directory
+#--------------------------------------------------------------------
+function all_uniq_config_files()
+{
+ all_config_files |
+ sed "s#^$CONFIG_STAGE_DIRECTORY/[^/]*/[^/]*##" |
+ sort -u
+}
+
+#--------------------------------------------------------------------
+## list all spells that have staged configs
+##
+## @stdout list of spells that have staged configs
+#--------------------------------------------------------------------
+function all_spells_with_staged_configs()
+{
+ all_config_files |
+ sed "s#$CONFIG_STAGE_DIRECTORY/*##g" |
+ cut -s -d/ -f1 | uniq
+}
+
+#-----
+## override column so that we can pass -q to not columnate. Adapted from gaze
+#-----
+function maybe_column() {
+ if [[ $USE_COLUMN == no ]]; then
+ cat
+ else
+ column "$@"
+ fi
+}
+
+#--------------------------------------------------------------------
+## nicely list all spells that have staged configs and exit
+##
+## @stdout list of spells that have staged configs
+#--------------------------------------------------------------------
+function list_spells_with_staged_configs()
+{
+ local spells=$(all_spells_with_staged_configs)
+
+ if [[ -n $spells ]]; then
+ message "${MESSAGE_COLOR}Spells with staged configuration
files:$SPELL_COLOR"
+ echo "$spells" | maybe_column
+ message "$DEFAULT_COLOR"
+ fi
+ exit 0
+}
+
+#--------------------------------------------------------------------
+## nicely list all staged configs and exit
+##
+## @stdout list of staged configs
+#--------------------------------------------------------------------
+function list_staged_configs()
+{
+ local configs=$(all_uniq_config_files)
+
+ if [[ -n $configs ]]; then
+ message "${MESSAGE_COLOR}Staged configuration files:$FILE_COLOR"
+ echo "$configs" | maybe_column
+ message "$DEFAULT_COLOR"
+ fi
+ exit 0
+}
+
+#--------------------------------------------------------------------
+## nicely list all spells and their staged configs
+##
+## @stdout list of spells and their staged configs
+#--------------------------------------------------------------------
+function list_all()
+{
+ local spell config
+ for spell in $(all_spells_with_staged_configs); do
+ message "${SPELL_COLOR}$spell:$FILE_COLOR"
+ all_config_files |
+ sed -n "s,^$CONFIG_STAGE_DIRECTORY/$spell/[^/]*,,p" |
+ maybe_column
+ message "$DEFAULT_COLOR"
+ done
+ exit 0
+}
+
+#--------------------------------------------------------------------
+## parses the path to get specific information about the config file
+##
+## @param config file path
+## @param upvar for spell name
+## @param upvar for spell success time
+## @param upvar for actual path to file
+#--------------------------------------------------------------------
+function parse_stage_config_path()
+{
+ local file=$1
+ local __tmp __spell __sdate __path
+ __tmp=$(echo $file | sed "s#^$CONFIG_STAGE_DIRECTORY/##")
+ __spell=$(echo $__tmp | cut -d/ -f1)
+ __sdate=$(echo $__tmp | cut -d/ -f2)
+ __path=$(echo $__tmp | cut -d/ -f3-)
+ eval "$2=\"$__spell\""
+ eval "$3=\"$__sdate\""
+ eval "$4=\"$__path\""
+}
+
+#--------------------------------------------------------------------
+## Override the merging menu and always use a preset action
+##
+## @param action
+#--------------------------------------------------------------------
+function override_changed_config_menu()
+{
+
+ case $1 in
+ discard-new) DEFAULT_CHANGED_CONFIG_ACTION=3 ;;
+ discard-old) DEFAULT_CHANGED_CONFIG_ACTION=0 ;;
+ use-old) DEFAULT_CHANGED_CONFIG_ACTION=2 ;;
+ use-new) DEFAULT_CHANGED_CONFIG_ACTION=1 ;;
+ *) error_message "${PROBLEM_COLOR}Bad default merge
action!$DEFAULT_COLOR"
+ help ;;
+ esac
+ PROMPT_DELAY=0
+
+}
+
+#--------------------------------------------------------------------
+## Final check for removing empty spell directories, so the stage dir
+## is left clean
+#--------------------------------------------------------------------
+function final_cleanup()
+{
+ find $CONFIG_STAGE_DIRECTORY -mindepth 1 -maxdepth 2 -type d -empty -delete
+}
+
+#--------------------------------------------------------------------
+## merge only the passed file
+##
+## @param config
+#--------------------------------------------------------------------
+function merge_single_file()
+{
+ local file=$1 spell sdate target nice_date
+
+ parse_stage_config_path $file spell sdate target &&
+ if [[ -f $file && $target ]]
+ then
+ # make the $sdate human readable
+ # date -d can't use the whole original, so we have to do it in steps
+ nice_date=$(date -d ${sdate:0:8} "+%a %d %b %Y")
+ nice_date="$nice_date $(date -d ${sdate:8:4} "+%X %Z")"
+ message "${SPELL_COLOR}$spell$DEFAULT_COLOR cast on $nice_date has
config"
+ message "${FILE_COLOR}$file$DEFAULT_COLOR"
+ message "to be merged with $FILE_COLOR/$target${DEFAULT_COLOR}\n"
+ tablet_set_spell $spell &&
+ install_config_file $file $INSTALL_ROOT/$target
+ recursive_config_stage_cleanup $file $spell
+ echo -e "\n"
+ fi
+}
+
+#--------------------------------------------------------------------
+## merge only the passed files or spells
+##
+## @param spell/config
+## @param ...
+#--------------------------------------------------------------------
+function confmeld_partial()
+{
+ local thing config configs rc=0
+
+ for thing in "$@"; do
+ if codex_does_spell_exist $thing &> /dev/null; then
+ # we got a spell
+ configs=$(find $CONFIG_STAGE_DIRECTORY/$thing -type f)
+ else
+ # we got a config or three
+ configs=$(find $CONFIG_STAGE_DIRECTORY -type f -wholename "*$thing")
+ if [[ -z $configs ]]; then
+ error_message "${PROBLEM_COLOR}No such spell or
config:$DEFAULT_COLOR $thing"
+ rc=1
+ break
+ fi
+ fi
+ for config in $configs; do
+ merge_single_file "$config"
+ done
+ done
+ final_cleanup
+
+ exit $rc
+}
+
+#--------------------------------------------------------------------
+## merge all the staged configs
+#--------------------------------------------------------------------
+function confmeld_all()
+{
+ local spell
+
+ for file in $(all_config_files)
+ do
+ merge_single_file "$file"
+ done
+
+ final_cleanup
+}
+
+function process_parameters()
+{
+ local subroutine arguments
+ while [[ -n $1 ]]; do
+ if [[ ${1:0:1} == "-" ]]; then
+ case "$1" in
+ --help|-h) help ;;
+ --no-column|-q) USE_COLUMN=no ;;
+ --list-configs|-c) subroutine=list_staged_configs ;;
+ --list-spells|-s) subroutine=list_spells_with_staged_configs ;;
+ --list|-l) subroutine=list_all ;;
+ --force|-f) subroutine="override_changed_config_menu $2"
+ shift ;;
+ *) help ;;
+ esac
+ else
+ arguments="$1 $arguments"
+ fi
+ shift
+ done
+ $subroutine
+
+ [[ $arguments ]] && confmeld_partial $arguments
+}
+
+#--------------------------------------------------------------------
+## Main
+##
+## If there's no arguments get all the config files and start installing
+## them to the system using install_config_file
+#--------------------------------------------------------------------
+function main()
+{
+ local target spell sdate
+ local last_spell=""
+ local last_sdate=""
+
+ process_parameters "$@"
+
+ confmeld_all
+}
+
+
+. /etc/sorcery/config
+if [ "$UID" -gt 0 ]; then
+ echo "Enter the root password, please."
+ exec su -c "confmeld $@" root
+else
+ STAGED_INSTALL="off"
+ main "$@"
+fi
+
+#---------------------------------------------------------------------
+##=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/usr/sbin/delve b/usr/sbin/delve
index fb63e04..9598b9d 100755
--- a/usr/sbin/delve
+++ b/usr/sbin/delve
@@ -71,23 +71,30 @@ EOF
## 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)"
+
+ save_bin_lib_paths

# these have to go somewhere where future delves can find them
- C_LOG=/tmp/sorcery/delve/$SPELL.compile.log
- C_FIFO=/dev/stdout
- IW_LOG="/tmp/sorcery/delve/$SPELL.iw"
- VOYEUR_STDOUT=/dev/stdout
- VOYEUR_STDERR=/dev/stderr
+ C_LOG=${C_LOG:="/tmp/sorcery/delve/$SPELL.compile.log"}
+ CASTFS_DBGLOG=${CASTFS_DBGLOG:="/tmp/sorcery/delve/$SPELL.iwdbglog"}
+ C_FIFO=${C_FIFO:="/dev/stdout"}
+ IW_LOG=${IW_LOG:="/tmp/sorcery/delve/$SPELL.iw"}
+ VOYEUR_STDOUT=${VOYEUR_STDOUT:="/dev/stdout"}
+ VOYEUR_STDERR=${VOYEUR_STDERR:="/dev/stderr"}
+ S_PWD=${S_PWD:="/tmp/sorcery/delve/$SPELL.pwd"}
touch $C_LOG

}
@@ -133,10 +140,6 @@ function delve_config_loc() {
function delve_build() {
debug "delve" "Running $FUNCNAME"
delve_is_valid_step BUILD 1 2 || return 1
- [ -d $SOURCE_DIRECTORY ] || {
- message "Ack! there is no $SOURCE_DIRECTORY"
- return 1
- }
delve_log_helper
(
run_build
@@ -146,7 +149,7 @@ function delve_build() {

function delve_pre_install() {
debug "delve" "Running $FUNCNAME"
- delve_is_valid_step BUILD 2 || return 1
+ delve_is_valid_step PRE_INSTALL 2 || return 1
delve_log_helper
(
run_pre_install
@@ -157,23 +160,76 @@ function delve_pre_install() {
function delve_install() {
debug "delve" "Running $FUNCNAME"

- delve_is_valid_step BUILD 2 || return 1
+ delve_is_valid_step INSTALL 2 || return 1
delve_log_helper
- [ -d $SOURCE_DIRECTORY ] || {
- message "Ack! there is no $SOURCE_DIRECTORY"
- return 1
- }
- cd $SOURCE_DIRECTORY
+ if [[ "$STAGED_INSTALL" != "off" ]]
+ then
+ if [[ -z "$CHROOT_CHECK" ]]
+ then
+ prepare_stage_root &&
+ invoke_stage_root &&
+ export CHROOT_CHECK="true"
+ CHROOT_CMD="chroot ${STAGE_DIRECTORY}/MOUNT"
+ fi
+ INSTALL_ROOT=""
+ else
+ invoke_installwatch
+ fi
+ (
+ if [[ -z "$CHROOT_CMD" ]]
+ then
+ run_install || return 2
+ else
+ $CHROOT_CMD delve $SPELL INSTALL
+ fi
+ ) 2> >(tee -a $C_LOG 1>&2 > $VOYEUR_STDERR) \
+ > >(tee -a $C_LOG > $VOYEUR_STDOUT)
+ local rc=$?
+ if [[ $CHROOT_CMD ]]
+ then
+ devoke_stage_root
+ fi &&
+ return $rc
+}
+
+function delve_install_extras() {
+ debug "delve" "Running $FUNCNAME"
+
+ delve_is_valid_step INSTALL_EXTRAS 2 || return 1
+ delve_log_helper
+ if [[ "$STAGED_INSTALL" != "off" ]]
+ then
+ if [[ -z "$CHROOT_CHECK" ]]
+ then
+ invoke_stage_root &&
+ export CHROOT_CHECK="true"
+ CHROOT_CMD="chroot ${STAGE_DIRECTORY}/MOUNT"
+ fi
+ INSTALL_ROOT=""
+ else
+ invoke_installwatch
+ fi
(
- run_install
+ if [[ -z "$CHROOT_CMD" ]]
+ then
+ run_install_extras || return 2
+ else
+ $CHROOT_CMD delve $SPELL INSTALL_EXTRAS
+ fi
) 2> >(tee -a $C_LOG 1>&2 > $VOYEUR_STDERR) \
> >(tee -a $C_LOG > $VOYEUR_STDOUT)
+ local rc=$?
+ if [[ $CHROOT_CMD ]]
+ then
+ devoke_stage_root
+ fi &&
+ return $rc
}

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

- delve_is_valid_step BUILD 1 || return 1
+ delve_is_valid_step POST_BUILD 1 || return 1
delve_log_helper
[ -d $SOURCE_DIRECTORY ] || {
message "Ack! there is no $SOURCE_DIRECTORY"
@@ -188,28 +244,30 @@ function delve_post_build() {

function delve_post_install() {
debug "delve" "Running $FUNCNAME"
- delve_is_valid_step BUILD 1 2 || return 1
+ delve_is_valid_step POST_INSTALL 1 2 || return 1
delve_log_helper
- [ -d $SOURCE_DIRECTORY ] || {
- message "Ack! there is no $SOURCE_DIRECTORY"
- return 1
- }
- [ "$BUILD_API" == "2" ] && cd $SOURCE_DIRECTORY # dirty hack
(
run_post_install
) 2> >(tee -a $C_LOG 1>&2 > $VOYEUR_STDERR) \
> >(tee -a $C_LOG > $VOYEUR_STDOUT)
+}

+function delve_transfer() {
+ debug "delve" "Running $FUNCNAME"
+ delve_is_valid_step TRANSFER 2 || return 1
+ delve_log_helper
+ (
+ run_transfer
+ ) 2> >(tee -a $C_LOG 1>&2 > $VOYEUR_STDERR) \
+ > >(tee -a $C_LOG > $VOYEUR_STDOUT)
}

function delve_final() {
debug "delve" "Running $FUNCNAME"
- delve_is_valid_step BUILD 2 || return 1
+ delve_is_valid_step FINAL 2 || return 1
delve_log_helper
- [ -d $SOURCE_DIRECTORY ] || {
- message "Ack! there is no $SOURCE_DIRECTORY"
- return 1
- }
+ devoke_installwatch &&
+ STAGED_INSTALL=off
(
run_final
) 2> >(tee -a $C_LOG 1>&2 > $VOYEUR_STDERR) \
@@ -248,9 +306,9 @@ function delve_make_continuation() {
local begin=$1
local end=$2
local API1="start PRE_BUILD config_loc BUILD POST_BUILD POST_INSTALL
TRIGGERS end"
- local API2="start PRE_BUILD config_loc BUILD PRE_INSTALL INSTALL
POST_INSTALL FINAL TRIGGERS end"
+ local API2="start PRE_BUILD config_loc BUILD PRE_INSTALL INSTALL
INSTALL_EXTRAS POST_INSTALL TRANSFER FINAL TRIGGERS end"
local THIS_API
- case $BUILD_API in
+ case $BUILD_API in
1) THIS_API=$API1 ;;
2) THIS_API=$API2 ;;
*) message "Unknown api for spell $SPELL: \"$BUILD_API\"" ; return 1;;
@@ -272,6 +330,7 @@ function delve_make_continuation() {
phase=2
break
fi
+ ;;
esac
done
if [ $phase != 2 ] ; then
@@ -300,14 +359,16 @@ function process_parameters() {
PRE_INSTALL) STATES="$STATES $param" ;;
INSTALL) STATES="$STATES $param" ;;
POST_BUILD) STATES="$STATES $param" ;;
+ INSTALL_EXTRAS) STATES="$STATES $param" ;;
POST_INSTALL) STATES="$STATES $param" ;;
+ TRANSFER) STAGES="$STAGES $param" ;;
FINAL) STATES="$STATES $param" ;;
TRIGGERS) STATES="$STATES $param" ;;
success) STATES="$STATES $param" ;;
failure) STATES="$STATES $param" ;;
end) STATES="$STATES $param" ;;
all) ALL=on ;;
- *) SPELL=$param
+ *) SPELL=$param ;;
esac
done
}
@@ -332,11 +393,21 @@ function main() {
STATES=$(delve_make_continuation start end)
fi

- echo "DEBUG: $STATES"
+ if [[ -z $CHROOT_CHECK ]]
+ then
+ if [[ -z $STAGED_INSTALL ]]
+ then
+ if ! is_castfs_installed
+ then
+ STAGED_INSTALL=off
+ else
+ STAGED_INSTALL=on
+ fi
+ fi
+ fi

local last_rc=0
for STATE in $STATES; do
- message "Running state $STATE"
case $STATE in
start) ;;
PRE_BUILD) delve_pre_build ;;
@@ -345,7 +416,9 @@ function main() {
PRE_INSTALL) delve_pre_install ;;
INSTALL) delve_install ;;
POST_BUILD) delve_post_build ;;
+ INSTALL_EXTRAS) delve_install_extras ;;
POST_INSTALL) delve_post_install ;;
+ TRANSFER) delve_transfer ;;
FINAL) delve_final ;;
TRIGGERS) delve_triggers ;;
success) delve_spell_success ;;
@@ -370,7 +443,7 @@ elif [[ $1 == -h ]] || [[ $1 == --help ]] ; then
help
elif [ "$UID" -gt 0 ]; then
echo "Enter the root password, please."
PARAMS=$(consolidate_params "$@")
- su -c "$0 $PARAMS" root
+ exec su -c "delve $PARAMS" root
else
# Make a nice dir structure to put stuff in, this exits if it fails
mk_tmp_dirs delve
diff --git a/usr/sbin/dispel b/usr/sbin/dispel
index 3bf3edb..879c0e7 100755
--- a/usr/sbin/dispel
+++ b/usr/sbin/dispel
@@ -10,60 +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.
+ 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

@@ -90,7 +93,6 @@ function downgrade() {
fi

if spell_installed $SPELL; then
- previously_installed=yes
dispel_spell $SPELL
if [ $? != 0 ] ; then
message "${PROBLEM_COLOR}Unable to downgrade" \
@@ -116,33 +118,9 @@ function downgrade() {
return 1
fi

- pushd $INSTALL_ROOT/ &>/dev/null
- if [ -n "$EXTENSION" ]; then
- $COMPRESSBIN -cd $CACHE_COMP | tar -Px
- else
- tar -Pxf $CACHE_COMP
- fi
- popd &>/dev/null
-
- codex_set_current_spell_by_name $SPELL
+ SUCCESS_LIST=/dev/null
+ resurrect $SPELL $REQUESTED_VERSION

- add_spell $SPELL installed $REQUESTED_VERSION
- if [[ $previously_installed ]] ; then
- message "${RESURRECT_COLOR}Downgraded:" \
- "${SPELL_COLOR}${SPELL}" \
- "${DEFAULT_COLOR}" \
- "to version" \
- "${VERSION_COLOR}${REQUESTED_VERSION}" \
- "${DEFAULT_COLOR}"
- else
- message "${RESURRECT_COLOR}Installed:" \
- "${SPELL_COLOR}${SPELL}" \
- "${DEFAULT_COLOR}" \
- "to version" \
- "${VERSION_COLOR}${REQUESTED_VERSION}" \
- "${DEFAULT_COLOR}"
- fi
- activity_log "cast" "$SPELL" "$REQUESTED_VERSION" "success"
return 0
}

@@ -190,7 +168,7 @@ function process_parameters() {
shift 1 ;;
--user-child-deps) validate_param "$ORPHAN_MENU_DEFAULT" ORPHAN_DEFAULT
validate_param "$NONORPHAN_MENU_DEFAULT"
NONORPHAN_DEFAULT
- shift ;;
+ shift ;;
--recast-parent) validate_param $2 RECAST_PARENT_DEFAULT
shift ;;
--dispel-parent) validate_param $2 DISPEL_PARENT_DEFAULT
@@ -199,9 +177,10 @@ function process_parameters() {
RECAST_PARENT_DEFAULT
validate_param "$DISPEL_PARENT_MENU_DEFAULT" \
DISPEL_PARENT_DEFAULT
- shift ;;
+ shift ;;
--debug-dispel) DEBUG_DISPEL=yes ; shift 1 ;;
- *) help ;;
+ --total-dispel) TOTAL_DISPEL=yes ; shift 1 ;;
+ *) help ;;
esac
else
shift
@@ -241,6 +220,7 @@ function strip_parameters() {
--dispel-parent) shift 2 ;;
--user-parent-deps) shift 1 ;;
--debug-dispel) shift 1 ;;
+ --total-dispel) shift 1 ;;
*) shift 1 ;;
esac
else
@@ -251,6 +231,37 @@ function strip_parameters() {
}

#---------------------------------------------------------------------
+## Display what dependencies were removed
+#---------------------------------------------------------------------
+function dispel_parents_list_borkers() {
+ local parent=$1
+ local optional_borkers=$2
+ local runtime_borkers=$3
+ local suggested_borkers=$4
+ if [[ "$optional_borkers" ]] ; then
+ message "${SPELL_COLOR}${parent}${DEFAULT_COLOR}${MESSAGE_COLOR}" \
+ "had the following optional dependencies
removed:${DEFAULT_COLOR}"
+ message "${SPELL_COLOR}"
+ echo $optional_borkers | col
+ message "${DEFAULT_COLOR}"
+ fi
+ if [[ "$runtime_borkers" ]] ; then
+ message "${SPELL_COLOR}${parent}${DEFAULT_COLOR}${MESSAGE_COLOR}" \
+ "had the following runtime dependencies removed:${DEFAULT_COLOR}"
+ message "${SPELL_COLOR}"
+ echo $runtime_borkers | col
+ message "${DEFAULT_COLOR}"
+ fi
+ if [[ "$suggested_borkers" ]] ; then
+ message "${SPELL_COLOR}${parent}${DEFAULT_COLOR}${MESSAGE_COLOR}" \
+ "had the following suggested dependencies
removed:${DEFAULT_COLOR}"
+ message "${SPELL_COLOR}"
+ echo $suggested_borkers | col
+ message "${DEFAULT_COLOR}"
+ fi
+}
+
+#---------------------------------------------------------------------
## @param spell to dispel
##
## Frontend to do common things for dispelling (keep a note of what
@@ -333,10 +344,10 @@ function dispel_children() {
## 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
@@ -368,8 +379,8 @@ function dispel_child_query() {
## 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
@@ -414,9 +425,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.
##
@@ -441,7 +452,7 @@ function get_borked_parents() {
## 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() {

@@ -489,26 +500,32 @@ function dispel_depends_engine() {
# for all borked spells either recast, dispel, or ignore
for parent in $(hash_get_table_fields BORKED_PARENTS) ; do
message "$parent is borked because of $(hash_get BORKED_PARENTS
$parent)"
- recastable=yes
+ local recastable=yes
borkers=$(hash_get BORKED_PARENTS $parent)
- local non_optional_borkers
+ local non_optional_borkers suggested_borkers runtime_borkers type
# if any of the removed children are required depends of the current
# spell, the spell is not recastable
# note: this doesnt take into account the spell changing out from
# under us. Oh well.
for child in $borkers; do
- if [[ $(grep "$parent:$child\(([^:]*)\)\?:on:required"
$DEPENDS_STATUS) ]] ; then
+ type=$(grep -m 1 "$parent:$child\(([^:]*)\)\?:on"
$DEPENDS_STATUS|cut -f4 -d:)
+ if [[ "$type" == required ]]; then
recastable=no
list_add non_optional_borkers $child
+ elif [[ "$type" == "runtime" ]] ; then
+ [[ "$recastable" != no ]] && recastable=NA
+ list_add runtime_borkers $child
+ elif [[ "$type" == "suggest" ]] ; then
+ [[ "$recastable" != no ]] && recastable=NA
+ list_add suggested_borkers $child
+ else
+ list_add optional_borkers $child
fi
done
if [[ $recastable == yes ]] ; then
- message "${SPELL_COLOR}${parent}${DEFAULT_COLOR}${MESSAGE_COLOR}" \
- "had the following optional depends removed:${DEFAULT_COLOR}"
- message "${SPELL_COLOR}"
- echo $borkers | col
- message "${DEFAULT_COLOR}"
- if dispel_parent_query \
+ dispel_parents_list_borkers $parent "$optional_borkers" \
+ "$runtime_borkers" "$suggested_borkers"
+ if [[ $optional_borkers ]] && dispel_parent_query \
"Re-cast $parent without these optional depends?" \
"$RECAST_PARENT_DEFAULT" ; then
# fix up the abandoned depends data for impending recompile
@@ -536,7 +553,7 @@ function dispel_depends_engine() {
done

list_add NEW_CASTS $parent
- elif dispel_parent_query "Dispel $parent instead?" \
+ elif dispel_parent_query "Dispel $parent?" \
"$DISPEL_PARENT_DEFAULT" ; then

foo=$(hash_get down_deps $parent)
@@ -548,12 +565,8 @@ function dispel_depends_engine() {
message "Please fix broken dependencies with cleanse --prune"
fi
else
- message "${SPELL_COLOR}${parent}${DEFAULT_COLOR}${MESSAGE_COLOR}" \
- "had the following non-optional depends removed:" \
- "${DEFAULT_COLOR}"
- message "${SPELL_COLOR}"
- echo $non_optional_borkers | col
- message "${DEFAULT_COLOR}"
+ dispel_parents_list_borkers $parent "$optional_borkers" \
+ "$runtime_borkers" "$suggested_borkers"
if dispel_parent_query "Dispel $parent?" \
"$DISPEL_PARENT_DEFAULT"; then

@@ -602,13 +615,13 @@ function main() {
if [[ $DO_DEPENDS ]] ; then
while [[ $SPELLS ]] ; do
debug dispel "recomputing depends tree"
- compute_installed_depends down_deps
- compute_reverse_installed_depends up_deps
+ compute_installed_depends down_deps all
+ compute_reverse_installed_depends up_deps all
dispel_depends_engine "$SPELLS" SPELLS
debug dispel "SPELLS $SPELLS"
done
else
- for SPELL in $SPELLS; do
+ for SPELL in $SPELLS; do
dispel_spell_wrapper $SPELL ||
DISPEL_EXIT_STATUS=${DISPEL_EXIT_STATUS:-$?}
done
@@ -620,16 +633,16 @@ function main() {

if [ $# == 0 ]; then help | $PAGER
elif [[ $1 == -h ]] || [[ $1 == --help ]] ; then help
-elif [ "$UID" == 0 ]; then
+elif [ "$UID" == 0 ]; then
mk_tmp_dirs dispel
main "$@"
rc=$?
cleanup_tmp_dir $TMP_DIR
exit $rc
-else
+else
echo "Enter the root password, please." 1>&2
PARAMS=$(consolidate_params "$@")
- su -c "$0 $PARAMS" root
+ exec su -c "dispel $PARAMS" root
fi


diff --git a/usr/sbin/gaze b/usr/sbin/gaze
index 9914d9f..471fc0a 100755
--- a/usr/sbin/gaze
+++ b/usr/sbin/gaze
@@ -14,107 +14,108 @@ 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 the 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
NOTE: the target spell must be installed and
only enabled dependencies are shown

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

-show-held Shows all held spells.
+system-info Show information about a Source Mage system

-show-exiled Shows all exiled spells.
+show-held Shows all held spells.
+
+show-exiled Shows all exiled spells.

EOF
}
@@ -131,7 +132,7 @@ function maybe_column() {
}

#-----
-## Make building multiple identical systems easy with exporint of a
+## Make building multiple identical systems easy with exporint of a
## snapshot of the current state.
## <p>Is this actualy used for anything still? Does it work?
#-----
@@ -164,7 +165,7 @@ function export_snapshot() {
else
tar -cf $SNAPSHOT snapshot
fi
-
+
rm_source_dir $SOURCE_DIRECTORY
echo "$SNAPSHOT created."

@@ -256,15 +257,15 @@ function alien() {
rm -f $TMP_DIR/gaze.found
rm -f $TMP_DIR/gaze.known

- [[ $GAZE_VERBOSE != 0 ]] &&
+ [[ $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 ]] &&
+ [[ $GAZE_VERBOSE != 0 ]] &&
message "Discovering ambient files..."
- find $TRACKED | files | filter "$EXCLUDED" | sort
>$TMP_DIR/gaze.found
-
+ find $GAZE_ALIEN_PATHS | files | filter "$EXCLUDED" | sort
>$TMP_DIR/gaze.found
+
diff -B -a -d $TMP_DIR/gaze.found $TMP_DIR/gaze.known |
grep -v "^> " |
grep "^< " |
@@ -291,7 +292,7 @@ function gaze_catalog() {
if [[ $? != 0 ]]; then
echo "No such grimoire $1"
exit 1;
- fi
+ fi
fi

[[ $GAZE_VERBOSE != 0 ]] && echo "Sorcery Grimoire for `date -u`"
@@ -306,9 +307,9 @@ function gaze_catalog() {

for SECTION in `codex_get_all_sections $grimoire`; do
if [[ $GAZE_VERBOSE != 0 ]]; then
- echo
+ echo
echo "-------------------------------------------------"
- echo "SECTION: $( basename $SECTION )"
+ echo "SECTION: $( basename $SECTION )"
echo "-------------------------------------------------"
else
echo
@@ -338,7 +339,7 @@ function gaze_catalog_html() {
shift;
(( COLS++ ))
fi
-
+
if [[ $# -gt 0 ]]; then
grimoire=$(codex_find_grimoire $1)
if [[ $? != 0 ]]; then
@@ -461,20 +462,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>"
@@ -484,7 +485,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
@@ -516,8 +517,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
@@ -641,7 +642,7 @@ function show_spell_component() {

#-----------------------------------------------------------------------
## parameter processing for the search routines.
-## the case statement should be self-explanatory
+## the case statement should be self-explanatory
## @param (optional) Type pf search (-name or -short)
## @param words to search for
#-----------------------------------------------------------------------
@@ -658,7 +659,7 @@ function gaze_search() {
#-----------------------------------------------------------------------
##
## searches for pattern(s) in the name of all spells.
-## it searches in the codex.index files for the sake of speed
+## it searches in the codex.index files for the sake of speed
##
## @Args Patterns
##
@@ -678,10 +679,10 @@ function real_name_search() {
print $1
}
else {
- print "'"$pattern"' -> ", $1
+ print "'"$pattern"' -> ", $1
}
}
- ' "$grimoire/$SPELL_INDEX_FILE"
+ ' "$grimoire/$SPELL_INDEX_FILE" 2>/dev/null
done
done
}
@@ -690,7 +691,7 @@ function real_name_search() {
#-----------------------------------------------------------------------
##
## Searches for something in a specified grimoire. Not really sure what
-## it looks for or why.
+## it looks for or why.
##
## @param Path to grimoire
## @param Spell to look for
@@ -708,7 +709,7 @@ function grep_find_grimoire() {

#-----------------------------------------------------------------------
##
-## searches for pattern(s) in the SHORT field of every SPELL in every
+## searches for pattern(s) in the SHORT field of every SPELL in every
## grimoire
##
## @Args Patterns
@@ -727,7 +728,7 @@ function real_short_search() {
if [[ $GAZE_VERBOSE == 0 ]]; then
echo $spellname
else
- echo "$pattern -> $spellname"
+ echo "$pattern -> $spellname"
fi

done
@@ -739,7 +740,7 @@ function real_short_search() {

#-----------------------------------------------------------------------
##
-## searches for pattern(s) in the long description of every SPELL in every
+## searches for pattern(s) in the long description of every SPELL in every
## grimoire
##
## @Args Patterns
@@ -751,7 +752,7 @@ function real_long_search() {
local SEARCH SEARCH_RESULTS

if ! [[ $GAZE_VERBOSE == 0 ]] ; then
- echo "Searching... "
+ echo "Searching... "
fi

let i=0
@@ -851,7 +852,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
}
@@ -943,31 +944,33 @@ function gaze_show_website() {

#---------------------------------------------------------------------
##
-## Shows the maintainer for the given spell.
-## @param Spell
+## Shows the maintainer for the given section.
+## @param section
##
#---------------------------------------------------------------------
function show_maintainer() {

- for section in $@; do
- ! [[ $GAZE_VERBOSE == 0 ]] &&
- message "${SPELL_COLOR}${section}:${DEFAULT_COLOR}"
- SECTION=`codex_find_section_by_name $section`
-
- if [ -d "$SECTION" ]; then
+ local section="$1"

- if [ -f "$SECTION/MAINTAINER" ]; then
- cat $SECTION/MAINTAINER
+ {
+ echo "Grimoire|Section|Maintainer"
+ echo "--------|-------|----------"
+
+ for GRIMOIRE in $(codex_get_all_grimoires); do
+ codex_set_grimoires $GRIMOIRE
+ SECTION=`codex_find_section_by_name $section`
+ if [[ -d "$SECTION" ]]; then
+ if [[ -f "$SECTION/MAINTAINER" ]]; then
+ echo "$(smgl_basename
${GRIMOIRE})|$section|$(<$SECTION/MAINTAINER)"
+ else
+ echo "$(smgl_basename ${GRIMOIRE})|$section|-"
+ fi
else
- echo "No maintainer available for section '$( basename $SECTION )'"
+ echo "$(smgl_basename ${GRIMOIRE})|-|-"
fi
-
- else
-
- echo "No such section"
-
- fi
- done
+ codex_set_grimoires $GRIMOIRES
+ done
+ } | maybe_column -t -s "|"

}

@@ -1018,13 +1021,13 @@ function gaze_show_section_version_table() {
echo "Grimoire|Section|Spell|Grimoire Version|Installed Version"
echo "--------|-------|-----|----------------|-----------------"

- for spell in $SPELLS; do
+ for spell in $SPELLS; do

codex_set_current_spell $spell &&
- local INSTALLED=`installed_version $SPELL` &&
+ local INSTALLED=`installed_version $SPELL` &&
echo
"$GRIMOIRE_NAME|$SECTION|$SPELL|${VERSION:="-"}|${INSTALLED:="-"}"

- done
+ done

) | maybe_column -t -s "|"

@@ -1034,7 +1037,7 @@ function gaze_show_section_version_table() {
#---------------------------------------------------------------------
##
## Shows the versions of spells, both the version in the grimoire and
-## the version installed on the system.
+## the version installed on the system.
## @param Spell
## @param ...
##
@@ -1042,16 +1045,16 @@ function gaze_show_section_version_table() {
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
+
+ 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
+ done

) | maybe_column -t -s "|"

@@ -1061,13 +1064,13 @@ function gaze_show_spell_version_table() {
#---------------------------------------------------------------------
##
## Shows the versions of spells, both the version in the grimoire and
-## the version installed on the system.
+## the version installed on the system.
## @param Spell or section
## @param ...
##
#---------------------------------------------------------------------
function gaze_show_version() {
-
+
local SPELLS_AND_SECTIONS=$@
local SPELLS=
local UNKNOWN=
@@ -1085,7 +1088,7 @@ function gaze_show_version() {

else
UNKNOWN="$spell_or_section $UNKNOWN"
- fi
+ fi

done

@@ -1107,7 +1110,7 @@ function gaze_show_version() {

#---------------------------------------------------------------------
##
-## Shows the all versions of spell, all versions in all grimoires and
+## Shows the all versions of spell, all versions in all grimoires and
## the version installed on the system.
## @param Spell
##
@@ -1140,8 +1143,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
@@ -1158,6 +1161,61 @@ function gaze_show_versions() {
echo
}

+#---------------------------------------------------------------------
+##
+## Shows the all versions of spell, all versions in all grimoires and
+## the version installed on the system.
+## @param Spell
+##
+#---------------------------------------------------------------------
+function gaze_show_patchlevels() {
+
+ local SPELL=$1
+
+ if ! codex_does_spell_exist $SPELL
+ then return 1
+ fi
+
+ local TB_DIR
+
+ 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 " | |Regular |Security |Regular |Security"
+ echo " | |Patchlevel|Patchlevel|Patchlevel|Patchlevel"
+ echo "--------|-----|----------|----------|----------|----------"
+
+ for GRIMOIRE in $(codex_get_all_grimoires)
+ do
+ if SPELL_DIRECTORY=$(codex_cache_spell_lookup $SPELL $GRIMOIRE)
+ then
+ codex_set_current_spell $SPELL_DIRECTORY
+
+ if [ $ECHO_INSTALLED -eq 1 ]; then
+ echo
"$GRIMOIRE_NAME|$SPELL|${PATCHLEVEL:-"0"}|${SECURITY_PATCH:-"0"}|${I_PATCH:-0}|${I_SPATCH:-0}"
+ ECHO_INSTALLED=0
+ else
+ echo
"$GRIMOIRE_NAME|$SPELL|${PATCHLEVEL:-0}|${SECURITY_PATCH:-0}|-|-"
+ fi
+
+ else
+ echo "$(basename $GRIMOIRE)|-|-|-|-|-"
+ fi
+ done
+
+ ) | maybe_column -t -s "|"
+
+ echo
+}


#---------------------------------------------------------------------
@@ -1176,12 +1234,12 @@ function gaze_show_section_license_table() {
echo "Section|Spell|License(s)"
echo "-------|-----|----------"

- for spell in $SPELLS; do
+ for spell in $SPELLS; do

codex_set_current_spell $spell &&
echo "$SECTION|$SPELL|${LICENSE[@]}"

- done
+ done

) | maybe_column -t -s "|"

@@ -1200,13 +1258,13 @@ function gaze_show_spell_license_table() {
(
echo "Spell|License(s)"
echo "-----|----------"
-
- for SPELL in $@; do
+
+ for SPELL in $@; do

codex_set_current_spell $SPELL &&
echo "$SPELL|${LICENSE[@]}"

- done
+ done

) | maybe_column -t -s "|"

@@ -1217,7 +1275,7 @@ function gaze_show_spell_license_table() {
##
## Shows the information about the given licenses.
## @param Licence
-## @param ...
+## @param ...
##
#---------------------------------------------------------------------
function gaze_show_license_table() {
@@ -1225,11 +1283,11 @@ function gaze_show_license_table() {
echo "Abbr|License Full Name|URL"
echo "----|-----------------|---"

- for LICENSE in $@; do
+ for LICENSE in $@; do

grep -i "^$LICENSE|" ${SM_LICENSE_LIST} 2> /dev/null

- done
+ done

) | maybe_column -t -s "|"

@@ -1259,7 +1317,7 @@ function gaze_show_grimoires() {
##
#---------------------------------------------------------------------
function gaze_show_license() {
-
+
local SPELLS_AND_SECTIONS_AND_LICENSES=$@
local SPELLS=
local LICENSES=
@@ -1280,7 +1338,7 @@ function gaze_show_license() {
LICENSES="$LICENSES $spell_section_or_license"
else
UNKNOWN="$spell_section_or_license $UNKNOWN"
- fi
+ fi

done

@@ -1349,7 +1407,7 @@ function gaze_show_short_description() {
{ message "No details found"
return 1
}
- else
+ else
message "$spell -> no such spell"
return 1
fi
@@ -1377,7 +1435,7 @@ function gaze_show_long_description() {
message "No details found" &&
return 1
}
- else
+ else
message "$spell -> no such spell"
return 1
fi
@@ -1435,41 +1493,16 @@ function gaze_show_depends() {
break
done
local spell=$1
- local MAX_DEPTH=$2 #as a global for show_depends.
codex_does_spell_exist "$spell" &&
- if [[ $fast == yes ]] ; then
- fast_up_depends "$spell" | sort
+ if [[ "$GAZE_VERBOSE" == 0 ]] || [[ "$fast" ]]; then
+ show_up_depends "$1" "$2" "$fast"
else
- show_depends "$spell" | sort | uniq
+ show_up_depends "$1" "$2" "verbose"|
+ awk -F: '{ printf("%s depends on %s (%s)\n",$1,$2,$4);}'
fi
-}

-#-----
-## Display the spells that depend on the current spell
-## recurses up the dependency tree
-## @param spell to display
-#-----
-function fast_up_depends () {
- local i=0
- function fast_up_depends_sub () {
- let i++
- [[ $MAX_DEPTH ]] && [[ $i -gt $MAX_DEPTH ]] && return
- for each in $(hash_get foo $1); do
- if ! [[ $(hash_get done $each) ]] ; then
- hash_put done $each done
- echo $each
- fast_up_depends_sub $each
- fi
- done
- }
- hash_reset foo
- hash_reset done
- compute_reverse_installed_depends foo
- fast_up_depends_sub "$1"
- hash_reset foo
- hash_reset done
-}

+}

#-----
##
@@ -1480,7 +1513,7 @@ function fast_up_depends () {
#-----
function gaze_show_dependencies() {
local FOUND SPELL NO_OPTIONALS
-
+
while true; do
# Check for the compact mode flag
if [[ $1 == -c ]] ; then
@@ -1492,7 +1525,7 @@ function gaze_show_dependencies() {
# Check for the no optionals flag
if [[ $1 == --no-optionals ]] ; then
NO_OPTIONALS=yes
- shift
+ shift
continue
fi
break
@@ -1500,7 +1533,7 @@ function gaze_show_dependencies() {

SPELL=$1
codex_does_spell_exist "$SPELL" || exit 1
-
+
[[ $# == 2 ]] && MAX_DEPTH=$2

(
@@ -1508,76 +1541,88 @@ 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"
+ runtime_depends() {
+ [[ $1 == -sub ]] && shift 2
+ recurse "$1" $DEPTH "runtime"
+ return 0
+ }
+ suggest_depends() {
+ [[ $1 == -sub ]] && shift 2
+ recurse "$1" $DEPTH "suggest"
return 0
}
force_depends() {
return 0
}
+ sub_depends() {
+ return 0
+ }
repeat () {
local CHAR="$1" COUNT="$2"
-
+
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
-
- local SPELL=$(codex_find_spell_by_name $name)
- [[ -e "$SPELL/DEPENDS" ]] &&
+ if [[ $found_before ]] ; then
+ return ;
+ elif [[ $FOUND ]] ; then
+ echo "$name" >> $FOUND
+ fi
+
+ 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
}

#-----
@@ -1644,6 +1689,272 @@ function gaze_install() {

#---------------------------------------------------------------------
##
+## used by system_info()
+##
+#---------------------------------------------------------------------
+function figure_installed()
+{
+ local version
+ version=$(installed_version $1)
+ if [ -n "$version" ]; then
+ message "[${version}]"
+ else
+ message "[not installed]"
+ fi
+}
+
+#---------------------------------------------------------------------
+##
+## displays various information about a Source Mage system
+##
+#---------------------------------------------------------------------
+function gaze_system_info()
+{
+ local base_system
+ local cur_spell
+ local section
+ local version
+ local variable
+ local mirror
+ local idx
+ local grimoire
+
+ #---
+ ## Section: ISO VERSION
+ #---
+
+ message -n "${PROBLEM_COLOR}--------------------{"
+ message -n "Section: ISO VERSION"
+ message "}--------------------${DEFAULT_COLOR}"
+
+ if [[ -e /etc/sourcemage-release ]]
+ then
+ cat /etc/sourcemage-release | sed '/^$/d'
+ elif [[ -e /etc/smgl.iso ]]
+ then
+ cat /etc/smgl.iso | sed '/^$/d'
+ else
+ message -n "${MESSAGE_COLOR}Couldn't determine what was used to install "
+ message -n "this system. Consider adding some information to "
+ message "/etc/sourcemage-release${DEFAULT_COLOR}"
+ fi
+
+ #---
+ ## Section: UNAME
+ #---
+
+ message -n "${PROBLEM_COLOR}--------------------{"
+ message -n "Section: UNAME"
+ message "}--------------------${DEFAULT_COLOR}"
+
+ uname -a
+
+ #---
+ ## Section: BASESYSTEM
+ #---
+
+ message -n "${PROBLEM_COLOR}--------------------{"
+ message -n "Section: BASESYSTEM"
+ message "}--------------------${DEFAULT_COLOR}"
+
+ #---
+ ## Need a list of the base spell and ALL of it's DIRECT
+ ## depends(what's in DEPENDS)
+ ## base_system="$(gaze dependencies basesystem 2 | sed
+ ## -e "s/()//" -e 's/ (depends)//' -e 's/ (optional)//' | tr "\n" " " )"
+ #---
+
+ 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
+ #---
+
+ message -n "${PROBLEM_COLOR}--------------------{"
+ message -n "Section: CODEX"
+ message "}--------------------${DEFAULT_COLOR}"
+
+ let idx=0
+ for grimoire in $(codex_get_all_grimoires)
+ do
+ message "${QUERY_COLOR} [$idx]: $(basename
"$grimoire"):${DEFAULT_COLOR}" \
+ "${MESSAGE_COLOR}$grimoire${DEFAULT_COLOR}"
+ let idx+=1
+ done
+
+ #---
+ ## Section: SORCERY CONFIG
+ #---
+
+ message -n "${PROBLEM_COLOR}--------------------{"
+ message -n "Section: SORCERY CONFIG"
+ message "}--------------------${DEFAULT_COLOR}"
+
+ for variable in PROMPT_DELAY DOWNLOAD_RATE PATCH SOUND SORCERER CABAL \
+ NICE SORCERY_BRANCH DEF_INSTALL_INIT DEF_ENABLE_INIT \
+ DEF_INSTALL_XINETD DEF_ENABLE_XINETD DEF_INIT_VS_XINETD \
+ COMPRESSBIN EXTENSION URL_HTTP_FTP_TIMEOUT MD5SUM_DL \
+ GPG_VERIFY_SPELL_LEVEL ARCHIVE AUTOFIX UPDATEFIX AUTOPRUNE
\
+ GATHER_DOCS MAIL_REPORTS VIEW_REPORTS PRESERVE SUSTAIN \
+ TMPFS VOYEUR REAP STORE_CONF_LOG NET_SELECT CONFIG_LOC \
+ CLEAN_SOURCE CROSS_INSTALL SET_TERM_TITLE SCREEN \
+ DEBUG SUPER_DEBUG BUILD_DIRECTORY
+ do
+ message -n "${MESSAGE_COLOR}$variable="
+ message "${QUERY_COLOR}\"${!variable}\"${DEFAULT_COLOR}"
+ done
+
+ #---
+ ## Section: STATE CONFIG
+ #---
+
+ message -n "${PROBLEM_COLOR}--------------------{"
+ message -n "Section: STATE CONFIG"
+ message "}--------------------${DEFAULT_COLOR}"
+
+ for variable in INSTALL_ROOT STATE_ROOT INSTALL_CACHE TRACK_ROOT
+ do
+ message -n "${MESSAGE_COLOR}$variable="
+ message "${QUERY_COLOR}\"${!variable}\"${DEFAULT_COLOR}"
+ done
+
+ #---
+ ## Section: COMPILER CONFIG
+ #---
+
+ message -n "${PROBLEM_COLOR}--------------------{"
+ message -n "Section: COMPILER CONFIG"
+ message "}--------------------${DEFAULT_COLOR}"
+
+ message -n "${MESSAGE_COLOR}SMGL_COMPAT_ARCHS=${DEFAULT_COLOR}"
+ for each in ${SMGL_COMPAT_ARCHS[@]}
+ do
+ message -n "${QUERY_COLOR}${each}${DEFAULT_COLOR}/"
+ done
+ message -n "\n"
+
+ for variable in ARCHITECTURE OPTIMIZATIONS CUSTOM_CFLAGS CUSTOM_CXXFLAGS \
+ CUSTOM_LDFLAGS CFLAGS CXXFLAGS LDFLAGS HOST CCACHE \
+ DISTCC_HOSTS JOBS_PER_HOST MAKE_NJOBS CCACHE_DIR
+ do
+ message -n "${MESSAGE_COLOR}$variable="
+ message "${QUERY_COLOR}\"${!variable}\"${DEFAULT_COLOR}"
+ done
+
+ #---
+ ## Section: VERIFICATION CONFIG
+ #---
+
+ message -n "${PROBLEM_COLOR}--------------------{"
+ message -n "Section: VERIFICATION CONFIG"
+ message "}--------------------${DEFAULT_COLOR}"
+
+ for variable in VRF_ALLOWED_LEVELS VRF_ALLOW_NEW_LEVELS VRF_ALLOWED_HASHES
\
+ VRF_ALLOW_NEW_HASHES GPG_VERIFY_SORCERY GPG_VERIFY_GRIMOIRE
+ do
+ message -n "${MESSAGE_COLOR}$variable="
+ message "${QUERY_COLOR}\"${!variable}\"${DEFAULT_COLOR}"
+ done
+
+ #---
+ ## Section: CLEANSE CONFIG
+ #---
+
+ message -n "${PROBLEM_COLOR}--------------------{"
+ message -n "Section: CLEANSE CONFIG"
+ message "}--------------------${DEFAULT_COLOR}"
+
+ for variable in FIND_CHECK MD5SUM_CHECK LDD_CHECK SYM_CHECK
+ do
+ message -n "${MESSAGE_COLOR}$variable="
+ message "${QUERY_COLOR}\"${!variable}\"${DEFAULT_COLOR}"
+ done
+
+ #---
+ ## Section: DISPEL CONFIG
+ #---
+
+ message -n "${PROBLEM_COLOR}--------------------{"
+ message -n "Section: DISPEL CONFIG"
+ message "}--------------------${DEFAULT_COLOR}"
+
+ for variable in ORPHAN_MENU_DEFAULT NONORPHAN_MENU_DEFAULT \
+ RECAST_PARENT_MENU_DEFAULT DISPEL_PARENT_MENU_DEFAULT
+ do
+ message -n "${MESSAGE_COLOR}$variable="
+ message "${QUERY_COLOR}\"${!variable}\"${DEFAULT_COLOR}"
+ done
+
+ #---
+ ## Section: LOCALE CONFIG
+ #---
+
+ message -n "${PROBLEM_COLOR}--------------------{"
+ message -n "Section: LOCALE CONFIG"
+ message "}--------------------${DEFAULT_COLOR}"
+
+ for variable in LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY \
+ LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE \
+ LC_MEASUREMENT LC_IDENTIFICATION LC_ALL
+ do
+ if [[ ! -z ${!variable} ]]
+ then
+ message -n "${MESSAGE_COLOR}$variable="
+ message "${QUERY_COLOR}\"${!variable}\"${DEFAULT_COLOR}"
+ fi
+ done
+
+ #---
+ ## Section: FACILITIES
+ #---
+
+ message -n "${PROBLEM_COLOR}--------------------{"
+ message -n "Section: FACILITIES"
+ message "}--------------------${DEFAULT_COLOR}"
+
+ cat /etc/sysconfig/facilities | sed -e '/^$/d' -e '/^#.*$/d'
+
+ #---
+ ## Section: MIRRORS
+ #---
+
+ message -n "${PROBLEM_COLOR}--------------------{"
+ message -n "Section: MIRRORS"
+ message "}--------------------${DEFAULT_COLOR}"
+
+ for mirror in APACHE_URL CTAN_URL GNOME_URL GNU_URL KDE_URL KERNEL_URL \
+ PERL_CPAN_URL SORCERY_URL SOURCEFORGE_URL XFREE86_URL
CODEX_URL
+ do
+ message -n "${MESSAGE_COLOR}$mirror="
+ message "${QUERY_COLOR}\"${!mirror}\"${DEFAULT_COLOR}"
+ done
+
+}
+
+#---------------------------------------------------------------------
+##
## prints all spells of a given status.
## @param status - what are we looking for
## @param describe - how is that staus described in english
@@ -1660,7 +1971,7 @@ function gaze_show_spells_by_status () {
parse() {

# Maintain "TMP_DIR is always set as a global" invariant in the case of
- # non-root users, this leaves vague security holes but they're limited
+ # non-root users, this leaves vague security holes but they're limited
# to files the non-root user can access.
# a future goal is to make mk_tmp_dirs work for regular users too...
if [ "$UID" -gt 0 ]; then
@@ -1672,11 +1983,25 @@ parse() {
[[ $UID != 0 ]] && test "$NICE" -lt 0 && NICE=0
renice $NICE -p $$ >/dev/null

- if [ $1 == "-q" ]; then
- shift;
- GAZE_VERBOSE=0
- PAGER=cat
- fi
+ while [[ -n "$1" ]] && [[ ${1:0:1} == "-" ]] ; do
+ case $1 in
+ -q) GAZE_VERBOSE=0
+ PAGER=cat
+ shift
+ ;;
+ -g) for grimoire in $2; do
+ if ! codex_find_grimoire $grimoire >/dev/null; then
+ message "${PROBLEM_COLOR}No such grimoire: " \
+ "${DEFAULT_COLOR}$grimoire"
+ return 1
+ fi
+ codex_set_grimoires $2
+ done
+ shift 2
+ ;;
+ *) help ; exit ;;
+ esac
+ done


SPELL=$2
@@ -1695,6 +2020,7 @@ parse() {
FINAL) show_spell_component $1 $2 ;;
HISTORY) show_spell_component $1 $2 ;;
INSTALL) show_spell_component $1 $2 ;;
+ INSTALL_EXTRAS) show_spell_component $1 $2 ;;
PATCH) show_spell_component $1 $2 ;;
POST_BUILD) show_spell_component $1 $2 ;;
POST_INSTALL) show_spell_component $1 $2 ;;
@@ -1704,8 +2030,13 @@ parse() {
PRE_INSTALL) show_spell_component $1 $2 ;;
PRE_REMOVE) show_spell_component $1 $2 ;;
PRE_RESURRECT) show_spell_component $1 $2 ;;
+ PRE_SUB_DEPENDS) show_spell_component $1 $2 ;;
PREPARE) show_spell_component $1 $2 ;;
PROVIDES) show_spell_component $1 $2 ;;
+ SECURITY) show_spell_component $1 $2 ;;
+ SUB_DEPENDS) show_spell_component $1 $2 ;;
+ TRANSFER) show_spell_component $1 $2 ;;
+ TRIGGER_CHECK) show_spell_component $1 $2 ;;
TRIGGERS) show_spell_component $1 $2 ;;
UP_TRIGGERS) show_spell_component $1 $2 ;;

@@ -1715,9 +2046,11 @@ parse() {
import) import_snapshot $2 ;;
section) shift; gaze_show_section $@ ;;
version) shift; gaze_show_version $@ ;;
- versions) shift; gaze_show_versions $@ ;;
+ versions) shift; gaze_show_versions $@ ;;
+ patchlevels) shift; gaze_show_patchlevels $@ ;;
license) shift; gaze_show_license $@ ;;
alien) alien ;;
+ system-info) gaze_system_info ;;
activity) display $ACTIVITY_LOG ;;
from) show_from $2 ;;
newer) newer $2 ;;
@@ -1770,8 +2103,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/invoke b/usr/sbin/invoke
index cb3cd02..efc0e3e 100755
--- a/usr/sbin/invoke
+++ b/usr/sbin/invoke
@@ -4,7 +4,7 @@
##=head1 SYNOPSIS
##
## invoke the sorcery menuing tool for installed spells.
-## It can be called by the user or by cast
+## It can be called by the user or by cast
##
##=head1 DESCRIPTION
##
@@ -12,7 +12,7 @@
## track of the menu items for installed spells. Displaying
## it's own (dialog, or Xdialog) interface, or generating
## entries into your favorite window managers native menuing
-## system (that part is not implemented yet).
+## system (that part is not implemented yet).
##
##=head1 COPYRIGHT
##
@@ -49,7 +49,7 @@ generate menu_type Generates a menu (see below for
menu types)
(Not Implemented Yet).

update [spell] Updates the scry menu index with all spells
- registered to display in the menu.
+ registered to display in the menu.

"Supported" menu types:

@@ -101,8 +101,8 @@ make_list() {

local section=$1

- #for line in `grep ":$section:" $MENU_STATUS`; do
- function inv104() {
+ #for line in `grep ":$section:" $MENU_STATUS`; do
+ function inv104() {
echo "DEBUG: inside the loop line=$line" >> DEBUG
local spell=`echo $* | cut -d : -f1`
local script_directory=`codex_find_spell_by_name $spell`
@@ -115,7 +115,7 @@ make_list() {
echo $VERSION
echo \"`echo $line | cut -d : -f5`\"
echo \"`echo $line | cut -d : -f5`\" >> DEBUG
- #echo $line | awk -F : '{print $NF;}'
+ #echo $line | awk -F : '{print $NF;}'
fi
}
iterate "inv104" "$ENTER_IFS" `grep ":$section:" $MENU_STATUS`
@@ -127,7 +127,7 @@ process_selection() {

local section=$1
local spell=`esc_str $2`
- local line=`grep "^$spell:" $MENU_STATUS`
+ local line=`grep "^$spell:" $MENU_STATUS`
local command=`echo $line | cut -d : -f4`
$command &

@@ -144,7 +144,7 @@ select_section() {
--menu \
"" \
0 0 10 \
- `show_sections`
+ `show_sections`

}

@@ -155,7 +155,7 @@ show_sections() {

function inv152() {
# Display only unique sections
- if ! [ `echo $found | grep "$1"` ]; then
+ if ! [ `echo $found | grep "$1"` ]; then
found="$1 $found"
echo $1
echo "section"
@@ -177,7 +177,7 @@ update_menu_index() {
cp $MENU_STATUS $MENU_STATUS_BACKUP

local spell=$1
- local section=`find_section $spell`
+ local section=`find_section $spell`
local script_directory=`codex_find_spell_by_name $spell`
if [ -x $script_directory/DETAILS ]; then
. $script_directory/DETAILS > /dev/null
@@ -209,17 +209,17 @@ echo "DEBUG: no"

done
fi
-
+
else

message "${MESSAGE_COLOR}Updating menu index from installed
packages...${DEFAULT_COLOR}"
rm -f $MENU_STATUS_BACKUP
touch $MENU_STATUS_BACKUP
-
+
local line
for line in `cat $SPELL_STATUS`; do
local spell=`echo $line | cut -d : -f1`
- local section=`find_section $spell`
+ local section=`find_section $spell`
local script_directory=`codex_find_spell_by_name $spell`

if [ -x $script_directory/DETAILS ]; then
@@ -251,47 +251,47 @@ generate_menus() {
while [ -n "$1" ]; do

case $1 in
-
+
gnome) generate_gnome_menu shift 1 ;;
kde) generate_kde_menu shift 1 ;;
icewm) generate_icewm_menu shift 1 ;;
windowmaker) generate_windowmaker_menu shift 1 ;;
blackbox) generate_blackbox_menu shift 1 ;;
-
- esac
+
+ esac

done
-
+
}


-generate_gnome_menu() {
- echo "GNOME menus not implemented (yet)"
+generate_gnome_menu() {
+ echo "GNOME menus not implemented (yet)"
if [ "$UID" != 0 ]; then
MENU_DIR='/usr/share/gnome/apps'
- else
+ else
MENU_DIR="$HOME/.gnome/apps"
fi
}


-generate_kde_menu() {
- echo "KDE menus not implemented (yet)"
+generate_kde_menu() {
+ echo "KDE menus not implemented (yet)"
}


-generate_icewm_menu() {
- echo "IceWM menus not implemented (yet)"
+generate_icewm_menu() {
+ echo "IceWM menus not implemented (yet)"
}


-generate_windowmaker_menu() {
- echo "WindowMaker menus not implemented (yet)"
+generate_windowmaker_menu() {
+ echo "WindowMaker menus not implemented (yet)"
MENU_DIR="$HOME/GNUStep/Defaults/WMRootMenu"
}

-generate_blackbox_menu() {
- echo "Blackbox menus not implemented (yet)"
+generate_blackbox_menu() {
+ echo "Blackbox menus not implemented (yet)"
}


@@ -306,7 +306,7 @@ parse_params() {

update) if [ "$UID" != 0 ]; then
echo "Enter the root password, please."
- su -c "$0 $*" root
+ exec su -c "invoke $@" root
fi
update_menu_index $2
;;
diff --git a/usr/sbin/scribbler b/usr/sbin/scribbler
index d103c8c..130ef5c 100755
--- a/usr/sbin/scribbler
+++ b/usr/sbin/scribbler
@@ -27,12 +27,12 @@ Scribbler is a utility for controlling the spells in your
private grimoire.
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
}
@@ -171,7 +171,7 @@ validate_and_parse_args $@
if [ "${UID}" != 0 ]; then
echo "Enter the root password, please:"
PARAMS=$(consolidate_params "$@")
- su -c "$0 $PARAMS" root
+ exec su -c "scribbler $PARAMS" root
fi

main "$@"
diff --git a/usr/sbin/scribe b/usr/sbin/scribe
index e163a22..950bd63 100755
--- a/usr/sbin/scribe
+++ b/usr/sbin/scribe
@@ -2,7 +2,7 @@
#---------------------------------------------------------------------
##
## @scribe
-##
+##
## @Synopsis scribe handles adding/updating/reindexing/etc. of grimoires
##
## @Copyright Original version Copywright 2002 by Ryan Abrams
@@ -26,22 +26,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
+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)

-fix grimoire Attempts to fix metadata for grimoire
-reindex [grimoire] Recreates the list of spells
-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
@@ -69,16 +73,19 @@ function unpackage_grimoire_tarball() {
local tarball=$1
local grimoire=$2
local grim_name=$3
- #untar the new grimoire update and remove zip
- bzcat $tarball| tar -x 1>/dev/null 2>&1
- #check for a successful unzip
- if ! [ -d $grimoire ]; then
- #uh oh! bad unzip.
- error_message "ERROR: Grimoire tarball for $grim_name not" \
- "formated correctly!."
+ #untar the new grimoire tarball
+ if tar -xjf $tarball 1>/dev/null 2>&1; then
+ # ensure the grimoire unpacked where it was expected to
+ if ! [ -d $grimoire ]; then
+ error_message "ERROR: Grimoire tarball for $grim_name not" \
+ "formatted correctly!"
+ return 1
+ fi
+ return 0
+ else
+ error_message "ERROR: Grimoire tarball for $grim_name did not unpack
properly!"
return 1
- fi
- return 0
+ fi
}

#---------------------------------------------------------------------
@@ -175,7 +182,7 @@ function scribe_add() {
scribe_add_update_worker "$grimoire" "$from" add
done
}
-
+
#---------------------------------------------------------------------
## scribe_add_worker
##
@@ -298,8 +305,8 @@ function scribe_add_update_worker() {
popd &>/dev/null

#success! create a GRIMOIRE file that stores where it was downloaded from
- echo "FROM_URL=$from" > $grimoire/GRIMOIRE &&
- chmod +x $grimoire/GRIMOIRE &&
+ echo "FROM_URL=$from" > $grimoire/GRIMOIRE &&
+ chmod +x $grimoire/GRIMOIRE &&

if [[ $add_or_update == add ]] ; then
codex_add_grimoire $grimoire 0 &&
@@ -393,7 +400,7 @@ function scribe_fix_metadata() {
#---------------------------------------------------------------------
function scribe_index() {
local idx grimoire
-
+
echo ""
echo "Codex Listing"
echo "-------------"
@@ -475,6 +482,35 @@ function scribe_reindex() {
}

#---------------------------------------------------------------------
+## scribe_reindex_keyword
+##
+## Recreate the keyword index, this is slow in comparison to
+## normal reindexing.
+##
+## @param grimoire names, if none all grimoires
+##
+#---------------------------------------------------------------------
+function scribe_reindex_keyword() {
+ local paths=""
+ local grimoire grimoires grim
+ if [[ "$@" ]] ; then
+ grimoires="$@"
+ else
+ grimoires=`codex_get_all_grimoires`
+ fi
+
+ for grim in $grimoires; do
+ if ! grimoire=$(codex_find_grimoire $grim) ; then
+ error_message "Grimoire $grim not found!"
+ return 1
+ fi
+ message -n "Reindexing keywords for $grim ..."
+ codex_create_keyword_cache "$grimoire"
+ done
+ message "done."
+}
+
+#---------------------------------------------------------------------
## scribe_remove
##
## remove a grimoire from the codex
@@ -537,7 +573,7 @@ function scribe_set(){
let idx2-- # grim1 is before grim2, by removing grim1, the position
# decrease by 1
fi
-
+
message "Setting $grim1 before $grim2"
codex_remove_grimoire $grimoire1
codex_add_grimoire $grimoire1 $idx2
@@ -587,21 +623,21 @@ function scribe_update() {
while [ -n "$1" ] ; do
grim="$1"
if ! grimoire=$(codex_find_grimoire $grim) ; then
- error_message "Grimoire $grim not found"
+ error_message "Grimoire $grim not found!"
if [[ "$2" == "from" ]] ; then shift 3 ; else shift 1 ; fi
let rc++
continue
fi

if ! [ -e $grimoire/GRIMOIRE ] && ! scribe_fix_metadata $grim; then
- error_message "$grim has invalid metadata. Not Updating"
+ error_message "$grim has invalid metadata. Not Updating!"
if [[ "$2" == "from" ]] ; then shift 3 ; else shift 1 ; fi
let rc++
continue
fi

if codex_is_local $grimoire; then
- error_message "${SPELL_COLOR}$grim${MESSAGE_COLOR} is being marked" \
+ error_message "${SPELL_COLOR}$grim${MESSAGE_COLOR} is marked" \
"as local. Won't update.${DEFAULT_COLOR}"
if [[ "$2" == "from" ]] ; then shift 3 ; else shift 1 ; fi
continue
@@ -627,12 +663,12 @@ function scribe_update() {
grim=$(basename $grimoire)
if ! [ -e $grimoire/GRIMOIRE ] && ! scribe_fix_metadata $grimoire; then
#no metadata found. dont auto-update
- error_message "$grim has invalid metadata. Not Updating"
+ error_message "$grim has invalid metadata. Not Updating!"
continue
fi

if codex_is_local $grimoire; then
- error_message "${SPELL_COLOR}$grim${MESSAGE_COLOR} is being marked
as local. Won't update.${DEFAULT_COLOR}"
+ error_message "${SPELL_COLOR}$grim${MESSAGE_COLOR} is marked as
local. Won't update.${DEFAULT_COLOR}"
continue
fi

@@ -677,6 +713,7 @@ function find_function() {
f|fi|fix) FUNCTION="fix" ;;
i|in|ind|inde|index) FUNCTION="index";;
l|loc|local|localize) FUNCTION="localize";;
+ reindex-keyword) FUNCTION="reindex-keyword";;
rei|reind|reinde|reindex) FUNCTION="reindex";;
rm|rem|remo|remov|remove) FUNCTION="remove" ;;
se|set) FUNCTION="set";;
@@ -708,6 +745,7 @@ function main() {
index) scribe_index $@ ;;
localize) scribe_localize $@ ;;
reindex) scribe_reindex $@ ;;
+reindex-keyword) scribe_reindex_keyword $@ ;;
remove) scribe_remove $@ ;;
set) scribe_set $@ ;;
swap) scribe_swap $@ ;;
@@ -733,10 +771,10 @@ elif [[ $1 == -h ]] || [[ $1 == --help ]] ; then
help
elif [[ $1 == index ]] ; then
scribe_index # this requires no access privaledges so special case it
-else
+else
echo "Enter the root password, please." 1>&2
PARAMS=$(consolidate_params "$@")
- su -c "$0 $PARAMS" root
+ exec su -c "scribe $PARAMS" root
fi

#---------------------------------------------------------------------
diff --git a/usr/sbin/sorcery b/usr/sbin/sorcery
index e02bba9..2b05a7a 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 to exiled.
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 provider for
+ PROVIDER by default, 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

@@ -327,7 +330,7 @@ show_installed_spells() {
}


-remove_pkgs() {
+remove_pkgs() {

while

@@ -390,8 +393,8 @@ update_pkgs() {
if [[ \$1 == "autoupdate" ]]; then
message "${MESSAGE_COLOR}"
message "Interrupting while upgrading the sorcery scripts may"
- message "cause the sorcery scripts to be lost. If the sorcery,"
- message "scripts are lost, Source Mage can be restored by"
+ message "cause the sorcery scripts to be lost. If the sorcery"
+ message "scripts are lost, they can be restored by"
message "running the following script:"
message "${FILE_COLOR}"
message " bash ${RESTORE_SCRIPT}"
@@ -733,7 +736,7 @@ architecture_menu() {
hash_put archspec_hash $specname $SPECFILE
fi
done
-
+
# now that there archspecs have been found, build the dialog list
for specname in $(hash_get_table_fields archspec_hash|sort); do
CPUNAME=""
@@ -765,7 +768,7 @@ architecture_menu() {
--menu \
"$ARCH_HELP" \
0 0 0 \
- '$LIST `; then
+ '$LIST `; then

# remove spurious ""
NEW_ARCH=`echo "${NEW_ARCH}" | sed -e 's/^"//' -e 's/"$//'`
@@ -829,7 +832,8 @@ custom_optimization_menu() {
17 50 9 \
CFLAGS "$CUSTOM_CFLAGS" \
CXXFLAGS "$CUSTOM_CXXFLAGS" \
- LDFLAGS "$CUSTOM_LDFLAGS"'`)
+ LDFLAGS "$CUSTOM_LDFLAGS" \
+ CPPFLAGS "$CUSTOM_CPPFLAGS"'`)
rc=$?
[[ $rc == 0 ]] || [[ $rc == 1 ]] && break
set ${RESULTS[*]}
@@ -838,15 +842,17 @@ custom_optimization_menu() {
case "$KEY" in
CFLAGS) CUSTOM_CFLAGS="$@" ;;
CXXFLAGS) CUSTOM_CXXFLAGS="$@" ;;
+ CPPFLAGS) CUSTOM_CPPFLAGS="$@" ;;
LDFLAGS) CUSTOM_LDFLAGS="$@" ;;
esac
done
-
+
# only commit values if user selected "OK"
if [ $rc == 0 ] ; then
modify_local_config CUSTOM_CFLAGS "$CUSTOM_CFLAGS"
modify_local_config CUSTOM_CXXFLAGS "$CUSTOM_CXXFLAGS"
modify_local_config CUSTOM_LDFLAGS "$CUSTOM_LDFLAGS"
+ modify_local_config CUSTOM_CPPFLAGS "$CUSTOM_CPPFLAGS"
fi
}

@@ -919,18 +925,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" ;;
@@ -1145,7 +1151,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" \
@@ -1188,7 +1194,7 @@ function service_defaults() {
local INSTALL_XINETD_HELP="Install xinetd scripts by default?"
local ENABLE_XINETD_HELP="If an xinetd script is being installed, also
enable it by default?"
local INIT_VS_XINETD="If both xinetd or init.d scripts exist, prefer
xinetd over init.d?"
-
+
local MENU_TITLE="Init.d/Xinetd Default Answer Selection Menu"
local MENU_INFO="Choose your defaults\nPer spell answers are remembered on
recasts"
local RESULT RESULTS TMP i
@@ -1472,6 +1478,7 @@ sorcery_devel_settings() {

local D_HELP="Set the debugging file for normal debugging."
local S_HELP="Turn on Super Debug. You probably don't want to do this."
+ local C_HELP="Change this to 0 to remove castfs debugging."

while

@@ -1484,7 +1491,8 @@ sorcery_devel_settings() {
"" \
0 0 0 \
"D" "Debug file" "$D_HELP" \
- "S" "Super debugging toggle" "$S_HELP"'`
+ "S" "Super debugging toggle" "$S_HELP" \
+ "C" "Castfs debuging level" "$C_HELP"'`
do

case $COMMAND in
@@ -1495,7 +1503,10 @@ sorcery_devel_settings() {
S) TEXT="Note: You don't want to do this probably. Don't forget to
2>/root/debug.out.\nDo you want super debugging on?"
TOGGLE=`eval $DIALOG --yesno \"$TEXT\" 0 0` &&
( modify_local_config "SUPER_DEBUG" "on" ; modify_local_config "set"
"-x" "command" ) ||
- ( modify_local_config "SUPER_DEBUG" "" ; modify_local_config "set"
"+x" "command" ) ;;
+ ( modify_local_config "SUPER_DEBUG" "" ; modify_local_config "set"
"+x" "command" ) ;;
+ C) TEXT="Note: This is a numeric value that represents a mask to
castfs, 0 means no debugging, 1 means file system debugging, 2 is lower level
debugging, 3 means both. All other values are currently undefined."
+ LEVEL=`eval $DIALOG --ok-label "Commit" --inputbox \"$TEXT\" 0 0
\"$CASTFS_DEBUG_LEVEL\"` &&
+ modify_local_config "CASTFS_DEBUG_LEVEL" "$LEVEL" ;;

esac

@@ -1528,6 +1539,7 @@ feature_menu() {
local ST_HELP="Set xterm title/screen window title on cast?"
local UF_HELP="Ensure a sane environment before sorcery update"
local SCR_HELP="Toggle usage of screen in cast"
+ local PSC_HELP="Ask for custom cflags for each spell"

ARCHIVE=${ARCHIVE:=on}
AUTOFIX=${AUTOFIX:=on}
@@ -1550,6 +1562,7 @@ STORE_CONF_LOG=${STORE_CONF_LOG:-off}
CROSS_INSTALL=${CROSS_INSTALL:=off}
SET_TERM_TITLE=${SET_TERM_TITLE:=off}
SCREEN=${SCREEN:-off}
+PER_SPELL_CFLAGS=${PER_SPELL_CFLAGS:-off}

if TOGGLES=`eval $DIALOG ' --title "Feature Menu" \
--no-cancel \
@@ -1578,9 +1591,10 @@ SET_TERM_TITLE=${SET_TERM_TITLE:=off}
"CLEAN_SOURCE" "Toggle" "$CLEAN_SOURCE" "$CS_HELP" \
"CROSS_INSTALL" "Toggle" "$CROSS_INSTALL" "$CI_HELP" \
"SET_TERM_TITLE" "Toggle" "$SET_TERM_TITLE" "$ST_HELP" \
- "SCREEN" "Toggle" "$SCREEN" "$SCR_HELP"'`
+ "SCREEN" "Toggle" "$SCREEN" "$SCR_HELP" \
+ "PER_SPELL_CFLAGS" "Toggle" "$PER_SPELL_CFLAGS" "$PSC_HELP"'`
then
- TEMP=(ARCHIVE AUTOFIX UPDATEFIX AUTOPRUNE COLOR GATHER_DOCS MAIL_REPORTS
VIEW_REPORTS PRESERVE SUSTAIN TMPFS VOYEUR REAP NET_SELECT CONFIG_LOC
CLEAN_SOURCE CROSS_INSTALL SET_TERM_TITLE SCREEN)
+ TEMP=(ARCHIVE AUTOFIX UPDATEFIX AUTOPRUNE COLOR GATHER_DOCS MAIL_REPORTS
VIEW_REPORTS PRESERVE SUSTAIN TMPFS VOYEUR REAP NET_SELECT CONFIG_LOC
CLEAN_SOURCE CROSS_INSTALL SET_TERM_TITLE SCREEN PER_SPELL_CFLAGS)
for i in ${TEMP[*]} ; do
eval $i=off
done
@@ -1610,11 +1624,12 @@ SET_TERM_TITLE=${SET_TERM_TITLE:=off}
CROSS_INSTALL) CROSS_INSTALL=on ;;
SET_TERM_TITLE) SET_TERM_TITLE=on ;;
SCREEN) SCREEN=on ;;
+ PER_SPELL_CFLAGS) PER_SPELL_CFLAGS=on ;;
esac

done

- TEMP=(ARCHIVE AUTOFIX UPDATEFIX AUTOPRUNE GATHER_DOCS MAIL_REPORTS
VIEW_REPORTS PRESERVE SUSTAIN TMPFS VOYEUR REAP STORE_CONF_LOG NET_SELECT
CONFIG_LOC CLEAN_SOURCE CROSS_INSTALL SET_TERM_TITLE SCREEN)
+ TEMP=(ARCHIVE AUTOFIX UPDATEFIX AUTOPRUNE GATHER_DOCS MAIL_REPORTS
VIEW_REPORTS PRESERVE SUSTAIN TMPFS VOYEUR REAP STORE_CONF_LOG NET_SELECT
CONFIG_LOC CLEAN_SOURCE CROSS_INSTALL SET_TERM_TITLE SCREEN PER_SPELL_CFLAGS)
for i in ${TEMP[*]} ; do
modify_local_config "$i" "${!i}"
done
@@ -1915,7 +1930,7 @@ sorcery_remove_defaults () {
## cli function
#---------------------------------------------------------------------
sorcery_queue_add() {
- tINSTALL_QUEUE=`lock_start_transaction "$INSTALL_QUEUE"`
+ lock_start_transaction "$INSTALL_QUEUE" tINSTALL_QUEUE
for SPELL in "$@"; do
grep -qE "^$SPELL\$" "$tINSTALL_QUEUE" || echo "$SPELL" >>
"$tINSTALL_QUEUE"
done
@@ -1930,7 +1945,7 @@ sorcery_queue_add() {
## cli function
#---------------------------------------------------------------------
sorcery_queue_remove() {
- tINSTALL_QUEUE=`lock_start_transaction "$INSTALL_QUEUE"`
+ lock_start_transaction "$INSTALL_QUEUE" tINSTALL_QUEUE
for SPELL in "$@"; do
if grep -qE "^$SPELL\$" "$tINSTALL_QUEUE"; then
grep -vE "^$SPELL\$" "$tINSTALL_QUEUE" > "$TMP_DIR/tmp_queue"
@@ -1986,7 +2001,7 @@ if [ "$UID" == 0 ]; then
cleanup_tmp_dir $TMP_DIR
exit $rc
else
- if [[ $1 == -h ]] || [[ $1 == --help ]] || [[ $1 == help ]]; then
+ if [[ $1 == -h ]] || [[ $1 == --help ]] || [[ $1 == help ]]; then
help
else
if [[ $1 == -v ]] || [[ $1 == --version ]] || [[ $1 == version ]]; then
@@ -1994,7 +2009,7 @@ else
else
echo "Enter the root password, please."
PARAMS=$(consolidate_params "$@")
- su -c "$0 $PARAMS" root
+ exec su -c "sorcery $PARAMS" root
fi
fi
fi
diff --git a/usr/sbin/summon b/usr/sbin/summon
index 4be5a2f..6a08dbc 100755
--- a/usr/sbin/summon
+++ b/usr/sbin/summon
@@ -33,22 +33,22 @@ Usage: summon [parameters] [spells]

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
@@ -91,8 +91,8 @@ fi
-g|--grimoire) codex_set_grimoires $2; shift 2 ;;
-p|--print) set_print_type $2; shift 2 ;;
--queue) QUEUE=1; shift 1 ;;
- --all) SUMMON_ALL=1; shift 1 ;;
- -r|--raw) RAW=1; shift 1 ;;
+ --all) SUMMON_ALL=1; shift 1 ;;
+ -r|--raw) RAW=1; shift 1 ;;
*) help; ;;
esac

@@ -196,10 +196,12 @@ main() {
process_parameters $*

if [ -n "$RAW" ] ; then
- local line rc
+ local line target rc
while read line; do
# eval is needed to preserve quoting
eval set -a $line
+ target="${line%% *}"
+ is_downloaded "$target" && continue
download_src_args "$@" || rc=$?
done
return $rc
@@ -221,7 +223,7 @@ main() {
list_install_queue
fi
spells_to_get=$(< $INSTALL_QUEUE)
- else
+ else
spells_to_get=`strip_parameters $*`
fi

@@ -244,10 +246,10 @@ if [ "$UID" == 0 ] ; then
cleanup_tmp_dir $TMP_DIR
exit $rc
elif [[ $1 == -h ]] || [[ $1 == --help ]] ; then help
-else
+else
echo "Enter the root password, please." 1>&2
PARAMS=$(consolidate_params "$@")
- su -c "$0 $PARAMS" root
+ exec su -c "summon $PARAMS" root
fi


diff --git a/usr/share/man/man1/gaze.1 b/usr/share/man/man1/gaze.1
index 5a33b83..1af5a97 100644
--- a/usr/share/man/man1/gaze.1
+++ b/usr/share/man/man1/gaze.1
@@ -5,7 +5,7 @@ gaze \- query/view sorcery package management information
.SH SYNOPSIS
.PP
.B gaze
-[-q] <what> [<arguments>]
+[-q] [-g <grimoires>] <what> [<arguments>]
.SH "DESCRIPTION"
.I gaze
is part of the sorcery source-based package management suite. It is a
@@ -22,6 +22,10 @@ installed packages for easy duplication.
.IP
disable human style output.
.PP
+.SS -g <grimoires>
+.IP
+specify which grimoire(s) to look in. To pass more than one, encapsulate
them in quotes.
+.PP
.SS alien
.IP
find and display all files which are not currently tracked by the
@@ -36,10 +40,6 @@ versions. This does not delete sources that are up to
date, but not installed.
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
@@ -221,9 +221,9 @@ after which to abort when no casts could be found.
.PP
.SS SCRIPT_NAME <spell>
.IP
-replace SCRIPT_NAME with any of the following
-BUILD | CONFIGURE | CONFLICTS | DETAILS | DEPENDS | FINAL | HISTORY |
INSTALL | PATCH | POST_BUILD | POST_INSTALL | POST_REMOVE | PRE_BUILD |
PRE_INSTALL | PRE_REMOVE | PREPARE | PROVIDES | TRIGGERS
-to show that spell script for the spell
+show SCRIPT_NAME of the spell, where SCRIPT_NAME is any of the following
spell scripts:
+
+BUILD | CONFIGURE | CONFLICTS | DETAILS | DEPENDS | DOWNLOAD | FINAL |
HISTORY | INSTALL | INSTALL_EXTRAS | PATCH | POST_BUILD | POST_INSTALL |
POST_REMOVE | POST_RESURRECT | PRE_BUILD | PRE_INSTALL | PRE_REMOVE |
PRE_RESURRECT | PRE_SUB_DEPENDS | PREPARE | PROVIDES | SECURITY | SUB_DEPENDS
| TRANSFER | TRIGGER_CHECK | TRIGGERS | UP_TRIGGERS
.PP
.SS history <spell>
.IP
diff --git a/usr/share/man/man5/grimoire.5 b/usr/share/man/man5/grimoire.5
index 42e1e49..bd6b791 100755
--- a/usr/share/man/man5/grimoire.5
+++ b/usr/share/man/man5/grimoire.5
@@ -112,24 +112,27 @@ or real_default_... in build_api/api2.
.PP
.I PRE_BUILD
.IP
-This describes the unpacking process as performed in step 2. The default
-PRE_BUILD will work for the following compressions:
+This describes the unpacking process as performed in step 2 and current
+working directory for this step is the $BUILD_DIRECTORY, usually /usr/src.
+The default PRE_BUILD will work for the following compressions:
.IP
bzip2, gzip, zip, RPM, tar
.PP
.I BUILD
.IP
This describes the compilation process as performed in steps
-6 and 7. Here the package is built, not installed yet. If the
-software package compiles using these 2 steps then the default
+6 and 7. Here the package is built, not installed yet. The current
+working directory for this step is $SOURCE_DIRECTORY set in the DETAILS
+file. If the software package compiles using these 2 steps then the default
BUILD can be used. Sorcery automatically changes the install path and sets
optimization options.
.PP
.I PRE_INSTALL
.IP
-This will start installwatch, sorcery's install logging system.
+This will start installwatch, sorcery's install logging system.
It will log every file touched during install so we can get the install log
-of files installed by the spell.
+of files installed by the spell. The current working directory for this step
+is the old working directory of the BUILD step.

It is recommended that if you add this file it contains
.I default_pre_install.
@@ -138,12 +141,24 @@ It is recommended that if you add this file it contains
.IP
This is step 8. "make install" by default.
If your spell needs another way to install its files, here is the place to
-do so.
+do so. The current working directory of this step is the old working
directory
+of PRE_INSTALL
.PP
.I POST_INSTALL
.IP
This step finishes off the install process. It installs configuration files
-and documentation, and finally turns off installwatch.
+and documentation, and finally turns off installwatch. If the spell is being
+staged this step will also copy the files back to the system and stage config
+files in a different location to be merged back to the system by the user.
+Also, if the spell is being staged the working directory for this step is
one
+directory above the root of the staged area after the INSTALL step else the
+working directory is the system root. To access files in the stage directory
+prefix the with the directory name 'TRANSL'. This provides a simple safety
+check so system files won't get wiped out. A second check against the
+enviromental variable STAGED_INSTALL is also highly recommended,
STAGED_INSTALL
+will be set to 'off' if the spell isn't going to be staged before
installing.
+This allows packages to move/remove files before they are installed to the
+system safely.
It is highly recommended to run
.I default_post_install
at the end of this file.
@@ -152,7 +167,8 @@ at the end of this file.
.IP
This file contains instructions on files to be installed and instructions
to be performed that should for some reason not appear in the install logs
-(e.g. modifying another package's /etc files)
+(e.g. modifying another package's /etc files). The working directory of this
+step is the root of the system.

This is the only file in the build process that does not have a default,
so if it does not exist, nothing will be done.
diff --git a/usr/share/man/man8/alter.8 b/usr/share/man/man8/alter.8
index 428934c..6370a92 100755
--- a/usr/share/man/man8/alter.8
+++ b/usr/share/man/man8/alter.8
@@ -114,7 +114,7 @@ Maintained by the Source Mage GNU Linux Team
(http://www.sourcemage.org)
.SH "REPORTING BUGS"
Report bugs to bugzilla <http://bugs.sourcemage.org>
.SH "SEE ALSO"
-cast(8), cleanse(8), dispel(8), gaze(1), grimoire(5),
+cast(8), confmeld(8), cleanse(8), dispel(8), gaze(1), grimoire(5),
scribbler(8), scribe(8), sorcery(8), sorcery_config(8), summon(8)
.SH "WARRANTY"
This is free software with ABSOLUTELY NO WARRANTY
diff --git a/usr/share/man/man8/cast.8 b/usr/share/man/man8/cast.8
index 19842f2..f22343d 100644
--- a/usr/share/man/man8/cast.8
+++ b/usr/share/man/man8/cast.8
@@ -30,8 +30,8 @@ This disables that behavior.
.SS "--deps"
Determines dependencies for the given spell(s) and casts the dependencies,
but does not cast the given spell(s) itself.
-.SS "--cflags, --cxxflags, --ldflags"
-Set custom cflags/cxxflags/ldflags values to override those found in
+.SS "--cflags, --cxxflags, --ldflags, --cppflags"
+Set custom cflags/cxxflags/ldflags/cppflags values to override those found in
arch specs, and set through the sorcery menu.
.SS "--no-opts"
Disable the use of optimization flags from arch specs and the sorcery
@@ -46,21 +46,22 @@ This will prompt you again for optional dependencies
and configuration options, even those you answered before.
Implies
.IR "-c" .
+.SS "-g, --grimoire [grimoire names ...]"
+Use only the specified grimoires for this cast.
+NOTE: If there are any cross-grimoire dependencies on unspecified grimoires
they will not work. The target spell will not be found. To avoid this,
specify all relevant grimoires to the -g parameter in the order you wish them
to be searched.
.SS "--from directory"
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
+Re-casts all spells in the install queue, as generated for example by
.BI sorcery " queue"
.SS "-V on|off"
-overrides the VOYEUR option, which specifies whether or not
+Overrides the VOYEUR option, which specifies whether or not
compile output should be displayed. Helpful if you usually have
it off and want to see where an error is.
.SS "-d, --download"
-forces redownloading of sources, sources are freshly downloaded
+Forces redownloading of sources, sources are freshly downloaded
even when we already have them.
.SS "-R, --recast-down"
recasts all the spells the given spell(s) depend on
@@ -69,6 +70,14 @@ This might be quite a lot of spells.
.SS "-B, --recast-up"
recasts all the spells that depend on the given spell(s)
(and the ones they depend on ...).
+.SS "-O, --recast-optional [option]"
+If a spell being built has spells which could optionally depend on it, but
those
+dependencies are disabled, ask to recast the dependee. Option can be one of:
"always",
+"ask-yes", "ask-no", or "ignore"; it defaults to what is set via the sorcery
menu.
+.SS "-Z, --lazy-updates [option]"
+Perform updates on installed spells that need updates. Optional parameter
are the same as above.
+.SS "-b, --force-base-dep"
+Force all spells to depend on basesystem.
.SS "-h, --help"
Display short help.
.SH "ENVIRONMENT"
@@ -96,7 +105,7 @@ If spell fails during a cast, try recasting it with
to reconfigure and recompile.
.SH "COMMENTS"
Unless the
-.B -from
+.B --from
option is specified cast will always check the
.I /var/spool/sorcery
directory first to see if the package exists. If the package does not
@@ -110,7 +119,7 @@ Maintained by the Source Mage GNU Linux Team
(http://www.sourcemage.org)
.SH "REPORTING BUGS"
Report bugs to bugzilla <http://bugs.sourcemage.org>
.SH "SEE ALSO"
-alter(8), cleanse(8), dispel(8), gaze(1), grimoire(5), scribbler(8),
+alter(8), cleanse(8), confmeld(8), dispel(8), gaze(1), grimoire(5),
scribbler(8),
scribe(8), sorcery(8), sorcery_config(5), summon(8)
.SH "WARRANTY"
This is free software with ABSOLUTELY NO WARRANTY
diff --git a/usr/share/man/man8/cleanse.8 b/usr/share/man/man8/cleanse.8
index 93747e9..8f7bc73 100644
--- a/usr/share/man/man8/cleanse.8
+++ b/usr/share/man/man8/cleanse.8
@@ -10,7 +10,10 @@ cleanse \- Cleans sorcery system files of lint and
accumulated garbage
[\-\-prune [doit]]
[\-\-sweep]
[\-\-sweep_all]
+[\-\-logs]
[\-\-fix]
+[\-\-nofix]
+[\-\-nofix_quick]
.SH "EXAMPLE"
To check everything type:
.IP
@@ -49,6 +52,10 @@ Deletes unnecessary sources and binary caches. Files are
kept if any spell/versi
Deletes unnecessary sources and binary caches. Only files that could
be used by the first occurence of an installed spell are kept.

+.TP
+.B "\-\-logs"
+Removes stale compile, install and md5sum logs. Only the logs of the current
versions of the currently installed spells are kept.
+
.TP
.B "\-\-fix"
Discover and fix broken spells. Four methods are used to do this.
@@ -72,6 +79,14 @@ Discovers Broken executables and libraries.
.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.
@@ -102,6 +117,6 @@ Maintained by the Source Mage GNU Linux Team
(http://www.sourcemage.org)
.SH "REPORTING BUGS"
Report bugs to bugzilla <http://bugs.sourcemage.org>
.SH "SEE ALSO"
-dispel(8), gaze(1), grimoire(5), invoke(8), sorcery(8), scribe(8),
summon(8), scribbler (8)
+confmeld(8), dispel(8), gaze(1), grimoire(5), invoke(8), sorcery(8),
scribe(8), summon(8), scribbler (8)
.SH "WARRANTY"
This is free software with ABSOLUTELY NO WARRANTY
diff --git a/usr/share/man/man8/confmeld.8 b/usr/share/man/man8/confmeld.8
new file mode 100644
index 0000000..ecffc8d
--- /dev/null
+++ b/usr/share/man/man8/confmeld.8
@@ -0,0 +1,76 @@
+.TH CONFMELD 8 "February 2008" "Source Mage GNU Linux" "System
Administration"
+.SH NAME
+confmeld \- merges staged configuration files into the system
+.SH SYNOPSIS
+.B confmeld
+[options] [arguments] ...
+.PP
+.B confmeld
+[listing-options]
+.SH "EXAMPLE"
+To merge everything type:
+.IP
+.B confmeld
+.PP
+To list everything type:
+.IP
+.B confmeld -l
+.PP
+To bruteforce an update of nano and /etc/sysconfig/facilities type:
+.IP
+.B confmeld -f discard-old nano /etc/sysconfig/facilities
+.PP
+.SH "DESCRIPTION"
+.B confmeld
+is part of the
+.B sorcery
+source-code package management suite. It is a command-line tool
+for the (semi)automatical merging of staged configuration files. Spells will
not
+install newer versions during cast, but stage them in
+.I /var/state/sorcery/staged_configs\fR.\fP
+
+At the end, confmeld will resolve the simple upgrade cases and ask
+for the rest. The user will have the choice to either leave the old file
intact
+or install the new one over. Two similar choices will additionally backup the
+respective file.
+
+To facilitate the decision, confmeld can also show the difference between
the
+two files (an unified diff).
+
+.SH "OPTIONS"
+.SS "-h, --help"
+outputs short help
+.SS "-l, --list"
+lists all the spells and their staged configs
+.SS "-c, --list-configs"
+lists all the staged configs
+.SS "-s, --list-spells"
+lists all the spells with staged configs
+.SS "-q, --no-column"
+turns off columnized output
+.SS "-f, --force" <action>
+always uses <action> when merging, where <action> can be one of:
+.TP
+.SS discard-new
+does nothing, just discards the new config
+.TP
+.SS discard-old
+trashes the old config and installs the new one in its place
+.TP
+.SS use-old
+leaves the old config in its place and backups the new one to
$old_config.$date.new
+.TP
+.SS use-new
+backups the old config to $old_config.$date.old and installs the new one in
its place
+.PP
+.SH "AUTHOR"
+Original version by Jaka Kranjc.
+.PP
+Maintained by the Source Mage GNU Linux Team (http://www.sourcemage.org)
+.SH "REPORTING BUGS"
+Report bugs to bugzilla <http://bugs.sourcemage.org>
+.SH "SEE ALSO"
+alter(8), cast(8), cleanse(8), dispel(8), gaze(1), grimoire(5),
+scribbler(8), scribe(8), sorcery_config(8), sorcery(8)
+.SH "WARRANTY"
+This is free software with ABSOLUTELY NO WARRANTY
diff --git a/usr/share/man/man8/dispel.8 b/usr/share/man/man8/dispel.8
index 19667d2..3fa5301 100644
--- a/usr/share/man/man8/dispel.8
+++ b/usr/share/man/man8/dispel.8
@@ -78,14 +78,15 @@ disables handling of "triggers" for this session,
the automatic recasting/dispelling of other spells when
a spell is dispelled.
.SS "--nosustain"
-usually, sorcery will refuse to dispel things it vitally needs
-(gcc, tar, bash, etc.)
+usually, sorcery will refuse to dispel things it vitally needs (gcc, tar,
bash, etc.).
This overrides that protection.
.SS "--noreap"
dispel the spell without removing its files
.SS "--no-reap-depends"
-Dont remove dependency information, do not use this unless you know exactly
+Don't remove dependency information. DO NOT use this unless you know exactly
what you are doing, and dont complain if it breaks your box.
+.SS "--total-dispel"
+Remove everything including config files, even if they were modified.

.SS "--orphan <quad-opt>"
Default action for dispelling a newly orphaned child spell.
@@ -93,7 +94,7 @@ Default action for dispelling a newly orphaned child spell.
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).

.SS "--child <quad-opt>"
-Default action for dispelling a child spell that is either an orphan or
non-orphan.
+Default action for dispelling a child spell that is either an orphan or a
non-orphan.

.SS "--recast-parent <quad-opt>"
If a spell has a child removed from under it, the
@@ -117,7 +118,7 @@ List of regexps that are excluded during a cast or dispel.
.SS /var/lib/sorcery/protected
List of files that will not be removed.
.SS /var/lib/sorcery/sustained
-List of spells that are essential to system, and dispel of is not permitted.
+List of spells that are so essential to system that their dispel is not
permitted.
Casting and upgrading is fine.
.SH ADVANCED USAGE
Remove xfree86, will not be cast again for any reason
@@ -132,15 +133,15 @@ dispel
.B --downgrade
glibc 2.2.3
.SH "NOTES"
-Do not include
+Do not include the
.SM version
or
.SM section
-when specifying a package. To get complete listing of installed software
+when specifying a package. To get a complete listing of the installed
software
packages and versions type
.B gaze installed
.SH "NOTES"
-Downgrade will only rollback to versions that were previously installed.
+Downgrade will only rollback to versions that were previously installed and
have caches available.
It will not download older versions from the Internet.
.SH "AUTHOR"
Original version by Kyle Sallee, and updated Thomas Stewart
@@ -150,7 +151,7 @@ Maintained by the Source Mage GNU Linux Team
(http://www.sourcemage.org)
.SH "REPORTING BUGS"
Report bugs to bugzilla <http://bugs.sourcemage.org>
.SH "SEE ALSO"
-alter(8), cast(8), cleanse(8), gaze(1), grimoire(5), scribbler(8), scribe(8),
+alter(8), cast(8), confmeld(8), cleanse(8), gaze(1), grimoire(5),
scribbler(8), scribe(8),
sorcery(8), sorcery_config(5), summon(8)
.SH "WARRANTY"
This is free software with ABSOLUTELY NO WARRANTY
diff --git a/usr/share/man/man8/scribe.8 b/usr/share/man/man8/scribe.8
index 26a07b0..8de1f0f 100644
--- a/usr/share/man/man8/scribe.8
+++ b/usr/share/man/man8/scribe.8
@@ -66,6 +66,9 @@ The index files are a sorcery mechanism to speed up spell
lookups.
run
.I scribe reindex
whenever you add/remove spells! Otherwise, strange things will happen!
+.SS reindex-keyword [<grimoire>]
+This recreates the keyword index files, of all grimoires or of the specified
one.
+The keyword indexes come pre-packaged with the grimoire, so this step is
optional. Its also a bit slower than regular reindexing. Run this on any
local grimoire you may have so that you can do keyword based lookups.
.SS index
shows a list of grimoires and locations where you have them installed.
.SS set <grim1> <grim2>
diff --git a/usr/share/man/man8/sorcery.8 b/usr/share/man/man8/sorcery.8
index 5b21a65..03cd4cb 100644
--- a/usr/share/man/man8/sorcery.8
+++ b/usr/share/man/man8/sorcery.8
@@ -137,7 +137,7 @@ Maintained by the Source Mage GNU Linux Team
(http://www.sourcemage.org)
.SH "REPORTING BUGS"
Report bugs to bugzilla <http://bugs.sourcemage.org>
.SH "SEE ALSO"
-alter(8), cast(8), cleanse(8), dispel(8), gaze(1), grimoire(5), scribbler(8),
+alter(8), cast(8), cleanse(8), confmeld(8), dispel(8), gaze(1), grimoire(5),
scribbler(8),
scribe(8), sorcery_config(8), summon(8)
.SH "WARRANTY"
This is free software with ABSOLUTELY NO WARRANTY
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/build/run_compiler
b/var/lib/sorcery/build/run_compiler
index 425aeaa..700f4d3 100644
--- a/var/lib/sorcery/build/run_compiler
+++ b/var/lib/sorcery/build/run_compiler
@@ -13,7 +13,7 @@
##=head1 COPYRIGHT
##
## Copyright (C) 2002 Robert Helgesson <rycee AT home.se>
-##
+##
##=head1 FUNCTIONS
#---------------------------------------------------------------------

@@ -26,8 +26,11 @@ if [[ $USE_DISTCC != off ]] &&
DISTCC=/usr/bin/distcc

export DISTCC_HOSTS
+ export DISTCC_DIR
export DISTCC_VERBOSE=0
export DISTCC_LOG=/dev/null
+
+ test -d "$DISTCC_DIR/" || mkdir -p "$DISTCC_DIR"
else
DISTCC=""
fi
diff --git a/var/lib/sorcery/modules/build_api/api1
b/var/lib/sorcery/modules/build_api/api1
index 0605919..0ac1664 100755
--- a/var/lib/sorcery/modules/build_api/api1
+++ b/var/lib/sorcery/modules/build_api/api1
@@ -26,10 +26,10 @@ function run_build_spell() {
debug "build_api/api1" "run_build_spell"
C_LOG=$TMP_DIR/$SPELL.compile.log
C_FIFO=/dev/stdout
-
+ STAGED_INSTALL=off
rm -f $C_LOG
touch $C_LOG
- if [[ $SCREEN_NAME ]] ; then
+ if [[ $SCREEN_NAME ]] ; then
screen_new_window "$SCREEN_NAME" $SCREEN_CAST_WIN "cast $SPELL" \
tail -f -s 0.1 $C_LOG
screen_switch_window "$SCREEN_NAME" $SCREEN_MAIN_WIN
@@ -58,7 +58,7 @@ function run_build_spell() {
run_post_install || return 3
)
rs=$?
-
+
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"
@@ -67,11 +67,11 @@ function run_build_spell() {
elif [[ $SCREEN_NAME ]] ; then
screen_kill_window "$SCREEN_NAME" $SCREEN_CAST_WIN
fi
-
+
# Triggers don't run in the window
[ $rs -gt 0 ] && return $rs
run_triggers || return 4
-
+
return $rs
}

@@ -91,15 +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
- 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
}


@@ -130,13 +122,7 @@ function run_build() {

run_config_loc
(
- persistent_load &&
- if [ -x $SCRIPT_DIRECTORY/BUILD ]; then
- . $SCRIPT_DIRECTORY/BUILD
- 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

@@ -145,7 +131,7 @@ function run_build() {
"! Problem Detected !" \
"${DEFAULT_COLOR}"
return 1
- fi
+ fi
echo "Compile log for $SPELL $VERSION Completed Build on `date -u`" >>
$C_LOG

}
@@ -159,13 +145,7 @@ function run_build() {
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
- else
- default_post_build
- fi
- persistent_save
+ run_spell_file POST_BUILD post_build

# Lock made in prepare_install
unlock_resources "libgrimoire" "install"
@@ -181,12 +161,7 @@ function run_post_build() {
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
- fi &&
- persistent_save
+ run_spell_file INSTALL install
}


@@ -195,9 +170,9 @@ function run_post_install() {
## Creates the source directory and unpacks the source package into it.
## Used if no PRE_BUILD script is found for a spell.
#---------------------------------------------------------------------
-function real_default_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

@@ -222,9 +197,9 @@ function real_default_pre_build() {
## </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)
@@ -251,9 +226,9 @@ function real_default_build() {
## 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
diff --git a/var/lib/sorcery/modules/build_api/api2
b/var/lib/sorcery/modules/build_api/api2
index e533f8b..d1ca054 100755
--- a/var/lib/sorcery/modules/build_api/api2
+++ b/var/lib/sorcery/modules/build_api/api2
@@ -26,13 +26,21 @@
function run_build_spell() {
debug "build_api/api2" "run_build_spell"

- C_LOG=$TMP_DIR/$SPELL.compile.log
- C_FIFO=/dev/stdout # not needed for api2 anymore, but just in case
+ local CHROOT_CHECK=""

+ export C_LOG=$TMP_DIR/$SPELL.compile.log
+ export CASTFS_DBGLOG=$C_LOG.castfs.dbglog
+ 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 $CASTFS_DBGLOG
+ touch $CASTFS_DBGLOG
rm -f $C_LOG
touch $C_LOG
-
- if [[ $SCREEN_NAME ]] ; then
+
+ if [[ $SCREEN_NAME ]] ; then
screen_new_window "$SCREEN_NAME" $SCREEN_CAST_WIN "cast $SPELL" \
tail -f -s 0.1 $C_LOG
screen_switch_window "$SCREEN_NAME" $SCREEN_MAIN_WIN
@@ -46,22 +54,48 @@ function run_build_spell() {
VOYEUR_STDOUT=/dev/null
VOYEUR_STDERR=/dev/null
fi
-
+
+ if [[ -z $STAGED_INSTALL ]]
+ then
+ if ! is_castfs_installed
+ then
+ export STAGED_INSTALL=off
+ else
+ export STAGED_INSTALL=on
+ fi
+ fi
+
+ if [[ $STAGED_INSTALL == on ]] && ! run_castfs_sanity
+ then
+ message "${PROBLEM_COLOR}CastFS failed the sanity check, staging
disabled!"
+ message -n "$DEFAULT_COLOR"
+ export STAGED_INSTALL=off
+ fi
+
local PROTECT_SORCERY=yes
local rs
(
- run_pre_build || return 1
- run_config_loc || return 2
+ run_pre_build || return 1
+ run_config_loc || return 2
(
- run_build &&
- run_pre_install &&
- run_install || return 2
- run_post_install &&
- run_final || return 3
+ run_build &&
+ run_pre_install &&
+ if [[ $STAGED_INSTALL == off ]]
+ then
+ invoke_installwatch
+ fi &&
+ delve $SPELL INSTALL &&
+ delve $SPELL INSTALL_EXTRAS &&
+ run_post_install || return 2
+ run_transfer &&
+ devoke_installwatch &&
+ STAGED_INSTALL=off &&
+ run_final || return 3
) 2> >(tee -a $C_LOG 1>&2 >> $VOYEUR_STDERR) \
> >(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"
@@ -70,7 +104,7 @@ function run_build_spell() {
elif [[ $SCREEN_NAME ]] ; then
screen_kill_window "$SCREEN_NAME" $SCREEN_CAST_WIN
fi
-
+
# triggers don't run in the window
[ $rs -gt 0 ] && return $rs

@@ -92,18 +126,10 @@ function run_pre_build() {

rm_source_dir
mkdir -p $BUILD_DIRECTORY
- cd $BUILD_DIRECTORY
+ cd "$BUILD_DIRECTORY"

verify_sources &&
- persistent_load &&
- if [ -x $SCRIPT_DIRECTORY/PRE_BUILD ]; then
- debug "build_api/api2" "run_pre_build() - Prebuild script exists, now
sourcing "
- . $SCRIPT_DIRECTORY/PRE_BUILD
- else
- debug "build_api/api2" "run_pre_build() - Prebuild script not found,
using default"
- default_pre_build
- fi &&
- persistent_save
+ run_spell_file PRE_BUILD pre_build
}


@@ -119,8 +145,11 @@ function run_build() {
echo "Compile log for $SPELL $VERSION Built on `date -u`" > $C_LOG
echo "Using gcc version: `gcc -dumpversion`" >> $C_LOG

- [ -d "$SOURCE_DIRECTORY" ] &&
- cd $SOURCE_DIRECTORY
+ if [ -d "$SOURCE_DIRECTORY" ] ; then
+ cd "$SOURCE_DIRECTORY"
+ else
+ cd "$BUILD_DIRECTORY"
+ fi &&

invoke_build_dir
invoke_gcc2
@@ -130,13 +159,7 @@ function run_build() {
pwd
message "$SPELL $VERSION"

- persistent_load &&
- if [ -x $SCRIPT_DIRECTORY/BUILD ]; then
- . $SCRIPT_DIRECTORY/BUILD
- else
- default_build
- fi &&
- persistent_save
+ run_spell_file BUILD build

if [ "$?" != 0 ]; then
message "${PROBLEM_COLOR}" \
@@ -144,6 +167,7 @@ function run_build() {
"${DEFAULT_COLOR}"
return 1
fi
+ pwd > $S_PWD
}


@@ -154,34 +178,38 @@ function run_build() {
function run_pre_install() {
debug "build_api/api2" "Starting run_pre_install()"

- persistent_load &&
- if [ -x $SCRIPT_DIRECTORY/PRE_INSTALL ]; then
- . $SCRIPT_DIRECTORY/PRE_INSTALL
+ if [ -f $S_PWD ] ; then
+ cd "`cat $S_PWD`"
+ elif [ -d $SOURCE_DIRECTORY ] ; then
+ cd "$SOURCE_DIRECTORY"
else
- default_pre_install
- fi &&
- persistent_save &&
+ cd "$BUILD_DIRECTORY"
+ fi
+
+ run_spell_file PRE_INSTALL pre_install
echo "Compile log for $SPELL $VERSION Completed Build on `date -u`" >>
$C_LOG
+ pwd > $S_PWD
}


#---------------------------------------------------------------------
-## Turns all the various logs back on that were turned off from after
-## run_pre_install finished, then runs INSTALL or default_install
+## load persistent vars, then runs INSTALL or default_install
## Along with other stuff that needs to be transplanted elsewhere.
+## NOTE: this function is run from delve so installwatch can be invoked
+## around an execed bash shell, this is needed for installwatch to
+## stage root properly
#---------------------------------------------------------------------
function run_install() {
debug "build_api/api2" "Starting run_install()"
-
- invoke_installwatch
-
- persistent_load &&
- if [ -x $SCRIPT_DIRECTORY/INSTALL ]; then
- . $SCRIPT_DIRECTORY/INSTALL
+ if [ -f $S_PWD ] ; then
+ cd "`cat $S_PWD`"
+ elif [ -d $SOURCE_DIRECTORY ] ; then
+ cd "$SOURCE_DIRECTORY"
else
- default_install
- fi &&
- persistent_save &&
+ cd "$BUILD_DIRECTORY"
+ fi
+
+ run_spell_file INSTALL install

if [ "$?" != 0 ]; then
message "${PROBLEM_COLOR}" \
@@ -191,23 +219,45 @@ function run_install() {
fi
}

+function run_install_extras() {
+
+ debug "build_api/api2" "Starting run_install_extras()"
+ run_spell_file INSTALL_EXTRAS install_extras
+}
+
#---------------------------------------------------------------------
## Checks for a POST_BUILD file in SCRIPT_DIRECTORY, and if it is
## executable, runs it. This file is run after INSTALL and before
-## FINAL. Its purpose is to bookend INSTALL and shutoff installwatch.
+## FINAL. Its purpose is to manipulate the installed files in the stage
+## root and install other tracked files.
+## NOTE: this function is run from delve so installwatch can be invoked
+## around an execed bash shell, this is needed for installwatch to
+## stage root properly
#---------------------------------------------------------------------
function run_post_install() {
debug "build_api/api2" "Starting run_post_install()"
persistent_load &&
- if [ -x $SCRIPT_DIRECTORY/POST_INSTALL ]; then
- . $SCRIPT_DIRECTORY/POST_INSTALL
+ if [[ $STAGED_INSTALL != off ]]
+ then
+ cd "$STAGE_DIRECTORY/"
else
- default_post_install
+ cd "${INSTALL_ROOT:-/}"
fi &&
- persistent_save &&
+ run_spell_file POST_INSTALL post_install
unlock_resources "libgrimoire" "install"
}

+#--------------------------------------------------------------------
+## Checks against STAGED_INSTALL and installs the staged spell
+## accordingly
+#--------------------------------------------------------------------
+function run_transfer() {
+ if [[ "$STAGED_INSTALL" != "off" ]]
+ then
+ run_spell_file TRANSFER transfer
+ fi
+}
+
#---------------------------------------------------------------------
## Checks for a FINAL file in SCRIPT_DIRECTORY, and if it is
## executable, runs it. This file is used for extra files that need
@@ -216,12 +266,7 @@ function run_post_install() {
function run_final() {

debug "build_api/api2" "Starting run_final()"
- persistent_load &&
- if [ -x $SCRIPT_DIRECTORY/FINAL ]
- then
- . $SCRIPT_DIRECTORY/FINAL
- fi &&
- persistent_save
+ run_spell_file FINAL final
}

#---------------------------------------------------------------------
@@ -230,7 +275,7 @@ function run_final() {
## 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 &&
@@ -241,7 +286,7 @@ function real_default_pre_build() {

#---------------------------------------------------------------------
## @Type API
-## Used if no BUILD script is found
+## Used if no BUILD script is found
## Default build is:
## <pre>
## ./configure --build=$BUILD \
@@ -253,8 +298,8 @@ function real_default_pre_build() {
## </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
@@ -281,11 +326,9 @@ function real_default_build() {
## </pre>
##
#---------------------------------------------------------------------
-function real_default_pre_install() {
- debug "build_api/api2" "Starting real_default_pre_install"
- devoke_installwatch
+function real_default_sorcery_pre_install() {
+ debug "build_api/api2" "Starting real_default_sorcery_pre_install"
prepare_install
- invoke_installwatch
}

#---------------------------------------------------------------------
@@ -297,8 +340,8 @@ function real_default_pre_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
}

@@ -310,22 +353,27 @@ function real_default_install() {
##
## This is identical to api1's post_build
#---------------------------------------------------------------------
-function real_default_post_install() {
+function real_default_sorcery_install_extras() {

- 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
install_desktop_files
gather_docs
- devoke_installwatch
init_post_install
- ldconfig
+ [[ $STAGED_INSTALL == off ]] && ldconfig
# release_saved_libraries
cd /

}

+function real_default_sorcery_transfer() {
+
+ debug "build_api/api2" "Starting real_default_sorcery_post_install"
+ transfer_staged_spell
+}
+
#---------------------------------------------------------------------
## @License
##
diff --git a/var/lib/sorcery/modules/build_api/common
b/var/lib/sorcery/modules/build_api/common
index 60e7701..debaac5 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
@@ -118,7 +118,6 @@ function real_prepare_install() { (
message "${MESSAGE_COLOR}Preparing to install" \
"${SPELL_COLOR}${SPELL}${DEFAULT_COLOR}"

- devoke_installwatch
lock_resources "libgrimoire" "install"

if spell_installed $SPELL ||
@@ -127,10 +126,36 @@ function real_prepare_install() { (

trap "spell_recover" SIGINT
save_libraries
+ save_binaries
dispel --notriggers --nosustain $SPELL

fi
-) }
+) &&
+save_bin_lib_paths
+}
+
+#--------------------------------------------------------------------
+##
+## append old libraries and binaries to the appropriate environmental
+## variables so that they can be found by sorcery if they get
+## dispelled
+##
+#--------------------------------------------------------------------
+function save_bin_lib_paths()
+{
+ # TODO this is a dirty hack we need to remove it
+ if test -d "$SOURCE_DIRECTORY/old.binaries" ; then
+ for dir in $( find "$SOURCE_DIRECTORY/old.binaries" -type d); do
+ export PATH="$dir:$PATH"
+ done
+ fi
+ if test -d "$SOURCE_DIRECTORY/old.libraries" ; then
+ for dir in $( find "$SOURCE_DIRECTORY/old.libraries" -type d); do
+ export LD_LIBRARY_PATH="$dir:$LD_LIBRARY_PATH"
+ export LD_RUN_PATH="$dir:$LD_RUN_PATH"
+ done
+ fi
+}

#---------------------------------------------------------------------
##
@@ -138,30 +163,36 @@ function real_prepare_install() { (
## them as part of the spell
##
#---------------------------------------------------------------------
-function real_gather_docs() {
+function real_gather_docs() { (

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

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

- DOC_DIR=$DOCUMENT_DIRECTORY/$SPELL
- mkdir -p $DOC_DIR
+ DEST_DIR=$DOCUMENT_DIRECTORY/$SPELL
+ mkdir -p $DEST_DIR

- for i in ${DOCS[@]}
- do
- cp -r $SOURCE_DIRECTORY/${i} $DOC_DIR 2>/dev/null
+ cd $SOURCE_DIRECTORY
+ shopt -s nullglob
+ for i in ${DOCS}; do
+ if test -f "$i"; then
+ file -bi $i|grep -q ^application && continue
+ cp $SOURCE_DIRECTORY/${i} $DEST_DIR 2>/dev/null
+ fi
done

- # what is this here for and why isn't it part of the standard DOCS
- # variable?
- cp $SOURCE_DIRECTORY/*rc $DOC_DIR 2>/dev/null
+ for i in ${DOC_DIRS}; do
+ if test -d "$i"; then
+ cp -r $SOURCE_DIRECTORY/${i} $DEST_DIR 2>/dev/null
+ fi
+ done

# making installed docs readable for all users.
- chmod -fR a+r $DOC_DIR
+ chmod -fR a+r $DEST_DIR

fi

-}
+) }


#---------------------------------------------------------------------
@@ -213,10 +244,13 @@ function run_spell_success() {

# update depends info
debug "build_api/common" "Merging depends info"
- local t_DEPENDS_STATUS=$(lock_start_transaction $DEPENDS_STATUS)
+
# none of the old values are valid, only the new, uncommitted values are
- remove_depends_status $t_DEPENDS_STATUS $SPELL
- local spell_depends=$(hash_get uncommitted_hash $SPELL)
+ remove_depends_status $DEPENDS_STATUS $SPELL
+ local spell_depends spell_sub_depends spell_rsub_depends
+ local t_DEPENDS_STATUS
+ lock_start_transaction "$DEPENDS_STATUS" t_DEPENDS_STATUS
+ get_uncommitted_depends_file $SPELL spell_depends
if [ -e "$spell_depends" ] ; then
cat $spell_depends >> $t_DEPENDS_STATUS
fi
@@ -227,6 +261,18 @@ function run_spell_success() {
test -e "$ABANDONED_DEPENDS/$SPELL" &&
rm -f $ABANDONED_DEPENDS/$SPELL &>/dev/null

+ # none of the old values are valid, only the new, uncommitted values are
+ remove_sub_depends $SUB_DEPENDS_STATUS "" "$SPELL"
+ local spell_sub_depends
+ local t_SUB_DEPENDS_STATUS
+ lock_start_transaction "$SUB_DEPENDS_STATUS" t_SUB_DEPENDS_STATUS
+ get_uncommitted_sub_depends_file $SPELL spell_sub_depends
+ if [ -e "$spell_sub_depends" ] ; then
+ cat $spell_sub_depends >> $t_SUB_DEPENDS_STATUS
+ fi
+ lock_commit_transaction $SUB_DEPENDS_STATUS
+ get_uncommitted_rsub_depends_file $SPELL spell_rsub_depends
+
# compile log
create_compile_log
view_compile_log
@@ -236,11 +282,42 @@ function run_spell_success() {
message "failed to make a tablet directory: $tablet_dir" \
"this may be a bug"
unset tablet_dir
+ local TABLET_IGNORE=yes
else
message "${MESSAGE_COLOR}Creating tablet in directory" \
"${FILE_COLOR}${tablet_dir}${DEFAULT_COLOR}"
tablet_install_spell_files $tablet_dir
-
+ local TABLET_SPELL_DIR=$tablet_dir spell_config_stage
+ spell_config_stage=$CONFIG_STAGE_DIRECTORY/$SPELL
+ lock_file "$spell_config_stage"
+ if [[ $STAGED_INSTALL != "off" && -d $spell_config_stage/current ]]
+ then
+ rmdir $spell_config_stage/current $spell_config_stage 2>/dev/null
+ if [[ -d $spell_config_stage/current ]]
+ then
+ # check if a config we staged was already staged and if so, remove
it.
+ # this way users don't have to merge the same old default config
again
+ # and again if they cast a spell multiple times
+ local deferred_file file quasi_basename
+ find $spell_config_stage/current -type f |
+ while read deferred_file; do
+ quasi_basename=$(sed "s,$spell_config_stage/current/,," <<<
"$deferred_file")
+ find $spell_config_stage -wholename $spell_config_stage/current \
+ -prune -o -type f -wholename "*/$quasi_basename" -print |
+ while read file; do
+ if cmp -s $deferred_file $file; then
+ recursive_config_stage_cleanup $deferred_file $SPELL
+ continue 2
+ fi &>/dev/null
+ done
+ done
+
+ [[ -d $spell_config_stage/current ]] &&
+ mv $spell_config_stage/current \
+ $spell_config_stage/$(basename $tablet_dir)
+ fi
+ fi
+ unlock_file "$spell_config_stage"
# this data is now doubly stale, remove it
rm -f $ABANDONED_PERSIST/$SPELL.p
fi
@@ -252,6 +329,16 @@ function run_spell_success() {
# reformatted to "log" format (see log_adjuster in libtrack for details)
# but basically replacing INSTALL_ROOT with TRACK_ROOT
create_install_log $IW_LOG $TMP_INST_LOG
+ if [[ $STAGED_INSTALL == on ]]; then
+ # save the md5sums of the files in the stage and not the target
+ # ones on the system, otherwise config merging breaks #13835
+ # for this we need an "install" log of what is in the stage
+ local STAGE_INST_LOG="$TMP_DIR/$SPELL-$VERSION.stage.install"
+ create_stage_install_log $TMP_INST_LOG $STAGE_INST_LOG
+ if [[ $tablet_dir ]] ; then
+ find $tablet_dir >> $STAGE_INST_LOG
+ fi
+ fi
if [[ $tablet_dir ]] ; then
find $tablet_dir >> $TMP_INST_LOG
fi
@@ -260,11 +347,20 @@ function run_spell_success() {
# md5sum log
message "${MESSAGE_COLOR}Creating MD5 log" \
"${FILE_COLOR}${MD5_LOG}${DEFAULT_COLOR}"
- create_md5list $TMP_INST_LOG $TMP_MD5_LOG
+ if [[ $STAGED_INSTALL == on ]]; then
+ create_md5list $STAGE_INST_LOG $TMP_MD5_LOG
+ sed -i "s#${STAGE_DIRECTORY}/TRANSL##g" $TMP_MD5_LOG
+ else
+ create_md5list $TMP_INST_LOG $TMP_MD5_LOG
+ fi
log_adjuster $TMP_MD5_LOG $MD5_LOG root log md5_log_filter

# do this before cache archive creation (bug 8249)
rm_source_dir
+ if [[ $STAGED_INSTALL != off ]]
+ then
+ destroy_stage_root
+ fi

# cache archive

@@ -274,7 +370,8 @@ function run_spell_success() {
create_cache_archive $TMP_INST_LOG $CACHE $CACHE_COMP

report_install
- rm -f $IW_LOG $C_LOG $TMP_INST_LOG $TMP_MD5_LOG $spell_depends
+ rm -f $IW_LOG $C_LOG $TMP_INST_LOG $TMP_MD5_LOG "$STAGE_INST_LOG" \
+ "$spell_sub_depends" "$spell_rsub_depends" "$spell_depends"
}

#---------------------------------------------------------------------
@@ -298,7 +395,8 @@ function run_spell_failure() {

# put the answers somewhere where they can still be used later
mkdir -p $ABANDONED_DEPENDS
- local spell_depends=$(hash_get uncommitted_hash $SPELL)
+ local spell_depends
+ get_uncommitted_depends_file $SPELL spell_depends
[ -e "$spell_depends" ] && mv $spell_depends $ABANDONED_DEPENDS/$SPELL

# This may have been locked if there was a failure during the install
@@ -309,6 +407,18 @@ function run_spell_failure() {

rm -f $IW_LOG $C_LOG

- [[ $CLEAN_SOURCE == on ]] && rm_source_dir
+ local spell_sub_depends spell_rsub_depends
+ get_uncommitted_sub_depends_file $SPELL spell_sub_depends
+ get_uncommitted_rsub_depends_file $SPELL spell_rsub_depends
+ rm -f "$spell_sub_depends" "$spell_rsub_depends"
+
+ if [[ $CLEAN_SOURCE == on ]]
+ then
+ rm_source_dir
+ if [[ $STAGED_INSTALL != off ]]
+ then
+ destroy_stage_root
+ fi
+ fi
CAST_EXIT_STATUS=1
}
diff --git a/var/lib/sorcery/modules/dl_handlers/dl_cvs
b/var/lib/sorcery/modules/dl_handlers/dl_cvs
index 05fc068..f191a99 100755
--- a/var/lib/sorcery/modules/dl_handlers/dl_cvs
+++ b/var/lib/sorcery/modules/dl_handlers/dl_cvs
@@ -2,7 +2,7 @@
#---------------------------------------------------------------------
##
##=head1 SYNOPSIS
-##
+##
## Download handler for downloading cvs urls.
##
##=head1 DESCRIPTION
@@ -10,7 +10,7 @@
## This file contains functions for I<downloading> files through cvs.
##
## In order for cvs urls to be downloaded, the I<cvs> spell must have been
-## cast. This script first determines if cvs has been installed before
+## cast. This script first determines if cvs has been installed before
## attempting to download a cvs url.
##
##
@@ -27,7 +27,7 @@

#---------------------------------------------------------------------
##=item dl_get_cvs <url>
-##
+##
## Fetch the specified cvs url.
##
## This function always assumes that a tree is being downloaded (for now).
@@ -40,7 +40,7 @@
## No hints are defined currently.
##
#---------------------------------------------------------------------
-function dl_cvs_get() {
+function dl_cvs_get() {
dl_command_check cvs || return 254

local target=$1
diff --git a/var/lib/sorcery/modules/dl_handlers/dl_dir
b/var/lib/sorcery/modules/dl_handlers/dl_dir
index 9cc25e6..1b1fbc3 100755
--- a/var/lib/sorcery/modules/dl_handlers/dl_dir
+++ b/var/lib/sorcery/modules/dl_handlers/dl_dir
@@ -2,23 +2,23 @@
#---------------------------------------------------------------------
##
##=head1 SYNOPSIS
-##
+##
## Url handler functions for grabbing directory urls.
##
##=head1 DESCRIPTION
##
## This type of url was added as a response to the following request:
##
-## I'm an AbiWord developer, and I keep the latest source
-## tree in my abi directory. If I could make the abi spell
-## (not to be confused with the abispell) use my current
+## I'm an AbiWord developer, and I keep the latest source
+## tree in my abi directory. If I could make the abi spell
+## (not to be confused with the abispell) use my current
## CVS checked-out tree, that would be nice.
##
## This file contains functions for I<downloading> (actually it just
-## copies, tars, and compresses) directories which can be accessed
+## copies, tars, and compresses) directories which can be accessed
## through the local file system.
##
-## Url's of this type are specified using the format
+## Url's of this type are specified using the format
##
## dir://<directory>
##
@@ -38,7 +38,7 @@

#---------------------------------------------------------------------
##=item dl_get_dir <url>
-##
+##
## Copies the specified dir url.
##
#---------------------------------------------------------------------
@@ -62,7 +62,7 @@ function url_dir_get() {
message "Finished."
fi
done
-
+
eval "$dl_target=\"$target\""
eval "$dl_type=\"tree\""
return $rc
diff --git a/var/lib/sorcery/modules/dl_handlers/dl_file
b/var/lib/sorcery/modules/dl_handlers/dl_file
index 5772c59..35b4a06 100755
--- a/var/lib/sorcery/modules/dl_handlers/dl_file
+++ b/var/lib/sorcery/modules/dl_handlers/dl_file
@@ -4,7 +4,7 @@
## @Synopsis Url handler functions for grabbing file urls.
## This file contains functions for I<downloading> (actually it just
## copies) files which can be accessed through the local file system.
-## Url's of this type are specified using the format
+## Url's of this type are specified using the format
##
## file://<path>
##
@@ -16,7 +16,7 @@

#---------------------------------------------------------------------
## @param url
-##
+##
## Copies the specified file url.
##
#---------------------------------------------------------------------
@@ -38,7 +38,7 @@ function dl_file_get() {
test -r "$FILENAME" &&
cp -a $FILENAME $target && break
done
-
+
eval "$dl_target=\"$target\""
eval "$dl_type=\"file\""
return $rc
diff --git a/var/lib/sorcery/modules/dl_handlers/dl_git
b/var/lib/sorcery/modules/dl_handlers/dl_git
index 26e8fff..9d73a48 100755
--- a/var/lib/sorcery/modules/dl_handlers/dl_git
+++ b/var/lib/sorcery/modules/dl_handlers/dl_git
@@ -14,13 +14,13 @@

#---------------------------------------------------------------------
##=item dl_get_git <url>
-##
+##
## Fetch the specified git url.
##
## This handler only supports tree downloads.
##
#---------------------------------------------------------------------
-function dl_git_get () {
+function dl_git_get () {
dl_command_check git || return 254

local target=$1
@@ -36,17 +36,27 @@ function dl_git_get () {
for url in $url_list; do
local URL GIT_ROOT GIT_DIRECTORY GIT_TAG
url_crack "$url" "$hints"
+ if [[ -z $GIT_DIRECTORY ]]
+ then
+ GIT_DIRECTORY=${target/.git/}
+ fi
if test -d $GIT_DIRECTORY; then
message "${MESSAGE_COLOR}Running git pull...${DEFAULT_COLOR}"
- echo git pull $GIT_ROOT
( cd $GIT_DIRECTORY &&
- git pull $GIT_ROOT )
+ echo git-checkout $GIT_TAG &&
+ git-checkout $GIT_TAG &&
+ echo git-pull $GIT_ROOT $GIT_TAG
+ git-pull $GIT_ROOT $GIT_TAG )
rc=$?
eval "$dl_target=\"$GIT_DIRECTORY\""
else
message "${MESSAGE_COLOR}Running git clone...${DEFAULT_COLOR}"
- echo git clone $GIT_ROOT $GIT_DIRECTORY
- git clone $GIT_ROOT $GIT_DIRECTORY
+ echo git-clone $GIT_ROOT $GIT_DIRECTORY
+ git-clone $GIT_ROOT $GIT_DIRECTORY &&
+ cd $GIT_DIRECTORY &&
+ echo git-checkout $GIT_TAG
+ git-checkout $GIT_TAG &&
+ cd ../
rc=$?
eval "$dl_target=\"$GIT_DIRECTORY\""
fi
diff --git a/var/lib/sorcery/modules/dl_handlers/dl_rsync
b/var/lib/sorcery/modules/dl_handlers/dl_rsync
index 7f78874..8120d63 100755
--- a/var/lib/sorcery/modules/dl_handlers/dl_rsync
+++ b/var/lib/sorcery/modules/dl_handlers/dl_rsync
@@ -2,7 +2,7 @@
#---------------------------------------------------------------------
##
##=head1 SYNOPSIS
-##
+##
## Url handler functions for downloading rsync urls.
##
##=head1 DESCRIPTION
@@ -10,7 +10,7 @@
## This file contains functions for I<downloading> files through rsync.
##
## In order for rsync urls to be downloaded, the I<rsync> spell must have
been
-## cast. This script first determines if rsync has been installed before
+## cast. This script first determines if rsync has been installed before
## attempting to download a rsync url.
##
##=head1 RSYNC URL Format
@@ -45,13 +45,13 @@

#---------------------------------------------------------------------
##=item dl_rsync_download <url>
-##
+##
## Fetch the specified rsync url.
##
## This handler supports both files and trees.
##
#---------------------------------------------------------------------
-function dl_rsync_get() {
+function dl_rsync_get() {
dl_command_check rsync || return 254

local target=$1
@@ -96,7 +96,7 @@ function dl_rsync_run_rsync() {
local COUNT=0
local position="a"
local use_spinner
-
+
if [ "$dl_file" == 1 ]; then
TOTAL=0 # downloading a single file, not a source tree
else
@@ -108,7 +108,7 @@ function dl_rsync_run_rsync() {
let TOTAL+=10
fi
fi
-
+
message "${MESSAGE_COLOR}Running rsync...${DEFAULT_COLOR}"
if [ $TOTAL -lt 10 ] ; then
echo rsync -rz --delete --stats --progress "$url" "$target"
@@ -117,7 +117,7 @@ function dl_rsync_run_rsync() {
else
echo rsync -rz --delete --stats -vv "$url" "$target"
{
- rsync -rz --delete --stats -vv "$url" "$target"
+ rsync -rz --delete --stats -vv "$url" "$target"
echo $? > $TMP_DIR/rsync.rc
} | tee $TMP_DIR/rsyncout$$ |
while read line ; do
diff --git a/var/lib/sorcery/modules/dl_handlers/dl_svn
b/var/lib/sorcery/modules/dl_handlers/dl_svn
index 97fb5ff..c9e8a76 100755
--- a/var/lib/sorcery/modules/dl_handlers/dl_svn
+++ b/var/lib/sorcery/modules/dl_handlers/dl_svn
@@ -14,13 +14,13 @@

#---------------------------------------------------------------------
##=item dl_get_svn <url>
-##
+##
## Fetch the specified svn url.
##
## This handler only supports tree downloads.
##
#---------------------------------------------------------------------
-function dl_svn_get () {
+function dl_svn_get () {
dl_command_check svn || return 254

local target=$1
@@ -35,17 +35,27 @@ function dl_svn_get () {

for url in $url_list; do
local URL SVN_ROOT SVN_MODULE SVN_TAG
- url_svn_crack $url
+ url_crack "$url" "$hints"
+
+ local svn_args="--non-interactive "
+ if list_find "$hints" "parse_username" ; then
+ local USER_PASS=$(echo $SVN_ROOT|sed 's#.*//\(.*\)@.*#\1#')
+ local SVN_ROOT=$(echo $SVN_ROOT|sed 's#//\(.*\)@#//#')
+ local USER=${USER_PASS%:*};
+ local PASS=${USER_PASS#*:};
+ svn_args="--username $USER --password $PASS "
+ fi

if test -d $target; then
message "${MESSAGE_COLOR}Running svn update...${DEFAULT_COLOR}"
- svn update -q --non-interactive -r $SVN_TAG $target
+ echo svn update $svn_args -q --non-interactive -r $SVN_TAG $target
+ svn update $svn_args -q --non-interactive -r $SVN_TAG $target
rc=$?
eval "$dl_target=\"$target\""
else
message "${MESSAGE_COLOR}Running svn checkout...${DEFAULT_COLOR}"
- # hard-coded http :-(
- svn checkout -r $SVN_TAG http://$SVN_ROOT $SVN_MODULE
+ echo svn checkout $svn_args -r $SVN_TAG $SVN_ROOT $SVN_MODULE
+ svn checkout $svn_args -r $SVN_TAG $SVN_ROOT $SVN_MODULE
rc=$?
eval "$dl_target=\"$SVN_MODULE\""
fi
diff --git a/var/lib/sorcery/modules/dl_handlers/dl_tla
b/var/lib/sorcery/modules/dl_handlers/dl_tla
index 2e7372b..4c70b89 100755
--- a/var/lib/sorcery/modules/dl_handlers/dl_tla
+++ b/var/lib/sorcery/modules/dl_handlers/dl_tla
@@ -2,10 +2,10 @@
##
----------------------------------------------------------------------------
##
##=head1 SYNOPSIS
-##
+##
## Url handler functions for grabbing tla urls.
##
-##
+##
##=head1 COPYRIGHT
##
## Copyright 2005 the SourceMage Team
@@ -14,13 +14,13 @@

#
-----------------------------------------------------------------------------
##=item dl_get_tla <url>
-##
+##
## Fetch the specified tla url.
##
## This handler only supports tree downloads.
##
#
-----------------------------------------------------------------------------
-function dl_tla_get() {
+function dl_tla_get() {
dl_command_check tla || return 254

local target=$1
@@ -35,7 +35,7 @@ function dl_tla_get() {

for url in $url_list; do
local URL TLA_ARCHIVE TLA_LOCATION TLA_REVISION
-
+
if ! tla archives | grep -q "\<$TLA_ARCHIVE\>"; then
tla register-archive $TLA_ARCHIVE $TLA_LOCATION || {
message "${PROBLEM_COLOR}Error registering archive${DEFAULT_COLOR}"
@@ -67,7 +67,7 @@ function dl_tla_get() {
done

dl_disconnect
-
+
eval "$dl_target=\"$target\""
eval "$dl_type=\"tree\""
return $rc
diff --git a/var/lib/sorcery/modules/libapi b/var/lib/sorcery/modules/libapi
index 9215f1d..e1d8e30 100755
--- a/var/lib/sorcery/modules/libapi
+++ b/var/lib/sorcery/modules/libapi
@@ -18,69 +18,91 @@

#---------------------------------------------------------------------
# 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)
-# rm_source_dir (libgrimoire)
-# sedit (libmisc)
-# spell_exiled (libstate)
-# spell_held (libstate)
-# spell_installed (libstate)
-# spell_ok (libstate)
-# 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_install_extras (build_api/api2) (BUILD_API==2 only)
+# default_sorcery_post_build (build_api/api1) (BUILD_API==1 only)
+# default_sorcery_post_install (build_api/api2) (BUILD_API==2 only)
+# default_sorcery_transfer (build_api/api2) (BUILD_API==2 only)
+# default_sorcery_pre_build (build_api/common)
+# default_sorcery_pre_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)
+# note_config_file (libtrack)
+# on_cast (libtriggers)
+# on_dispel (libtriggers)
+# on_pre_cast (libtriggers)
+# on_pre_dispel (libtriggers)
+# optional_depends (libdepends)
+# persistent_add (libmisc)
+# persistent_clear (libmisc)
+# persistent_load (libmisc)
+# persistent_remove (libmisc)
+# persistent_save (libmisc)
+# prepare_install (libgrimoire)
+# 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
@@ -90,7 +112,7 @@
#
# The following are set when a spell is loaded, you may use them, but
# not change them:
-# SCRIPT_DIRECTORY SECTION_DIRECTORY GRIMOIRE SPELL_DIRECTORY SECTION
+# SCRIPT_DIRECTORY SECTION_DIRECTORY GRIMOIRE SPELL_DIRECTORY SECTION
#
# global sorcery variables you should never use in a spell:
#
@@ -98,14 +120,14 @@
# must look at one of them, talk to your local sorcery lead about getting
# some sort of accessor functionality)
#
-# TOP_LEVEL DISPLAY PATH TMP_DIR SAFE_CAST
-# FAILED_LIST SUCCESS_LIST SPELL SPELLS spells MAKEFILE DEPS_ONLY
-# CAST_PASS download_log IW_LOG SOLO QUIET INSTALL_QUEUE
-# OVERRIDE_CFLAGS OVERRIDE_CXXFLAGS OVERRIDE_LDFLAGS NO_OPTIMIZATION_FLAGS
-# DOT_PROGRESS VOYEUR_OVERRIDE RECONFIGURE RECAST_DOWN COMPILE RECAST_UP
-# FORCE_DOWNLOAD SILENT FIX DEBUG SEPARATE BASE_URL
-# CAST_HASH BACK_CAST_HASH CANNOT_CAST_HASH uncommitted_hash NEW_DEPENDS
-# spell_depends DEPENDS_CONFIG UP_DEPENDS SPELL_CONFIG GRIMOIRE_DIR
+# TOP_LEVEL DISPLAY PATH TMP_DIR SAFE_CAST
+# FAILED_LIST SUCCESS_LIST SPELL SPELLS spells MAKEFILE DEPS_ONLY
+# CAST_PASS download_log IW_LOG SOLO QUIET INSTALL_QUEUE
+# OVERRIDE_CFLAGS OVERRIDE_CXXFLAGS OVERRIDE_LDFLAGS NO_OPTIMIZATION_FLAGS
+# DOT_PROGRESS VOYEUR_OVERRIDE RECONFIGURE RECAST_DOWN COMPILE RECAST_UP
+# FORCE_DOWNLOAD SILENT FIX DEBUG SEPARATE BASE_URL
+# CAST_HASH BACK_CAST_HASH CANNOT_CAST_HASH uncommitted_hash NEW_DEPENDS
+# spell_depends DEPENDS_CONFIG UP_DEPENDS SPELL_CONFIG GRIMOIRE_DIR
# BUILD_API VOYEUR_STDOUT VOYEUR_STDERR C_LOG C_FIFO INST_LOG MD5_LOG
# INSTALLWATCHFILE CAST_EXIT_STATUS
#
@@ -211,7 +233,7 @@ function config_query_list () {
#---------------------------------------------------------------------
function config_query_option () {
debug "libapi" "config_query_option - $*"
- real_config_query_option "$@"
+ real_config_query_option "$@"
}

#---------------------------------------------------------------------
@@ -253,7 +275,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>
@@ -277,50 +299,26 @@ function conflicts () {
## </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:
@@ -329,65 +327,74 @@ function default_download() {
## </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_install_extras>
for more details.
+## Only defined for BUILD_API==2
+## Installs configuration files and documentation.
+#---------------------------------------------------------------------
+function default_sorcery_install_extras () {
+ debug "libapi" "default_sorcery_install_extras - $*"
+ real_default_sorcery_install_extras "$@"
+}
+
+#---------------------------------------------------------------------
+## @Type API
+## @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
-##
+## Puts the spell at the root of the stage root so manipulation of the
+## installed files can happen
#---------------------------------------------------------------------
-function default_post_install () {
- debug "libapi" "default_post_install - $*"
- real_default_post_install "$@"
+function default_sorcery_post_install () {
+ debug "libapi" "default_sorcery_post_install - $*"
+ real_default_sorcery_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.
-##
+## @See <@function
var.lib.sorcery.modules.libgrimoire.html,real_default_sorcery_transfer> for
more details.
+## Only defined for BUILD_API==2
+## Transfers the files from the stage area to the system. Default is
+## transfer_staged_spell
#---------------------------------------------------------------------
-function default_post_remove() {
- debug "libapi" "$FUNCNAME - $*"
- real_default_post_remove "$@"
+function default_sorcery_transfer () {
+ debug "libapi" "default_sorcery_transfer - $*"
+ real_default_sorcery_transfer "$@"
}

#---------------------------------------------------------------------
## @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:
@@ -396,33 +403,9 @@ function default_pre_build () {
## </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 "$@"
}

#---------------------------------------------------------------------
@@ -451,6 +434,16 @@ function devoke_installwatch () {

#---------------------------------------------------------------------
## @Type API
+## @See <@function
var.lib.sorcery.modules.libtrack.html,real_devoke_stage_root> for more
details.
+## Stops using installwatch
+#---------------------------------------------------------------------
+function devoke_stage_root () {
+ debug "libapi" "devoke_stage_root - $*"
+ real_devoke_stage_root "$@"
+}
+
+#---------------------------------------------------------------------
+## @Type API
## @params Number portion of SOURCE[[:digit:]], eg '', "2", "3", etc.
## @See <@function var.lib.sorcery.modules.libsummon.html,real_download_src>
for more details.
##
@@ -548,9 +541,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.
##
@@ -595,9 +588,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
@@ -618,6 +611,16 @@ function invoke_installwatch () {
}

#---------------------------------------------------------------------
+## @Type API
+## @See <@function
var.lib.sorcery.modules.libtrack.html,real_invoke_stage_root> for more
details.
+## Starts using installwatch
+#---------------------------------------------------------------------
+function invoke_stage_root () {
+ debug "libapi" "invoke_stage_root - $*"
+ real_invoke_stage_root "$@"
+}
+
+#---------------------------------------------------------------------
## @param return_var
## @param elements, ...
## @See <@function var.lib.sorcery.modules.libmisc.html,real_list_remove>
for more details.
@@ -633,7 +636,7 @@ function invoke_installwatch () {
#---------------------------------------------------------------------
function list_remove () {
debug "libapi" "list_remove - $*"
- real_list_remove "$@"
+ real_list_remove "$@"
}

#---------------------------------------------------------------------
@@ -664,9 +667,13 @@ function list_add () {
## return 0 at least one element is in list
## return 1 none of supplied elements is not in list
##
-## Finds if at least one of given elements is in the string. Warning,
-## this function takes real string, not variable name as other list_*
-## functions
+## Finds if at least one of the given elements is in the string. They
+## can be delimited by spaces, tabs or newlines. The search elements
+## must not contain any of these or they won't match. The matching is
+## exact, regular expressions and globbing patterns are not supported.
+##
+## Warning, this function takes a real string, not a variable name as
+## other list_* functions.
## <pre>
## Example:
## if list_find "$MY_LIST" "--with-x"; then
@@ -695,7 +702,7 @@ function message () {

#---------------------------------------------------------------------
## @Type API
-## @param directory name
+## @param directory name
## @param [size]
## @See <@function
var.lib.sorcery.modules.libgrimoire.html,real_mk_source_dir> for more details.
## Creates a tmpfs filesystem. By default, the size is 1GB.
@@ -717,6 +724,17 @@ function mk_source_dir () {

#---------------------------------------------------------------------
## @Type API
+## @See <@function
var.lib.sorcery.modules.libtrack.html,real_note_config_file> for more details.
+## @param spell file to check for modification
+##
+#---------------------------------------------------------------------
+function note_config_file() {
+ debug "libapi" "note_config_file - $*"
+ real_note_config_file "$@"
+}
+
+#---------------------------------------------------------------------
+## @Type API
## @See <@function var.lib.sorcery.modules.libtriggers.html,real_on_cast>
for more details.
## @param spell that triggers
## @param action
@@ -832,7 +850,7 @@ function persistent_clear () {
#---------------------------------------------------------------------
function persistent_load () {
debug "libapi" "persistent_load - $*"
- real_persistent_load "$@"
+ real_persistent_load "$@"
}

#---------------------------------------------------------------------
@@ -848,7 +866,7 @@ function persistent_load () {
#---------------------------------------------------------------------
function persistent_remove () {
debug "libapi" "persistent_remove - $*"
- real_persistent_remove "$@"
+ real_persistent_remove "$@"
}

#---------------------------------------------------------------------
@@ -876,7 +894,7 @@ function persistent_save () {
## variable to read
## returns:
## 1 if the var doesn't exist in the file
-## 2 if the tablet dir doesn't exist
+## 2 if the tablet dir doesn't exist
## 3 if the persistent config file doesn't exist
## 4 if the EXPORTS file doesn't exist
##
@@ -917,7 +935,7 @@ function provider_ok() {
## @param [directory to remove]
## @Globals SOURCE_DIRECTORY
## Removes the given directory or SOURCE_DIRECTORY if no argument is
-## given.
+## given.
## @See <@function
var.lib.sorcery.modules.libgrimoire.html,real_rm_source_dir> for more details.
##
#---------------------------------------------------------------------
@@ -929,7 +947,7 @@ function rm_source_dir() {
#---------------------------------------------------------------------
## @Type API
## @See <@function var.lib.sorcery.modules.libmisc.html,real_query> for more
details.
-## @param question
+## @param question
## @param default answer
##
## @return 0 on yes
@@ -937,7 +955,7 @@ function rm_source_dir() {
##
## Asks the user a yes/no question. First argument is the question to
## ask, second argument is the default answer. If a timeout occurs
-## before the question is answered, the given default answer is
+## before the question is answered, the given default answer is
## applied. Returns true or false based on the answer given.
##
#---------------------------------------------------------------------
@@ -969,15 +987,29 @@ function query_string () {

#---------------------------------------------------------------------
## @Type API
+## @param spell/service
+## @param enabled options (optional)
+## @param description (optional)
+## @param grimoires (optional)
+## @See <@function var.lib.sorcery.modules.libdepends.html,real_depends> for
more details.
+## Denotes that a spell requires another spell to work.
+#---------------------------------------------------------------------
+function runtime_depends () {
+ debug "libapi" "runtime_depends - $*"
+ real_runtime_depends "$@"
+}
+
+#---------------------------------------------------------------------
+## @Type API
## @param sed command
## @param file
## @See <@function var.lib.sorcery.modules.libmisc.html,real_sedit> for more
details.
##
-## First argument is a sed command. Second argument is a file.
-## sedit performs the sed command on the file, modifiying the
-## original file. For example,
+## First argument is a sed command. Second argument is a file.
+## sedit performs the sed command on the file, modifiying the
+## original file. For example,
## <br>sedit "s/foo/bar/g" /tmp/somefile <br>
-## will replace all occurances of foo with bar in /tmp/somefile.
+## will replace all occurances of foo with bar in /tmp/somefile.
## This function is often used in spells to make changes to source
## files before compiling. See the sed man page for more information.
##
@@ -990,6 +1022,20 @@ function sedit () {
#---------------------------------------------------------------------
## @Type API
## @param spell name
+## @param max depth
+## @param fast (optional)
+## @See <@function
var.lib.sorcery.modules.libdepends.html,real_show_up_depends> for more
details.
+##
+## @stdout recursively prints out the spell that depend on the specified
spell
+#---------------------------------------------------------------------
+function show_up_depends() {
+ debug "libapi" "spell_ok - $*"
+ real_show_up_depends "$@"
+}
+
+#---------------------------------------------------------------------
+## @Type API
+## @param spell name
## @See <@function
var.lib.sorcery.modules.libstate.html,real_spell_installed> for more details.
##
## @return 0 if the given spell's status is "installed"
@@ -1037,6 +1083,32 @@ function spell_exiled() {

#---------------------------------------------------------------------
## @Type API
+## @param spell providing the sub-depends
+## @param name of sub-depends
+## @See <@function var.lib.sorcery.modules.libdepends
+#---------------------------------------------------------------------
+function sub_depends() {
+ debug "libapi" "sub_depends - $*"
+ real_sub_depends "$@"
+}
+
+#---------------------------------------------------------------------
+## @Type API
+## @param spell/service
+## @param enabled options (optional)
+## @param disabled options (optional)
+## @param description (optional)
+## @param grimoires (optional)
+## @See <@function
var.lib.sorcery.modules.libdepends.html,real_suggest_depends> for more
details.
+## Denotes that a spell can use another spell for additional functionality.
+#---------------------------------------------------------------------
+function suggest_depends () {
+ debug "libapi" "suggest_depends - $*"
+ real_suggest_depends "$@"
+}
+
+#---------------------------------------------------------------------
+## @Type API
## @param file to uncompress
## @See <@function var.lib.sorcery.modules.libunpack.html,real_uncompress>
for more details.
##
@@ -1051,7 +1123,7 @@ function uncompress () {

#---------------------------------------------------------------------
## @Type API
-## @param file to unpack
+## @param file to unpack
## @param md5sum
## @See <@function var.lib.sorcery.modules.libunpack.html,real_unpack> for
more details.
##
@@ -1087,7 +1159,7 @@ function unpack_file () {
## @See <@function
var.lib.sorcery.modules.libunpack.html,real_unpack_file_simple> for more
details.
##
## Interface to unpack a file without any verification.
-##
+##
#---------------------------------------------------------------------
function unpack_file_simple() {
debug "libapi" "$FUNCNAME - $*"
diff --git a/var/lib/sorcery/modules/libcast b/var/lib/sorcery/modules/libcast
index fbb2900..728d1da 100755
--- a/var/lib/sorcery/modules/libcast
+++ b/var/lib/sorcery/modules/libcast
@@ -98,9 +98,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=""
@@ -132,6 +130,41 @@ function run_conflicts() {

}

+function query_custom_cflags() {
+ if [[ $PER_SPELL_CFLAGS == on ]]; then
+ query "Would you like to set custom optimizations for this spell?" n ||
+ return 0
+
+ persistent_add USER_SPELL_CFLAGS
+ persistent_add USER_SPELL_CXXFLAGS
+ persistent_add USER_SPELL_LDFLAGS
+ persistent_add USER_SPELL_CPPFLAGS
+ local RESULTS KEY rc
+ while true ; do
+ # input box returns things of the form "RENAMED CFLAGS -O3 -march=foo
..."
+ # the ( ) interprits as an array, then using the magic power of set we
+ # get to use shift and $@ to get things done
+ RESULTS=(`eval dialog --stdout ' --extra-label Adjust --inputmenu \
+ "Custom Optimizations Menu" \
+ 17 50 9 \
+ CFLAGS "$USER_SPELL_CFLAGS" \
+ CXXFLAGS "$USER_SPELL_CXXFLAGS" \
+ LDFLAGS "$USER_SPELL_LDFLAGS"' \
+ CPPFLAGS "$USER_SPELL_CPPFLAGS"`)
+ rc=$?
+ [[ $rc == 0 ]] || [[ $rc == 1 ]] && break
+ set ${RESULTS[*]}
+ KEY=$2
+ shift 2
+ case "$KEY" in
+ CFLAGS) USER_SPELL_CFLAGS="$@" ;;
+ CXXFLAGS) USER_SPELL_CXXFLAGS="$@" ;;
+ LDFLAGS) USER_SPELL_LDFLAGS="$@" ;;
+ CPPFLAGS) USER_SPELL_CPPFLAGS="$@" ;;
+ esac
+ done
+ fi
+}

#---------------------------------------------------------------------
## Asks the user about init and xinetd services
@@ -139,7 +172,7 @@ function run_conflicts() {
## expcetd $SCRIPT_DIRECTORY to be setable, any file one level deep in
## $SCRIPT_DIRECTORY/xinetd.d or $SCRIPT_DIRECTORY/init.d is assumed to be
## a service
-##
+##
## the following persistent variables may be set:
## XINETD_ENABLED XINETD_DISABLED
## INIT_ENABLED INIT_DISABLED
@@ -153,7 +186,7 @@ function run_conflicts() {
function query_services() {
local XINETD_SCRIPTS
local INIT_SCRIPTS
- local btmp xtmp itmp
+ local btmp xtmp itmp
local tmp retvar
local XINETD INIT BOTH found
local new_init_provides
@@ -369,15 +402,15 @@ function dual_service_query() {
elif list_find $service $IN ; then
init_default=n
fi
-
+
if [[ $init_default == y ]] && [[ $xinetd_default == y ]] ; then
- default=3
+ default=both
elif [[ $xinetd_default == y ]] ; then
- default=2
+ default=xinetd
elif [[ $init_default == y ]] ; then
- default=1
+ default=init
else
- default=0
+ default=neither
fi
select_list $returnvar $default neither init xinetd both
}
@@ -493,7 +526,7 @@ function install_xinetd_sub() {
! grep -v disable $inst_file|diff - $file &>/dev/null ; then
message "${QUERY_COLOR}$inst_file differs from the default $file," \
"what would you like to do?${DEFAULT_COLOR}"
- select_list choice 0 "ignore" "overwrite" "overwrite/backup"
+ select_list choice "ignore" "ignore" "overwrite" "overwrite/backup"
case $choice in
"overwrite/backup")
local backup=$inst_file.$(date +'%Y%m%d%H%M')
@@ -568,7 +601,7 @@ function acquire_cast_lock() {
"Solo${DEFAULT_COLOR} ${MESSAGE_COLOR}casts to complete..." \
"${DEFAULT_COLOR}"
lock_resources "solo" "cast"
- if test -f $SOLO && grep -q "^$SPELL$" $SOLO ||
+ if test -f $SOLO && grep -q "^$SPELL$" $SOLO ||
[ -f $SCRIPT_DIRECTORY/SOLO ]
then #SOLO spell
message -n "${MESSAGE_COLOR}Waiting for${DEFAULT_COLOR} ${SPELL_COLOR}" \
@@ -603,6 +636,18 @@ function create_compile_log() {
else
$COMPRESSBIN -f < $C_LOG > $COMPILE_LOGS/$SPELL-$VERSION$EXTENSION
fi
+ if [[ $STAGED_INSTALL == on ]] ; then
+ message "${MESSAGE_COLOR}Creating castfs debug log" \
+
"${FILE_COLOR}$COMPILE_LOGS/$SPELL-$VERSION.castfs.dbglog$EXTENSION" \
+ "${DEFAULT_COLOR}"
+ if [ -z "$EXTENSION" ]
+ then
+ cp $CASTFS_DBGLOG $COMPILE_LOGS/$SPELL-$VERSION.castfs.dbglog
+ else
+ $COMPRESSBIN -f < $CASTFS_DBGLOG >
$COMPILE_LOGS/$SPELL-$VERSION.castfs.dbglog$EXTENSION
+ fi
+ rm -f $CASTFS_DBGLOG
+ fi
}


@@ -667,8 +712,8 @@ function show_downloading() {
debug "cast" "Started show_downloading() on $SPELL from $download_log"

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

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

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

#---------------------------------------------------------------------
-## @param grimoire
-## @param [position]
+## @param grimoire
+## @param [position]
## @param [overwrite]
-##
-## Adds the specified grimoire to the list of grimoires. If no
+##
+## Adds the specified grimoire to the list of grimoires. If no
## position is given, the grimoire is added to the end of the list.
## Position is 0 based. Adding a grimoire to position 0 places it as
## the first grimoire in the list, and moves all other grimoires down
@@ -222,9 +222,9 @@ function codex_add_grimoire() {

local i
touch $GRIMOIRE_LIST
- tGRIMOIRE_LIST=`lock_start_transaction $GRIMOIRE_LIST`
+ lock_start_transaction "$GRIMOIRE_LIST" tGRIMOIRE_LIST
rm $tGRIMOIRE_LIST
- for ((i=0; i<$GRIMOIRE_COUNT;i++)); do
+ for ((i=0; i<$GRIMOIRE_COUNT;i++)); do
echo GRIMOIRE_DIR[$i]=${GRIMOIRE_DIR[$i]} >> $tGRIMOIRE_LIST
done
lock_commit_transaction $GRIMOIRE_LIST
@@ -234,8 +234,8 @@ function codex_add_grimoire() {

#---------------------------------------------------------------------
## @param grimoire
-##
-## Removes the specified grimoire from the list of grimoires.
+##
+## Removes the specified grimoire from the list of grimoires.
##
#---------------------------------------------------------------------
function codex_remove_grimoire() {
@@ -245,24 +245,24 @@ function codex_remove_grimoire() {

local GRIMOIRES=`codex_get_all_grimoires`

- tGRIMOIRE_LIST=`lock_start_transaction $GRIMOIRE_LIST`
+ lock_start_transaction "$GRIMOIRE_LIST" tGRIMOIRE_LIST
touch $GRIMOIRE_LIST
cp $GRIMOIRE_LIST $GRIMOIRE_LIST_BACKUP
- rm -f $tGRIMOIRE_LIST
- touch $tGRIMOIRE_LIST
+ rm -f $tGRIMOIRE_LIST
+ touch $tGRIMOIRE_LIST

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

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

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

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


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

unset GRIMOIRE_DIR
- . $GRIMOIRE_LIST
+ . $GRIMOIRE_LIST

}

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

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

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

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


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


#---------------------------------------------------------------------
-## @param spell
+## @param spell
## @param [spell ...]
##
## @return 0 if all the specified spells exist
@@ -462,10 +462,14 @@ function codex_is_directory_a_spell() {
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
@@ -476,16 +480,16 @@ function codex_does_spell_exist() {
#---------------------------------------------------------------------
## @param spell name
## @Stdout spell name
-## Given a valid spell name, this function lists the full path to the
+## Given a valid spell name, this function lists the full path to the
## spell. If an invalid spell name is provided, nothing is listed.
##
#---------------------------------------------------------------------
function codex_find_spell_by_name() {

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

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


#---------------------------------------------------------------------
-##
+##
## @Globals GRIMOIRE SECTION SECTION_DIRECTORY SPELL SPELL_DIRECTORY
SCRIPT_DIRECTORY SPELL_DESCRIPTION VERSION SHORT UPDATED SOURCE WEB_SITE
ENTERRED MAINTAINER MD5 LICENSE
-## Unets all these global variables.
+## Unets all these global variables.
##
#---------------------------------------------------------------------
function codex_clear_current_spell() {
unset GRIMOIRE SECTION SECTION_DIRECTORY SPELL \
SPELL_DIRECTORY SCRIPT_DIRECTORY SPELL_DESCRIPTION \
VERSION SHORT UPDATED SOURCE WEB_SITE ENTERRED MAINTAINER \
- MD5 LICENSE BUILD_API
+ MD5 LICENSE BUILD_API SECURITY_PATCH PATCHLEVEL
}

#---------------------------------------------------------------------
## @param spell directory
## @Globals All vars set in a spell
-## Sets the GRIMOIRE, SECTION, SECTION_DIRECTORY, SPELL_DIRECTORY,
-## SCRIPT_DIRECTORY, and SPELL_DESCRIPTION global variables for the
+## Sets the GRIMOIRE, SECTION, SECTION_DIRECTORY, SPELL_DIRECTORY,
+## SCRIPT_DIRECTORY, and SPELL_DESCRIPTION global variables for the
## given spell directory.
##
## Assumes the directory passed in is a valid spell directory.
@@ -596,32 +600,11 @@ function codex_clear_current_spell() {
function codex_set_current_spell() {

debug "libcodex" "runing codex_set_current_spell"
- codex_clear_current_spell
- SPELL_DIRECTORY=$1

- # Directories
- SCRIPT_DIRECTORY=$SPELL_DIRECTORY
- # scribbled spells are self contained, SECTION_DIRECTORY and GRIMOIRE
- # point to slightly different places
- if test -e $SPELL_DIRECTORY/SCRIBBLED ; then
- # I dont know how to nest these
- local tmp=${SPELL_DIRECTORY%/*}
- SECTION=${tmp##*/}
- GRIMOIRE_NAME=$(basename ${tmp%/*})
+ codex_clear_current_spell

- SECTION_DIRECTORY=${SPELL_DIRECTORY}/section
- GRIMOIRE=${SPELL_DIRECTORY}/grimoire
- else
- SECTION_DIRECTORY=${SPELL_DIRECTORY%/*}
- SECTION=${SECTION_DIRECTORY##*/}
- GRIMOIRE=${SECTION_DIRECTORY%/*}
- GRIMOIRE_NAME=$(basename $GRIMOIRE)
- fi
+ codex_get_spell_paths $1

- # Names
- SPELL=${SPELL_DIRECTORY##*/}
-
- SPELL_CONFIG="$DEPENDS_CONFIG/$SPELL"
if [ -f $SPELL_CONFIG ]; then
. $SPELL_CONFIG > /dev/null 2> /dev/null
fi
@@ -638,6 +621,8 @@ function codex_set_current_spell() {
. $SPELL_DIRECTORY/DETAILS 1>/dev/null 2>&1
persistent_clear

+ STAGE_DIRECTORY=$BUILD_DIRECTORY/stage-$SPELL-$VERSION
+
# set a default build api if there isn't one already
# this isn't strictly necessary as other code should be able to handle the
# lack of this variable, but I want to play it safe.
@@ -645,41 +630,54 @@ function codex_set_current_spell() {
true
}

+#---------------------------------------------------------------------
+## Load just the very basics for a spell, skip build api, libcompat
+## and other debug stuff. Intended for use in tight loops.
+#---------------------------------------------------------------------
function codex_set_current_spell_quick() {
+ codex_get_spell_paths $1
+
+ test -f "$SPELL_CONFIG" && . "$SPELL_CONFIG" &> /dev/null
+ persistent_load
+ . $1/DETAILS &> /dev/null
+ persistent_clear
+ true
+}
+
+
+#---------------------------------------------------------------------
+## Setup the various spell paths associated with a spell without
+## loading it.
+#---------------------------------------------------------------------
+function codex_get_spell_paths() {
SPELL_DIRECTORY=$1
SCRIPT_DIRECTORY=$1
if test -e $SPELL_DIRECTORY/SCRIBBLED ; then
- # I dont know how to nest these
- local tmp=${SPELL_DIRECTORY%/*}
- SECTION=${tmp##*/}
- GRIMOIRE_NAME=$(basename ${tmp%/*})
+ local tmp
+ smgl_dirname "$SPELL_DIRECTORY" tmp
+ smgl_basename "$tmp" SECTION
+ smgl_dirname "$tmp" tmp
+ smgl_basename "$tmp" GRIMOIRE_NAME

SECTION_DIRECTORY=${SPELL_DIRECTORY}/section
GRIMOIRE=${SPELL_DIRECTORY}/grimoire
else
- SECTION_DIRECTORY=${SPELL_DIRECTORY%/*}
- SECTION=${SECTION_DIRECTORY##*/}
- GRIMOIRE=${SECTION_DIRECTORY%/*}
- GRIMOIRE_NAME=$(basename $GRIMOIRE)
+ smgl_dirname "$SPELL_DIRECTORY" SECTION_DIRECTORY
+ smgl_basename "$SECTION_DIRECTORY" SECTION
+ smgl_dirname "$SECTION_DIRECTORY" GRIMOIRE
+ smgl_basename "$GRIMOIRE" GRIMOIRE_NAME
fi
-
- # Names
- SPELL=${SPELL_DIRECTORY##*/}
- SPELL=${1##*/}
+ smgl_basename "$SPELL_DIRECTORY" SPELL
SPELL_CONFIG="$DEPENDS_CONFIG/$SPELL"
- test -f "$SPELL_CONFIG" && . "$SPELL_CONFIG" &> /dev/null
- persistent_load
- . $1/DETAILS &> /dev/null
- persistent_clear
- true
+ return 0
}

#---------------------------------------------------------------------
## @param spell name
-## Sets the GRIMOIRE, SECTION, SECTION_DIRECTORY, SPELL_DIRECTORY,
-## SCRIPT_DIRECTORY, and SPELL_DESCRIPTION global variables for the
+## Sets the GRIMOIRE, SECTION, SECTION_DIRECTORY, SPELL_DIRECTORY,
+## SCRIPT_DIRECTORY, and SPELL_DESCRIPTION global variables for the
## given spell name.
-##
+##
## @return 1 if the given name is not a spell.
##
#---------------------------------------------------------------------
@@ -695,7 +693,7 @@ function codex_set_current_spell_by_name() {
##############################CACHE FUNCTIONS#########################
#---------------------------------------------------------------------
## @param spell name
-## @param grimoire-path
+## @param grimoire-path
## @param [grimoire-path ...]
## @return 0 Spell found
## @return 1 Spell not found
@@ -745,25 +743,69 @@ function codex_check_cache() {
##
#---------------------------------------------------------------------
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
+ debug "libcodex" "codex_create_cache - $*"
+ local list="$*"
+ [[ $list ]] || list="${GRIMOIRE_DIR[*]}"

- codex_list_provides $i > "$i/$PROVIDE_INDEX_FILE"
- done
+ 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
+
+}
+
+
+#---------------------------------------------------------------------
+## Create in-memory spell lookup table for named grimoires.
+#---------------------------------------------------------------------
+function codex_create_in_memory_cache() {
+ local list
+ if [[ $1 == -i ]] ; then
+ list=$SPELL_STATUS
+ shift
+ fi
+ local hash=$1
+ shift
+ eval $(
+ for each in "$@"; do
+ cat $each/$SPELL_INDEX_FILE
+ done | awk -v i=$list -v hash=$hash '{
+ if ( ! ($1 in map)) {
+ map[$1]=$2;
+ }
+ } END {
+ if (i) {
+ FS=":";
+ while (getline < i) {
+ if( $3=="installed" || $3=="held") {
+ printf("hash_put %s %s \"%s/%s\";\n",hash,$1,map[$1],$1);
+ }
+ }
+ } else {
+ for (spell in map) {
+ printf("hash_put %s %s \"%s/%s\";\n",hash,spell,map[spell],spell);
+ }
+ }
+ }'
+ )
+
+}
+
+#---------------------------------------------------------------------
+## Creae in-memory spell lookup table for all known grimoires.
+#---------------------------------------------------------------------
+function codex_create_in_memory_cache_all() {
+ codex_create_in_memory_cache "$@" $(codex_get_all_grimoires)
}

###########################MISC FUNCTIONS#############################

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

for file in $(codex_find_in_grimoire $grimoire "PROVIDES"); do
spell=$(dirname $file)
- for provides in $(gawk '{if (/provides/) { print $2 }
+ for provides in $(gawk '{if (/provides/) { print $2 }
else { print $1 }}' $file); do
echo "$provides $spell"
done
@@ -795,6 +837,21 @@ function codex_list_provides () {
}

#---------------------------------------------------------------------
+## @param grimoire-path
+## Creates keyword index
+##
+#---------------------------------------------------------------------
+function codex_create_keyword_cache () { (
+ grimoire=$1
+
+ for file in $(codex_find_in_grimoire "$grimoire" "DETAILS"); do
+ unset SPELL KEYWORDS
+ codex_set_current_spell "${file%DETAILS}"
+ echo "$SPELL $KEYWORDS"
+ done | sort > $grimoire/$KEYWORD_INDEX_FILE
+) }
+
+#---------------------------------------------------------------------
## @param servicename
## @return 0 if service exists
## @return 1 otherwise
@@ -802,11 +859,11 @@ function codex_list_provides () {
#---------------------------------------------------------------------
function codex_does_service_exist()
{
- local SERVICE="$@"
+ local SERVICE="$@"
for GRIMOIRE in $(codex_get_all_grimoires); do
grep -qE '^'$SERVICE' ' "$GRIMOIRE/$PROVIDE_INDEX_FILE" && return 0
done
-}
+}


#---------------------------------------------------------------------
@@ -835,7 +892,7 @@ function codex_find_spell_or_section_by_name() {

#---------------------------------------------------------------------
## @param spell directory
-## @Stdout spell description
+## @Stdout spell description
## Echos the long description of the given spell. Returns an
## empty string if the directory is not a valid spell.
##
@@ -845,21 +902,6 @@ function codex_get_spell_description() {
}

#---------------------------------------------------------------------
-## @param spell directory
-## @Stdout keywords
-## Echos the keywords of the given spell. Returns an
-## empty string if the directory is not a valid spell.
-##
-#---------------------------------------------------------------------
-function codex_get_spell_keywords() {
- if codex_is_directory_a_spell "$1"; then
- if [ -e "$1/KEYWORDS" ]; then
- cat "$1/KEYWORDS"
- fi
- fi
-}
-
-#---------------------------------------------------------------------
##
## @License
## This software is free software; you can redistribute it and/or modify
diff --git a/var/lib/sorcery/modules/libcrossinstall
b/var/lib/sorcery/modules/libcrossinstall
index cff02cb..2c3f179 100755
--- a/var/lib/sorcery/modules/libcrossinstall
+++ b/var/lib/sorcery/modules/libcrossinstall
@@ -3,7 +3,7 @@
## Library for doing install_root stuff. It is home to menu's for
## install_root and related variables. Future install_root specific
## and cross install related code might live here.
-## @Copyright Copyright (C) 2004 The Source Mage Team
+## @Copyright Copyright (C) 2004 The Source Mage Team
## @Note The description may be wrong.
#--------------------------------------------------------------------

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

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

diff --git a/var/lib/sorcery/modules/libdepends
b/var/lib/sorcery/modules/libdepends
index 184a262..4524432 100755
--- a/var/lib/sorcery/modules/libdepends
+++ b/var/lib/sorcery/modules/libdepends
@@ -18,24 +18,24 @@
# -> run PREPARE
# -> run CONFIGURE
# -> run DEPENDS
-# -> depends <spell> (external)
+# -> depends|runtime_depends <spell> (external)
# -> work_depends_spell
# -> private_common_depends -> libstate.add_depends
# -> add to NEW_DEPENDS
# -> libstate.add_depends
-# -> optional_depends <spell> (external)
+# -> optional_depends|suggest_depends <spell> (external)
# -> work_optional_depends_spell
# -> query
# -> private_common_depends -> libstate.add_depends
# -> add to NEW_DEPENDS
# -> libstate.add_depends
-# -> depends <provider> (external)
+# -> depends|runtime_depends <provider> (external)
# -> work_depends_provider
# -> select provider
# -> private_common_depends -> libstate.add_depends
# -> add to NEW_DEPENDS
# -> libstate.add_depends
-# -> optional_depends <provider> (external)
+# -> optional_depends|suggest_depends <provider> (external)
# -> work_optional_depends_provider
# -> select provider
# -> private_common_depends
@@ -56,9 +56,9 @@
# SPELL: this is actually locally defined somewhere up the call stack
# but from most function's point of view it should be there...
# COMPILE: set in cast. It means that the main spells should be recompiled
-# RECONFIGURE: set in cast. I means that the info in the state depends
should
+# RECONFIGURE: set in cast. I means that the info in the state depends should
# be disregarded and replaced.
-# PRETEND_NOT_INSTALLED: set here. It is a list of spells that are to be
+# PRETEND_NOT_INSTALLED: set here. It is a list of spells that are to be
# recompiled, so they should not be treated as installed.
# CAST_HASH: The name of the hast table to put spells and dependencies
# that are to be cast (only used in this lib)
@@ -76,38 +76,25 @@
## @param Spell to prepare
## @Globals SCRIPT_DIRECTORY
#---------------------------------------------------------------------
-function run_prepare()
+function run_prepare()
{
local SPELL=$1

debug "cast" "run_prepare() - SPELL = $SPELL SCRIPT_DIRECTORY =
$SCRIPT_DIRECTORY"
-
- message "${SPELL_COLOR}${SPELL}${DEFAULT_COLOR}" \
- "${CHECK_COLOR}preparing environment...${DEFAULT_COLOR}"
+
+ depends_message "${SPELL}" "preparing environment..."

# 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
@@ -118,6 +105,7 @@ function run_other() {
# ask the questions about xinetd/initd script installation
persistent_load
query_services
+ query_custom_cflags
persistent_save
# todo:
#ask about conflicts
@@ -129,57 +117,38 @@ function run_other() {
## 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"

+ function run_configure_msg() {
+ depends_message "${SPELL}" "running configuration..."
+ }
+
local PROTECT_SORCERY=yes
- persistent_load &&
- if [ -x $SCRIPT_DIRECTORY/CONFIGURE ]; then
- message "${SPELL_COLOR}${SPELL}${DEFAULT_COLOR}" \
- "${CHECK_COLOR}running configuration...${DEFAULT_COLOR}"
- . $SCRIPT_DIRECTORY/CONFIGURE
- else
- default_configure
- fi
+ 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
- message "${SPELL_COLOR}${SPELL}${DEFAULT_COLOR}" \
- "${CHECK_COLOR}checking dependencies...${DEFAULT_COLOR}"
- . $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
@@ -187,22 +156,120 @@ function real_default_depends() {
function run_up_triggers() {
local SPELL=$1
debug "cast" "run_up_triggers() - SCRIPT_DIRECTORY = $SCRIPT_DIRECTORY"
-
+
+ function run_up_triggers_msg() {
+ depends_message "${SPELL}" "checking for reverse triggers..."
+ }
local PROTECT_SORCERY=yes
- if [ -x $SCRIPT_DIRECTORY/UP_TRIGGERS ]; then
- message "${SPELL_COLOR}${SPELL}${DEFAULT_COLOR}" \
- "${CHECK_COLOR}checking for reverse triggers...${DEFAULT_COLOR}"
- # 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
-
+ run_spell_file UP_TRIGGERS up_triggers run_up_triggers_msg
+ rc=$?
+ return $rc
}
-######################END CALLS TO OUTSIDE WORLD########################

+#---------------------------------------------------------------------
+## process any sub-depends the current spell is going to provide
+## These come from the live sub-depends table and from spells that
+## have already been processed
+#---------------------------------------------------------------------
+function run_our_sub_depends() {
+ $STD_DEBUG
+ local sub_depends pair
+ # do all sub-depends on us from live-table first, they get priority
+ # in case there is a conflict
+ for triple in $(search_sub_depends "$SUB_DEPENDS_STATUS" '.*' "$SPELL") ;
do
+ # parse the line out, eventually these silly variable expansions should
+ # be in functions or benchmarked against explode
+ tmp=${triple%:*};
+ requester=${tmp%:*};
+ sub_dependee=${tmp#*:};
+ sub_depends=${triple##*:}
+
+ # if the requester has been processed skip any sub-depends its
+ # previous instance requested, bug 11865
+ [[ $(hash_get "depends_looked_at" "$requester") == done ]] && continue
+
+ process_sub_depends "$requester" "$sub_dependee" "$sub_depends" ||
return 1
+ done
+
+ # do all sub-depends from sub_dep_r_hash (things that we provide)
+ for pair in $(hash_get sub_dep_r_hash $SPELL) ; do
+ requester=${pair%:*}
+ sub_depends=${pair#*:}
+
+ process_sub_depends "$requester" "$SPELL" "$sub_depends" || return 1
+ done
+}
+
+#---------------------------------------------------------------------
+## run any sub-depends that we requested on behalf of the sub-dependee
+#---------------------------------------------------------------------
+function run_other_sub_depends() {
+ $STD_DEBUG
+ local this_spell=$1
+ local SPELL sub_dependee sub_depends pair
+ # do all sub-depends from sub_dep_f_hash (things we request)
+ for pair in $(hash_get sub_dep_f_hash $this_spell) ; do
+ # FIXME, do this one spell at a time, rather than in whatever order we
+ # see them it will reduce the number of run_details
+ sub_dependee=${pair%:*}
+ sub_depends=${pair#*:}
+ if [[ $(hash_get depends_looked_at $sub_dependee) == done ]] ; then
+ # load the spell and clear out any special variables
+ SPELL=$sub_dependee
+ run_details
+ local NEW_SUB_DEPENDEES=""
+ # afk 5-28-06: bash 3.0 breaks local foo=(), have to make this two
lines
+ local NEW_DEPENDS; NEW_DEPENDS=()
+ local NEW_RUNTIME_DEPENDS; NEW_RUNTIME_DEPENDS=()
+ process_sub_depends "$this_spell" "$sub_dependee" "$sub_depends" ||
+ return 1
+
+ # this is needed in case processing the sub-depends added a depends
+ # isnt this fun?
+ private_add_depends
+ fi
+ done
+}
+
+#---------------------------------------------------------------------
+## Run a spell's SUB_DEPENDS file for a specific sub-depends.
+## This is idempotent, if a sub-depends has already been processed it will
+## not run the SUB_DEPENDS file again.
+##
+## Expects the sub-dependee to be loaded.
+## If the spell does not have a SUB_DEPENDS file, it is a failure.
+#---------------------------------------------------------------------
+function process_sub_depends() {
+ $STD_DEBUG
+ 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
+ local rc=0
+
+ local THIS_SUB_DEPENDS=$sub_depends
+ local PROCESSED_SUB_DEPENDS=$(hash_get processed_sub_depends
$sub_dependee)
+ 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"
+ fi
+ else
+ # sub-depends file doesnt exist, something messed up somewhere
+ return 1
+ fi
+ # add the information to the uncommitted depends file
+ local sub_depends_file rsub_depends_file
+ get_uncommitted_sub_depends_file "$sub_dependee" sub_depends_file ||
return 1
+ add_sub_depends "$sub_depends_file" "$requester" "$sub_dependee"
"$sub_depends"
+ get_uncommitted_rsub_depends_file "$requester" rsub_depends_file || return
1
+ add_sub_depends "$rsub_depends_file" "$requester" "$sub_dependee"
"$sub_depends"
+}

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

#---------------------------------------------------------------------
## Create a map of spells to their dependent spells.
@@ -216,12 +283,22 @@ function compute_installed_depends() {
local hash=$1
touch $DEPENDS_STATUS $SPELL_STATUS &>/dev/null

+ 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

+ lock_file "$DEPENDS_STATUS"
+ lock_file "$SPELL_STATUS"
# sub(/(.*)/, "", $2) removes a provider name
- eval $(awk -F : 'BEGIN {
+ eval $(awk -v pattern="$pattern" -v status="$status" -F : 'BEGIN {
while (getline < ARGV[1] ) {
- if( $3=="on") {
+ if( $3==status && ( $4 ~ pattern ) ) {
sub(/\(.*\)/, "", $2);
depmap[$1]=depmap[$1]" "$2" "
}
@@ -232,6 +309,8 @@ function compute_installed_depends() {
}
}
}' $DEPENDS_STATUS $SPELL_STATUS )
+ unlock_file "$DEPENDS_STATUS"
+ unlock_file "$SPELL_STATUS"
}

#---------------------------------------------------------------------
@@ -246,12 +325,22 @@ function compute_reverse_installed_depends() {
local hash=$1
touch $DEPENDS_STATUS $SPELL_STATUS &>/dev/null

+ 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

+ lock_file "$DEPENDS_STATUS"
+ lock_file "$SPELL_STATUS"
# sub(/(.*)/, "", $2) removes a provider name
- eval $(awk -F : 'BEGIN {
+ eval $(awk -v pattern="$pattern" -v status="$status" -F : 'BEGIN {
while (getline < ARGV[1] ) {
- if( $3=="on") {
+ if( $3==status && ( $4 ~ pattern ) ) {
sub(/\(.*\)/, "", $2);
depmap[$2]=depmap[$2]" "$1" "
}
@@ -262,6 +351,8 @@ function compute_reverse_installed_depends() {
}
}
}' $DEPENDS_STATUS $SPELL_STATUS )
+ unlock_file "$DEPENDS_STATUS"
+ unlock_file "$SPELL_STATUS"
}

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

# $1=table to place spells in
# $2=table to put problem spells in, $* = root spells
@@ -295,6 +386,7 @@ function compute_uninstalled_depends()
local CAST_HASH="$1"
local BACK_CAST_HASH="$2"
local CANNOT_CAST_HASH="$3"
+ BONUS_SPELLS=()
shift 3
local spell spells
spells=( $@ )
@@ -302,10 +394,10 @@ function compute_uninstalled_depends()
PRETEND_NOT_INSTALLED=" $@ "

local _idx
-
- # All specified spells are assumed to be not installed, or else -c and -r
+
+ # All specified spells are assumed to be not installed, or else -c and -r
# would have to be specified all the time.
-
+
for (( _idx=0 ; _idx<${#spells[*]} ; _idx++ )) ; do
if [[ ! `hash_get depends_looked_at ${spells[$_idx]}` ]]; then
if ! private_run_depends ${spells[$_idx]} ; then
@@ -316,12 +408,17 @@ function compute_uninstalled_depends()
debug "libdepends" "already looked at ${spells[$_idx]}, skipping"
fi
done
- # we no longer need this, no sense in keeping it around
+ # we no longer need these, no sense in keeping them around
hash_unset depends_looked_at
+ hash_unset sub_dep_f_hash
+ hash_unset sub_dep_r_hash
+ hash_unset sub_depends_process
+ hash_unset processed_sub_depends

- # we need this so processes on the other side of make know whats
- # going on
+ # we need this so processes on the other side of make know whats going on
hash_export uncommitted_hash
+
+ BONUS_SPELLS=( ${BONUS_SPELLS[*]} ${UP_DEPENDS[*]} )
}

#---------------------------------------------------------------------
@@ -333,9 +430,16 @@ function private_run_depends()
{
debug "libdepends" "$FUNCNAME - $*"
local SPELL=$1
+
+ # special accumulators for the current spell
local NEW_DEPENDS=""
+ local NEW_SUB_DEPENDEES=""
+ local NEW_RUNTIME_DEPENDS=""
+ local NEW_UP_DEPENDS=""
local triggerees=""
local spell_depends
+ local spell_sub_depends
+
hash_put "depends_looked_at" "$SPELL" "start"

# move this up to compute_uninstalled_depends?
@@ -344,26 +448,30 @@ function private_run_depends()
local base_deps
base_deps=$(search_depends_status $DEPENDS_STATUS basesystem|cut -f2 -d:)

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

# this cant go in private_should_cast because then the dependee wont
- # have a chance at being fixed, ideally we should check in
+ # have a chance at being fixed, ideally we should check in
# depends/optional_depends and fail there
if spell_exiled $1; then
- message "${SPELL_COLOR}${SPELL}${DEFAULT_COLOR}" \
- "${CHECK_COLOR}is exiled and will not be
cast.${DEFAULT_COLOR}"
+ depends_message "${SPELL}" "is exiled and will not be cast."
return 1
fi
get_uncommitted_depends_file $SPELL spell_depends
+ spell_sub_depends=$spell_depends.sub
if [ -n "$RECONFIGURE" ]; then
+ local t_abandonded_p
rm -f $DEPENDS_CONFIG/$SPELL
test -f $DEPENDS_CONFIG/$SPELL.p &&
mkdir -p $ABANDONED_PERSIST &&
- mv -f $DEPENDS_CONFIG/$SPELL.p $ABANDONED_PERSIST/$SPELL.p
+ lock_file "$DEPENDS_CONFIG/$SPELL.p" &&
+ lock_start_transaction "$ABANDONED_PERSIST/$SPELL.p" t_abandonded_p &&
+ mv -f "$DEPENDS_CONFIG/$SPELL.p" "$t_abandonded_p" &&
+ unlock_file "$DEPENDS_CONFIG/$SPELL.p" &&
+ lock_commit_transaction "$ABANDONED_PERSIST/$SPELL.p"
fi
prepare_spell_config
SCRIPT_DIRECTORY=`codex_find_spell_by_name $SPELL`
@@ -371,19 +479,30 @@ function private_run_depends()
run_details &&
run_configure $SPELL &&
run_other $SPELL &&
- run_depends $SPELL &&
- run_up_triggers $SPELL &&
+ run_depends $SPELL &&
+ run_up_triggers $SPELL &&
+ run_our_sub_depends $SPELL &&

# possibly recast things that depend on us if option is set (-B)
private_upward_depends $SPELL &&
+ private_recast_optionals $SPELL &&
private_add_triggerees &&
private_add_depends ||
- { debug "libdepends" "$FUNCNAME: false inside if." ; return 1; }
+ { debug "libdepends" "$FUNCNAME failed to process $SPELL." ; return 1; }
# no point in keeping the file around if its empty...
- test -s $spell_depends || rm $spell_depends
- else
- message "${SPELL_COLOR}${SPELL}${DEFAULT_COLOR}" \
- "${CHECK_COLOR}No work to do.${DEFAULT_COLOR}"
+ test -s $spell_depends || rm -f $spell_depends $spell_sub_depends
+
+ if echo "${RUNTIME_DEPENDS[*]}"| tr " " "\n" | grep -x -q "$SPELL" ; then
+ local k=${#BONUS_SPELLS[@]}
+ BONUS_SPELLS[$k]=$SPELL
+ fi
+
+ # this processes any sub-depends we requested and the sub-dependee
+ # has already been processed, so we must process them on their behalf
+ # this must be done after everything else!
+ run_other_sub_depends "$SPELL" || return 1
+ else
+ depends_message "${SPELL}" "No work to do."
hash_put "depends_looked_at" "$SPELL" "ignore"
fi

@@ -392,15 +511,14 @@ function private_run_depends()
}

#---------------------------------------------------------------------
-## Decides if a spell should be case. Check if the spell is installed
-## if it matters, etc...
-## Perhaps this function is overly splayed out in elif's but its
-## easier to add to later than what we had before...
+## Decides if a spell should be cast, or if we can leave it alone.
+## Check if the spell is installed, or if theres some other reason to
+## rebuild it.
## @param Spell
#---------------------------------------------------------------------
function private_should_cast()
{
- local decision
+ local each
# order is important here...
if ! codex_does_spell_exist $1; then
return 1
@@ -423,15 +541,16 @@ function private_should_cast()
return 0
elif echo "${FORCE_DEPENDS[*]}"| tr " " "\n" | grep -x -q "$1" ; then
return 0
+ elif [[ "$(hash_get sub_depends_process $1)" != "" ]] ; then
+ return 0
elif spell_installed $1 ; then
- # spell is installed and no -R or -B, so dont cast
- return 1
+ # returns success if want to cast
+ want_lazy_update $1 && return 0 || return 1
fi
-
+
# we must need to install this as we know nothing else about it
return 0
}
-
#---------------------------------------------------------------------
## @param Spell name
## Find all the spells that depend on the spell given as $1
@@ -442,17 +561,51 @@ function private_upward_depends() {
# Note, use the reverse depends tree for this when we get a chance
# and/or move the weird pattern into library functions...
# (afrayedknot 2005-10-02)
+ lock_file "$DEPENDS_STATUS"
tmp=$(grep "^.*:$1\(([^:]*)\)\?" $DEPENDS_STATUS|cut -f1 -d:|tr "\n" " ")
- local j each
- let j=${#UP_DEPENDS[*]}
+ unlock_file "$DEPENDS_STATUS"
+ local j k each
+ let j=${#NEW_UP_DEPENDS[*]}
for each in $tmp; do
- UP_DEPENDS[$j]=$each
+ NEW_UP_DEPENDS[$j]=$each
let j++
done
spells=( ${spells[*]} ${tmp} )
fi
}

+#---------------------------------------------------------------------
+## Find spells that optionally depended on the current spell but had the
+## dependency disabled, ask if the user wants to recast the spell.
+#---------------------------------------------------------------------
+function private_recast_optionals() {
+ if [[ $RECAST_OPTIONALS ]] && [[ $RECAST_OPTIONALS != ignore ]] ; then
+ local spell j enabled
+ let j=${#NEW_UP_DEPENDS[*]}
+ for spell in $(search_depends_status_exact $DEPENDS_STATUS \
+ '.*' "$1\(([^:]*)\)\?" off optional '.*' '.*'|cut -f1 -d:);
do
+
+ enabled=""
+ message "$spell" "has a disabled optional dependency on" "$1"
+ if [[ $RECAST_OPTIONALS == always ]] ; then
+ enabled=yes
+ else
+ local default=n
+ [[ $RECAST_OPTIONALS == ask-yes ]] && default=y
+ if query "Recast $spell with dependency enabled?" $default ; then
+ enabled=yes
+ fi
+ fi
+ if [[ $enabled ]] ; then
+ NEW_UP_DEPENDS[$j]=$each
+ let j++
+ remove_depends_status $DEPENDS_STATUS $each "${1}\(([^:]*)\)\?"
+ fi
+ done
+ fi
+
+}
+
###################BEGIN CALLBACKS FROM OUTSIDE#######################

#---------------------------------------------------------------------
@@ -462,11 +615,30 @@ function private_upward_depends() {
## @param grimoires to look in
## Delegates provider and spell cases to different worker functions.
## and gets grimoires if necessary for cross grimoire depends
+##
+## Called by real_depends and real_runtime_depends
#---------------------------------------------------------------------
-function real_depends()
+function real_generic_required_depends()
{
+ local failure_ok=$1
+ local article=$2
+ local query_term=$3
+ local database_term=$4
+ shift 4
+
+ if [[ "$1" == "-sub" ]] ; then
+ local requested_sub_depends=$2
+ 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" ]] ; then
+ if [[ "$4" ]] && ! [[ "$OVERRIDE_GRIMOIRES" ]] ; then
local grimoire here nothere current

for grimoire in $4; do
@@ -530,18 +702,47 @@ function real_depends()
fi
if [[ ! $here ]] && [[ ! $current ]] ; then
message "${PROBLEM_COLOR}no grimoire for $1 was
retrieved${DEFAULT_COLOR}"
- return 1
+ if [[ $failure_ok == "no" ]] || ! query "Build $1 anyway?" y; then
+ return 1
+ fi
fi
fi

+ local target_spell
if ! codex_does_spell_exist $1 &> /dev/null; then
- work_depends_provider "$@"
+ work_depends_provider "$failure_ok" "$article" \
+ "$query_term" "$database_term" "$@" &&
+ if [[ "$requested_sub_depends" ]]; then
+ target_spell=$(get_spell_provider "$SPELL" "$1")
+ fi
else
- work_depends_spell "$@"
- fi
+ work_depends_spell "$failure_ok" "$article" \
+ "$query_term" "$database_term" "$@" &&
+ target_spell=$1
+ fi &&
+ for sub_depend in $requested_sub_depends; do
+ sub_depends "$target_spell" "$sub_depend" || return 1
+ done
+}
+
+
+#---------------------------------------------------------------------
+## Passthrough to real_generic_required_depends, specifies the
+## parts that differ from runtime depends
+#---------------------------------------------------------------------
+function real_depends() {
+ real_generic_required_depends "no" "a" "dependency" "required" "$@"
+}

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

+
#---------------------------------------------------------------------
## @param spell or provider name
## @param addition to OPTS if enabled
@@ -549,12 +750,30 @@ function real_depends()
## @param description
## @param grimoires to look in
## Delegates provider and spell cases to different worker functions.
+##
+## Called by real_depends and real_runtime_depends
#---------------------------------------------------------------------
-function real_optional_depends()
+function real_generic_optional_depends()
{
+ local failure_ok=$1
+ local article=$2
+ local query_term=$3
+ local database_term=$4
+ shift 4
+
+ if [[ "$1" == "-sub" ]] ; then
+ local requested_sub_depends=$2
+ 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" ]] ; then
+ if [[ "$5" ]] && ! [[ "$OVERRIDE_GRIMOIRES" ]] ; then
local grimoire here nothere current
for grimoire in $5; do
if [[ "$grimoire" == "current" ]] ; then
@@ -616,19 +835,50 @@ function real_optional_depends()
if [[ ! $here ]] && [[ ! $current ]] ; then
message "${PROBLEM_COLOR}no grimoire for $1 was
retrieved${DEFAULT_COLOR}"
message "Assuming dependency is off because it could not be met"
- private_common_depends "$1" "off" "optional" "$2" "$3"
+ private_common_depends "$1" "off" "$database_term" "$2" "$3"
fi
fi

+ local target_spell
if ! codex_does_spell_exist $1 &> /dev/null; then
- work_optional_depends_provider "$@"
+ work_optional_depends_provider "$failure_ok" "$article" \
+ "$query_term" "$database_term" "$@" &&
+ if [[ "$requested_sub_depends" ]]; then
+ target_spell=$(get_spell_provider "$SPELL" "$1")
+ fi
else
- work_optional_depends_spell "$@"
+ work_optional_depends_spell "$failure_ok" "$article" \
+ "$query_term" "$database_term" "$@" &&
+ target_spell=$1
+ fi &&
+ if [[ "$requested_sub_depends" ]] &&
+ [[ "$target_spell" ]] &&
+ is_depends_enabled "$SPELL" "$target_spell"; then
+ for sub_depend in $requested_sub_depends; do
+ sub_depends "$target_spell" "$sub_depend" || return 1
+ done
fi

}

#---------------------------------------------------------------------
+## Passthrough to real_generic_optional_depends, specifies the
+## parts that differ from suggest depends
+#---------------------------------------------------------------------
+function real_optional_depends() {
+ real_generic_optional_depends "no" "an" "optional dependency" "optional"
"$@"
+}
+
+#---------------------------------------------------------------------
+## Passthrough to real_generic_required_depends, specifies the
+## parts that differ from optional depends
+#---------------------------------------------------------------------
+function real_suggest_depends() {
+ real_generic_optional_depends "yes" "a" "suggested dependency" "suggest"
"$@"
+}
+
+
+#---------------------------------------------------------------------
## Asks the user what provider for a depends is desired if a choice
## has not ben made before.
## @param Service
@@ -642,22 +892,26 @@ function work_depends_provider()
local default tmp installed=no
local status=()

+ local failure_ok=$1
+ local article=$2
+ local query_term=$3
+ local database_term=$4
+ shift 4
+
if [[ $3 ]] ; then
- message "${SPELL_COLOR}${SPELL}${DEFAULT_COLOR}" \
- "${CHECK_COLOR}requires some${DEFAULT_COLOR}" \
- "${SPELL_COLOR}${1}${DEFAULT_COLOR} ($3)."
+ depends_message "${SPELL}" "has $article $query_term on some" "${1}"
"($3)."
else
- message "${SPELL_COLOR}${SPELL}${DEFAULT_COLOR}" \
- "${CHECK_COLOR}requires some${DEFAULT_COLOR}" \
- "${SPELL_COLOR}${1}${DEFAULT_COLOR}."
+ depends_message "$SPELL" "has $article $query_term on some" "${1}."
fi
-
+
local CANDIDATES=$( find_providers $1)
if [[ ! $CANDIDATES ]] ; then
message "${PROBLEM_COLOR}No providers of${DEFAULT_COLOR}" \
"${SPELL_COLOR}$1${DEFAULT_COLOR}" \
"${PROBLEM_COLOR} can be found!${DEFAULT_COLOR}"
- return 1
+ if [[ $failure_ok == "no" ]] || ! query "Build $1 anyway?" y; then
+ return 1
+ fi
fi

# if not reconfiguring check if theres already an answer in DEPENDS_STATUS
@@ -670,7 +924,7 @@ function work_depends_provider()
tmp=${status[1]%(*} # Name of spell which provides $1
if spell_ok $tmp &&
query "Continue to use ${SPELL_COLOR}$tmp${DEFAULT_COLOR}?" y; then
- private_common_depends "$tmp($1)" "on" "required" "$2" "$3"
+ private_common_depends "$tmp($1)" "on" "$database_term" "$2" "$3"
return 0
fi
fi
@@ -704,7 +958,7 @@ function work_depends_provider()

select_provider "provider" "$default" 0 $CANDIDATES

- private_common_depends "$provider($1)" "on" "required" "$2" ""
+ private_common_depends "$provider($1)" "on" "$database_term" "$2" ""
}

#---------------------------------------------------------------------
@@ -712,23 +966,27 @@ function work_depends_provider()
## on to the common dependency function, <@function private_common_depends>
## @param Spell
## @param enabled options
-## @param disabled options (useless, but included for some reason)
-## @param grimoire the spell is in, if its different than the current one
#---------------------------------------------------------------------
function work_depends_spell()
{
debug "libdepends" "$FUNCNAME - $@"

- message "${SPELL_COLOR}${SPELL}${DEFAULT_COLOR}" \
- "${CHECK_COLOR}depends on" \
- "${SPELL_COLOR}${1}${DEFAULT_COLOR}"
+ local failure_ok=$1
+ local article=$2
+ local query_term=$3
+ local database_term=$4
+ shift 4
+
+ depends_message "${SPELL}" "has $article $query_term on" "$1"

if spell_exiled $1 ; then
- hash_put $CANNOT_CAST_HASH "$1" "Exiled"
- message "${SPELL_COLOR}${1}${DEFAULT_COLOR} has been exiled!"
- return 1
+ depends_message "${1}" "has been exiled!"
+ if [[ $failure_ok == "no" ]] || ! query "Build $1 anyway?" y; then
+ hash_put $CANNOT_CAST_HASH "$1" "Exiled"
+ return 1
+ fi
fi
- private_common_depends "$1" "on" "required" "$2" ""
+ private_common_depends "$1" "on" "$database_term" "$2" ""

}

@@ -746,32 +1004,45 @@ function work_optional_depends_provider()
local default tmp installed=no
local status=()

+ local failure_ok=$1
+ local article=$2
+ local query_term=$3
+ local database_term=$4
+ shift 4
+
if [[ $4 ]] ; then
- message "${SPELL_COLOR}${SPELL}${DEFAULT_COLOR}" \
- "${CHECK_COLOR}optionally requires some${DEFAULT_COLOR}" \
- "${SPELL_COLOR}${1}${DEFAULT_COLOR} ($4)."
+ depends_message "${SPELL}" "has $article $query_term on some" "${1}"
"($4)."
else
- message "${SPELL_COLOR}${SPELL}${DEFAULT_COLOR}" \
- "${CHECK_COLOR}optionally requires some${DEFAULT_COLOR}" \
- "${SPELL_COLOR}${1}${DEFAULT_COLOR}."
+ depends_message "${SPELL}" "has $article $query_term on some" "${1}."
fi
-
+
local CANDIDATES=$( find_providers $1)
# if not reconfiguring check if theres already an answer in DEPENDS_STATUS
if [[ ! $RECONFIGURE ]]; then
- explode "$(search_depends_status $DEPENDS_STATUS "$SPELL" ".*($1)")" ":"
"status"
+ explode "$(search_depends_status_simple $DEPENDS_STATUS "$SPELL"
".*($1)" "on")" ":" "status"
local tmp=${status[1]%(*} # Name of spell which provides $1
- if spell_ok $tmp &&
+ if [[ "$tmp" ]] && spell_ok "$tmp" &&
query "Continue to use ${SPELL_COLOR}$tmp${DEFAULT_COLOR}?" y; then
- private_common_depends "$tmp($1)" "on" "required" "$2" "$3"
+ private_common_depends "$tmp($1)" "on" "$database_term" "$2" "$3"
+ return 0
+ fi
+ if [[ "$(search_depends_status_simple $DEPENDS_STATUS \
+ "$SPELL" ".*($1)" "off")" ]] &&
+ query "Continue to use ${SPELL_COLOR}[none]${DEFAULT_COLOR}?" y; then
+ private_common_depends "$tmp($1)" "off" "$database_term" "$2" "$3"
return 0
fi
fi

# 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 -x -q "$tmp" && default=$tmp
+ tmp=$(search_depends_status_simple $ABANDONED_DEPENDS/$SPELL "$SPELL"
".*($1)" "on"|awk -F: '{print $2;exit}')
+ if [[ $tmp ]] && echo "$CANDIDATES" | grep -x -q "$tmp" ; then
+ default=$tmp
+ else
+ tmp=$(search_depends_status_simple $ABANDONED_DEPENDS/$SPELL "$SPELL"
".*($1)" "off")
+ [[ $tmp ]] && default=none
+ fi
fi

# check if theres a default provider
@@ -786,7 +1057,7 @@ function work_optional_depends_provider()
tmp=${status[0]}
if [[ ${status[2]} == on ]] ; then
# if the user said "on" use the default rather than none
- # unless theres something wrong with the provider they chose
+ # unless theres something wrong with the provider they chose
# in which case fall back to none
[[ $tmp ]] && echo "$CANDIDATES" | grep -x -q "$tmp" &&
default=$tmp || default=none
@@ -813,9 +1084,9 @@ function work_optional_depends_provider()
select_provider "provider" "$default" 1 $CANDIDATES

if [ $provider == "none" ] ; then
- private_common_depends "($1)" "off" "optional" "$2" "$3"
+ private_common_depends "($1)" "off" "$database_term" "$2" "$3"
else
- private_common_depends "$provider($1)" "on" "optional" "$2" "$3"
+ private_common_depends "$provider($1)" "on" "$database_term" "$2" "$3"
fi

}
@@ -832,18 +1103,24 @@ function work_optional_depends_spell()

debug "libdepends" "$FUNCNAME - $@"
local default
-
+
+ local failure_ok=$1
+ local article=$2
+ local query_term=$3
+ local database_term=$4
+ shift 4
+
# if $1 optionally depends on something exiled we always say no
- if spell_exiled $1 ; then
- message "${SPELL_COLOR}${1}${DEFAULT_COLOR} has been exiled! not using
as a depends"
+ if spell_exiled $1 ; then
+ depends_message "${1}" "has been exiled! not using as $article
$query_term"
hash_put $CANNOT_CAST_HASH "$1" "Exiled"
- private_common_depends "$1" "off" "optional" "$2" "$3"
+ private_common_depends "$1" "off" "$database_term" "$2" "$3"
return 0
fi
-
-
+
+
if [[ ! $RECONFIGURE ]] ; then
- # See if there are preferences already in DEPENDS_STATUS, but only if
+ # See if there are preferences already in DEPENDS_STATUS, but only if
# not reconfiguring...
# example: icewm:imlib:off:optional:--with-imlib:--with-xpm
local status=()
@@ -851,18 +1128,25 @@ function work_optional_depends_spell()
if [[ ${status[2]} ]] ; then
# ah there are! use them
if [[ ${status[2]} == "on" ]] ; then
- message "${SPELL_COLOR}${SPELL}${DEFAULT_COLOR}" \
- "${CHECK_COLOR}optionally depends on" \
- "${SPELL_COLOR}${1}${DEFAULT_COLOR}"
+ depends_message "${SPELL}" "has an enabled $query_term on" "${1}"
else
- message "${SPELL_COLOR}${SPELL}${DEFAULT_COLOR}" \
- "${CHECK_COLOR}has a disabled optional depends on" \
- "${SPELL_COLOR}${1}${DEFAULT_COLOR}"
+ depends_message "${SPELL}" "has a disabled $query_term on" "${1}"
fi
- private_common_depends "$1" "${status[2]}" "optional" "$2" "$3"
+ private_common_depends "$1" "${status[2]}" "$database_term" "$2" "$3"
return 0
fi
fi
+ # colors differ from depends_message
+ if [[ $4 ]]; then
+ message "${SPELL_COLOR}${SPELL}${DEFAULT_COLOR}" \
+ "has $article $query_term on" \
+ "${SPELL_COLOR}$1${DEFAULT_COLOR} ($4)"
+ else
+ message "${SPELL_COLOR}${SPELL}${DEFAULT_COLOR}" \
+ "has $article $query_term on" \
+ "${SPELL_COLOR}$1${DEFAULT_COLOR}"
+ fi
+

# check for abandoned answers
if [ -e $ABANDONED_DEPENDS/$SPELL ] ; then
@@ -909,22 +1193,17 @@ function work_optional_depends_spell()
local stuff
[[ $default == off ]] && stuff=n || stuff=y

- message "${SPELL_COLOR}${1}${DEFAULT_COLOR}" \
- "is an optional dependency for" \
- "${SPELL_COLOR}$SPELL${DEFAULT_COLOR} ($4)"
-
if spell_ok $1 ; then
- query "Do you want to use ${SPELL_COLOR}$1${DEFAULT_COLOR}?" "$stuff"
&&
+ query "Do you want to use ${SPELL_COLOR}$1${DEFAULT_COLOR}?" "$stuff" &&
install="on"
else
- query "Do you want to cast ${SPELL_COLOR}$1${DEFAULT_COLOR}?" "$stuff"
&&
+ query "Do you want to cast ${SPELL_COLOR}$1${DEFAULT_COLOR}?" "$stuff" &&
install="on"
fi

- private_common_depends "$1" "$install" "optional" "$2" "$3"
+ private_common_depends "$1" "$install" "$database_term" "$2" "$3"
}

-
#---------------------------------------------------------------------
## @param name of return variable
## @param default answer
@@ -964,7 +1243,7 @@ function select_provider()
for each in $@; do
char=${stuff[$i]}
hash_put CHAR_TO_SPELL $char $each
-
+
[[ $each == $default ]] && default_char=$char
if spell_ok $each ; then
message
"\t${DEFAULT_COLOR}($char)\t${SPELL_COLOR}$each${DEFAULT_COLOR}\t (installed)"
@@ -1016,13 +1295,81 @@ function private_up_trigger() {

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

triggerees=( ${triggerees[*]} $TARGET )
}

#---------------------------------------------------------------------
+## @param spell providing the sub-depends
+## @param name of sub-depends
+##
+## Request a sub-depends from $SPELL on $1 for $2
+## This queues the sub-depends for later processing, if the sub-dependee
+## does not already support the sub-depends.
+#---------------------------------------------------------------------
+function real_sub_depends() {
+ $STD_DEBUG
+ local requester=$SPELL
+ local sub_dependee=$1
+ local sub_depends=$2
+
+ message "${SPELL}${DEFAULT_COLOR}" "requests" "$sub_dependee" \
+ "${CHECK_COLOR}with ${SPELL_COLOR}$sub_depends${DEFAULT_COLOR}"
+
+ # Check if the sub-depends is already known
+ if spell_ok $sub_dependee; then
+ if [[ $(search_sub_depends "$SUB_DEPENDS_STATUS" "$requester" \
+ "$sub_dependee" "$sub_depends") != "" ]]; then
+ debug "libdepends" "$FUNCNAME -- $requester -> $sub_dependee" \
+ "-> $sub_depends provided by installed spell"
+ return 0
+ fi
+
+ # the spell is installed, but the sub-depends isn't recorded, ask the
+ # spell if the sub-depends is enabled through the PRE_SUB_DEPENDS file.
+ (
+ THIS_SUB_DEPENDS=$sub_depends
+ if ! tablet_set_spell $sub_dependee ; then
+ codex_set_current_spell_by_name $sub_dependee || return 1
+ fi
+ 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"
+ add_sub_depends "$SUB_DEPENDS_STATUS" "$requester" \
+ "$sub_dependee" "$sub_depends"
+ hash_append sub_dep_f_hash $requester $sub_dependee:$sub_depends $'\n'
+ hash_append sub_dep_r_hash $sub_dependee $requester:$sub_depends $'\n'
+ return 0
+ }
+ fi
+
+ # 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 -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
+ message "${PROBLEM_COLOR}Sub-depends requested on" \
+ "a held spell${DEFAULT_COLOR}"
+ return 1
+ fi
+
+ # add to hashes for lookup later in depends resolution
+ hash_append sub_dep_f_hash $requester $sub_dependee:$sub_depends $'\n'
+ hash_append sub_dep_r_hash $sub_dependee $requester:$sub_depends $'\n'
+
+ # spell is either not installed, or is installed but without the
+ # sub-depends, we must (re)cast it
+ NEW_SUB_DEPENDEES=( ${NEW_SUB_DEPENDEES[*]} $sub_dependee )
+ hash_put sub_depends_process $sub_dependee "yes"
+ return 0
+}
+
+#---------------------------------------------------------------------
## Force a spell to be recast, if it comes up for processing
## if the spell was already looked at and processed nothing happens
## if the spell was already looked at and didnt need processing, then
@@ -1032,9 +1379,7 @@ function real_force_depends() {
debug "libdepends" "$FUNCNAME - $SPELL - $@"
local check=$(hash_get "depends_looked_at" "$1")

- message "${SPELL_COLOR}${SPELL}${DEFAULT_COLOR}" \
- "${CHECK_COLOR}is forcing a recast of" \
- "${SPELL_COLOR}${1}${DEFAULT_COLOR}"
+ message "${SPELL}" "is forcing a recast of" "${1}"

if [[ "$check" == "ignore" ]] ; then
hash_put "depends_looked_at" "$1" ""
@@ -1046,19 +1391,25 @@ function real_force_depends() {
## all the depends callbacks eventually bottom out here
## if a spell depends or doesnt depend on some other spell
## @param Spell
-## @param on/off
+## @param on/off
#---------------------------------------------------------------------
function private_common_depends()
{
debug "libdepends" "$FUNCNAME - $SPELL - $@"
add_depends $spell_depends "$SPELL" "$@"
-
+
+ # runtime and suggested depends have no formal dependency info
if [[ $2 == on ]] ; then
# ${1%(*} = spell name (strips potential provider name)
local spell_name=${1%(*}
- NEW_DEPENDS=( ${NEW_DEPENDS[*]} $spell_name )
+ case $3 in
+ runtime|suggest)
+ NEW_RUNTIME_DEPENDS=( ${NEW_RUNTIME_DEPENDS[*]} $spell_name ) ;;
+ *) NEW_DEPENDS=( ${NEW_DEPENDS[*]} $spell_name ) ;;
+ esac
fi
-
+
+
return 0
}

@@ -1066,7 +1417,7 @@ function private_common_depends()
## Default trigger checking function. Asks user if they want to
## run the trigger.
#---------------------------------------------------------------------
-function default_trigger_check() {
+function real_default_sorcery_trigger_check() {
message "${SPELL_COLOR}${SPELL}${DEFAULT_COLOR}" \
"${CHECK_COLOR}triggers a" \
"${SPELL_COLOR}${ACTION}${DEFAULT_COLOR}" \
@@ -1088,15 +1439,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
@@ -1110,7 +1454,7 @@ function private_add_triggerees() {

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


#---------------------------------------------------------------------
-## Adds the dependency to the hastable
+## Adds the dependency to the hastable
#---------------------------------------------------------------------
function private_add_depends()
{
debug "libdepends" "$FUNCNAME: SPELL=$SPELL, NEW_DEPENDS=${NEW_DEPENDS[*]}"
- hash_put "$CAST_HASH" "$SPELL" "${NEW_DEPENDS[*]}"
+ hash_append "$CAST_HASH" "$SPELL" "${NEW_DEPENDS[*]}"

for child in ${NEW_DEPENDS[*]}; do
hash_append "$BACK_CAST_HASH" "$child" "$SPELL"
@@ -1143,15 +1487,54 @@ function private_add_depends()
hash_append "$BACK_CAST_HASH" "basesystem" "$SPELL"
fi

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

TRIGGEREES=( ${TRIGGEREES[*]} ${triggerees[*]} )
spells=( ${spells[*]} ${triggerees[*]} )

+ UP_DEPENDS=( ${UP_DEPENDS[*]} ${NEW_UP_DEPENDS[*]} )
+
hash_put "depends_looked_at" "$SPELL" "done"

}

+#---------------------------------------------------------------------
+## Determine if spell should be lazily updated, possible asks the user
+## what to do.
+#---------------------------------------------------------------------
+function want_lazy_update() {
+ if [[ $LAZY_DEPENDS_UPDATES ]] && [[ $LAZY_DEPENDS_UPDATES != ignore ]] ;
then
+ if does_spell_need_update "$1" ; then
+ depends_message "$1" "needs updating"
+ if [[ "$LAZY_DEPENDS_UPDATES" == always ]] ; then
+ return 0
+ else
+ default=n
+ [[ $LAZY_DEPENDS_UPDATES == ask-yes ]] && default=y
+ query "Would you like to update it?" $default && return 0 || return 1
+ fi
+ fi
+ fi
+ return 1
+}
+
+function depends_message() {
+ if [[ $# -ge 2 ]] ; then
+ message -n "${SPELL_COLOR}${1}${DEFAULT_COLOR}" \
+ "${CHECK_COLOR}${2}${DEFAULT_COLOR}"
+ fi
+ if [[ $# -ge 3 ]] ; then
+ message -n " ${SPELL_COLOR}${3}${DEFAULT_COLOR}"
+ fi
+ if [[ $# -ge 4 ]] ; then
+ message -n " $4"
+ fi
+ message ""
+}

#########################BEGIN OTHER STUFF############################

@@ -1160,64 +1543,75 @@ function private_add_depends()
#---------------------------------------------------------------------
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"
}

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

SPELL_CONFIG=$DEPENDS_CONFIG/$SPELL
- debug "libdepends" "run_spell_config() - DEPENDS_CONFIG=$DEPENDS_CONFIG
SPELL=$SPELL, SPELL_CONFIG=$SPELL_CONFIG DEPENDS_STATUS=$DEPENDS_STATUS"
-
+ debug "libdepends" "run_spell_config() - DEPENDS_CONFIG=$DEPENDS_CONFIG
SPELL=$SPELL, SPELL_CONFIG=$SPELL_CONFIG DEPENDS_STATUS=$DEPENDS_STATUS"
+
if [ -x $SPELL_CONFIG ]; then
debug "libdepends" "run_spell_config() - found $SPELL_CONFIG"
- . $SPELL_CONFIG
+ . $SPELL_CONFIG
fi
}

#---------------------------------------------------------------------
-# i dont know if this should be here
+## Output the upward dependencies of the specified spell
+## @Param spell
+## @Param depth (optional)
+## @Param fast -- if set only show spells, not full depends db entries
#---------------------------------------------------------------------
-function show_depends()
+function real_show_up_depends()
{
- debug "libdepends" "show_depends() - $@"
- local DEP_SPELL=`esc_str $1`
- local DEPTH=$2
-
- if ! echo "$DONE" | grep -q "$DEP_SPELL"; then
- DONE="$DONE $1"
-
- function ld99() {
-
- [[ $MAX_DEPTH ]] && [[ $DEPTH -ge $MAX_DEPTH ]] && return 1
-
- SPELL=`echo $1 | cut -d : -f1`
- STATUS=`echo $1 | cut -d : -f3`
-
- if [ "$STATUS" == "on" ]; then
- echo $1
- show_depends $SPELL $(( DEPTH + 1 ))
- fi
-
+ local i=0
+ local MAX_DEPTH=$2
+ local type=$3
+ function show_up_depends_sub() {
+ local each
+ let i++
+ [[ $MAX_DEPTH ]] && [[ $i -gt $MAX_DEPTH ]] && return
+ for each in $(hash_get foo $1); do
+ if ! [[ $(hash_get done $each) ]] ; then
+ hash_put done $each done
+ echo $each:$1
+ show_up_depends_sub $each
+ elif [[ "$type" == "verbose" ]] ; then
+ echo $each:$1
+ fi
+ done
}
-
- iterate "ld99" $'\n' "$(grep ":$DEP_SPELL\(([^:]*)\)\?:"
$DEPENDS_STATUS)"
-
- fi
+ hash_reset foo
+ hash_reset done
+ compute_reverse_installed_depends foo
+ if [[ "$type" == "verbose" ]] ; then
+ lock_file "$DEPENDS_STATUS"
+ show_up_depends_sub "$1"|while read line; do
+ grep "$line" "$DEPENDS_STATUS"
+ done
+ unlock_file "$DEPENDS_STATUS"
+ else
+ show_up_depends_sub "$1"|cut -f1 -d:
+ fi|sort|uniq
+ hash_reset foo
+ hash_reset done
}

+
#---------------------------------------------------------------------
##=back
##
diff --git a/var/lib/sorcery/modules/libdepengine
b/var/lib/sorcery/modules/libdepengine
index cfb6c7b..0aa6396 100755
--- a/var/lib/sorcery/modules/libdepengine
+++ b/var/lib/sorcery/modules/libdepengine
@@ -125,7 +125,7 @@ function depengine_cast_engine() {
# despite the fact that we failed
execute_triggers $spell 1
fi
-
+
dpgn_set_spell_color $spell black:$rc

return $rc
diff --git a/var/lib/sorcery/modules/libdispel
b/var/lib/sorcery/modules/libdispel
index 9114cf4..5f73918 100755
--- a/var/lib/sorcery/modules/libdispel
+++ b/var/lib/sorcery/modules/libdispel
@@ -41,7 +41,9 @@ function reap_config_files() {
local FILE
while read FILE; do
[[ $FILE ]] || continue
- if grep -q "$(md5sum "$FILE" )" "$MD5S"; then
+ if [[ $TOTAL_DISPEL ]] ; then
+ rm -f "$FILE"
+ elif grep -q "$(md5sum "$FILE" )" "$MD5S"; then
debug libdispel "$FILE is a config file that hasnt changed,
removing..."
rm -f "$FILE"
else
@@ -73,19 +75,33 @@ function reap_modified_file() {
}

#---------------------------------------------------------------------
+## Removes spell config stages if there are any
+#---------------------------------------------------------------------
+function reap_spell_config_stage() {
+ lock_file "$CONFIG_STAGE_DIRECTORY/$SPELL"
+ # it's locked - we also don't have to care about the unlikely "current"
stage
+ rm -fr "$CONFIG_STAGE_DIRECTORY/$SPELL"
+ unlock_file "$CONFIG_STAGE_DIRECTORY/$SPELL"
+}
+
+#---------------------------------------------------------------------
## Removes depends entries for what the spell depends on
#---------------------------------------------------------------------
function reap_depends() {
# save the old depends data as abandoned stuff so its seen later on
# recasts as the default
mkdir -p $ABANDONED_DEPENDS
- search_depends_status $DEPENDS_STATUS $SPELL > $ABANDONED_DEPENDS/$SPELL
+ local t_file
+ lock_start_transaction "$ABANDONED_DEPENDS/$SPELL" t_file
+ search_depends_status $DEPENDS_STATUS $SPELL > $t_file
+ lock_commit_transaction "$ABANDONED_DEPENDS/$SPELL"

# This conditional is here because the iso team wants to be able to
# save dependencies after dispel (bug 8109), average users are expected
# to always run this code to remove old depends.
if [[ $NO_REAP_DEPENDS != "on" ]] ; then
remove_depends_status $DEPENDS_STATUS $SPELL
+ remove_sub_depends "$SUB_DEPENDS_STATUS" "$SPELL" ".*"
fi
}

@@ -270,46 +286,22 @@ function load_spell() {
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
#---------------------------------------------------------------------
@@ -341,6 +333,7 @@ function dispel_spell() {
reaper $INST_LOG $MD5_LOG &&
post_remove &&
reap_state_files $INST_LOG &&
+ reap_spell_config_stage &&
remove_spell $SPELL &&
{ [[ $TRIGGER == off ]] || trigger "dispel";} &&
remove_triggers $SPELL &&
@@ -360,7 +353,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.
#---------------------------------------------------------------------
@@ -380,9 +373,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 f064cb8..5ee013d 100755
--- a/var/lib/sorcery/modules/libdownload
+++ b/var/lib/sorcery/modules/libdownload
@@ -60,13 +60,12 @@ fi
## Download a specified group of urls, they are assumed to all be understood
## by the specified 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.
+## @Param type Name of handler
+## @Note The remainder of the arguments are target, url_list, hints,
dl_target
+## @Note and dl_type. See above for information.
##
##
#-------------------------------------------------------------------------
-
function dl_get_bucket() {
$STD_DEBUG
local handler=$1
@@ -83,7 +82,7 @@ function dl_get_bucket() {
message "$handler is not a valid handler, this is probably a sorcery bug"
return 255
fi
-
+
dl_${handler}_get "$target" "$url_list" "$hints" "$dl_target" "$dl_type"
rc=$?
if [[ $rc == 0 ]] ; then
@@ -96,7 +95,7 @@ function dl_get_bucket() {

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

}

-
-#---------------------------------------------------------------------
-## @param new path to add
-## @param old path
-## @Stdout new path
-## Echos the old path with new path prepended, separated with a ':'
-#---------------------------------------------------------------------
-function gcc2_prepend_path() {
-
- if test -z $2
- then echo $1
- else echo $1:$2
- fi
-
-}
-
-
#---------------------------------------------------------------------
## @param path
##
@@ -75,10 +58,10 @@ function gcc2_prepend_path() {
#---------------------------------------------------------------------
function gcc2_add_paths() {

- export PATH=$( gcc2_prepend_path $1/bin $PATH )
- export LD_LIBRARY_PATH=$( gcc2_prepend_path $1/lib $LD_LIBRARY_PATH )
- export LD_RUN_PATH=$( gcc2_prepend_path $1/lib $LD_RUN_PATH )
- export INFOPATH=$( gcc2_prepend_path $1/info $INFOPATH )
+ export PATH=$( envar_prepend_path $1/bin $PATH )
+ export LD_LIBRARY_PATH=$( envar_prepend_path $1/lib $LD_LIBRARY_PATH )
+ export LD_RUN_PATH=$( envar_prepend_path $1/lib $LD_RUN_PATH )
+ export INFOPATH=$( envar_prepend_path $1/info $INFOPATH )
export CPPFLAGS="-I $1/include $CPPFLAGS"

}
@@ -87,7 +70,7 @@ function gcc2_add_paths() {
#---------------------------------------------------------------------
##
## Determines if gcc2 should be used for a spell. If so, it alters
-## the environment so that gcc2 is used for compilation.
+## the environment so that gcc2 is used for compilation.
##
#---------------------------------------------------------------------
function invoke_gcc2() {
diff --git a/var/lib/sorcery/modules/libgpg b/var/lib/sorcery/modules/libgpg
index 7b24baf..682d1cf 100755
--- a/var/lib/sorcery/modules/libgpg
+++ b/var/lib/sorcery/modules/libgpg
@@ -65,7 +65,7 @@ function gpg_verify_signature() { # $1 sig $2 file $3
pubring $4 algo var
cat $output
return $rc
fi
- algo=$(grep 'digest algorithm' $output | awk '{ print $NF }' | tr A-Z
a-z)
+ algo=$(awk '/digest algorithm/ { print tolower($NF) }' $output | sort -u)
rm $output &>/dev/null
fi
[ ! -z "$4" ] && eval "$4=\"$algo\""
@@ -239,7 +239,7 @@ function gpg_verify_common() {
local SOURCE=$(basename $FILENAME)

local SIG_FILE=${SOURCE}.${GPG_SIG_EXT}
- pushd $TMP_DIR &>/dev/null ||
+ pushd $TMP_DIR &>/dev/null ||
{ message "Failed to cd to $TMP_DIR!!"; return 2;}
if test -z "$SIGNATURE" ; then
local SIG_URL=$SOURCE_URL/$SIG_FILE
@@ -408,7 +408,7 @@ function grimoire_tree_user_query() {
"${DEFAULT_COLOR}${PROBLEM_COLOR}failed!"
message "What would you like to do?${DEFAULT_COLOR}"
local choice
- select_list choice 0 "set aside" "remove" "ignore"
+ select_list choice "" "set aside" "remove" "ignore"
case "$choice" in
"set aside") local tgt=$grimoire_name.$(date +%Y%m%d%H%M).corrupt
message "moving grimoire to $tgt"
@@ -421,7 +421,7 @@ function grimoire_tree_user_query() {
esac
return 1
}
-
+
#---------------------------------------------------------------------
## This software is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
diff --git a/var/lib/sorcery/modules/libgrimoire
b/var/lib/sorcery/modules/libgrimoire
index ede7d76..968527a 100755
--- a/var/lib/sorcery/modules/libgrimoire
+++ b/var/lib/sorcery/modules/libgrimoire
@@ -17,7 +17,7 @@

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

pushd $BUILD_DIRECTORY 2>&1 > /dev/null

- umount -l $DEAD_DIR 2> /dev/null
+
+ # make sure nothing recursive is mounted under deaddir
+ mount |
+ while read line
+ do
+ local mount=$(echo $line | cut -d' ' -f1)
+ local mountloc=$(echo $line | cut -d' ' -f3)
+ if echo $mountloc | grep -q "^$DEAD_DIR"
+ then
+ debug "libgrimoire" "Unmounting $mount on $mountloc"
+ umount -l $mountloc 2> /dev/null
+ fi
+ done

# We don't really want to use "rm -rf", but if not using tmpfs,
# we have to. So we move the old dir to a known place before
@@ -150,10 +162,10 @@ function make() {

#---------------------------------------------------------------------
## Install files in a spells "desktop" subdirectory for .desktop
-## @param Spell
+## @param Spell
## @Stdout file name
#---------------------------------------------------------------------
-function install_desktop_files() {
+function install_desktop_files() {
debug "libgrimoire" "Running install_desktop_files() on $SPELL"
local each file
local target_dir="/usr/share/applications"
@@ -174,7 +186,7 @@ function install_desktop_files() {
#---------------------------------------------------------------------
## @Type API
## @param spell
-##
+##
## Returns the current version of the given spell
##
#---------------------------------------------------------------------
@@ -192,7 +204,7 @@ function real_installed_version() {
##
#---------------------------------------------------------------------
function private_installed_version() {
- grep "^$1:" $SPELL_STATUS | cut -d : -f4 | head -n 1
+ awk -F: -v spell="$1" '{ if(spell == $1) {print $4; exit}}' $SPELL_STATUS
2>/dev/null
}

#---------------------------------------------------------------------
diff --git a/var/lib/sorcery/modules/libhash b/var/lib/sorcery/modules/libhash
index 83c0d78..a757c77 100755
--- a/var/lib/sorcery/modules/libhash
+++ b/var/lib/sorcery/modules/libhash
@@ -9,7 +9,7 @@
## values into fields of a table. The 'hash_put' function takes the
## name of the table, a field name in the table, and the value to be
## stored in the table. The 'hash_get' function retrieves a value from
-## the table given the table and field name.
+## the table given the table and field name.
##
## <pre>
## To store a value into a field of a table, use hash_put:
@@ -21,16 +21,17 @@
## hash_get "myTable" "aField"
##
## In this example, the hash_get function would echo "theValue".
+## hash_get_ref can also be used here and has the benefit of being forkless.
## </pre>
-## <br>
+## <br />
## <p>IMPLEMENTATION NOTE</p>
-## <br>
-## Bash does not provide direct support for hash tables. These
+## <br />
+## Bash does not provide direct support for hash tables. These
## functions are implemented by first building a variable using the
## table name and field name, then using the eval function to store
-## (retrieve) value into (from) the variable.
+## (retrieve) value into (from) the variable.<br />
##
-## The idea for the hash data structure in bash was inspired by a
+## The idea for the hash data structure in bash was inspired by a
## short example by Phil Howard which shows the use of hashes in bash.
## Phil Howard's original example can be found here:
##
@@ -65,8 +66,8 @@ function hash_build_variable_name() {
___TABLE=${___TABLE//\:/_CLN_}
___TABLE=${___TABLE// /_SPC_}
___TABLE=${___TABLE//[/_OSB_}
- ___TABLE=${___TABLE//]/_CSB_}
-
+ ___TABLE=${___TABLE//]/_CSB_}
+
if [[ $___FIELD ]] ; then
___FIELD=${___FIELD//\+/_P_}
___FIELD=${___FIELD//\-/_M_}
@@ -98,7 +99,7 @@ function hash_unbuild_field_name() {
local ___FIELD=${1#$___TABLE}
___FIELD=${___FIELD%_*}
# `echo "$1" | sed -n "s/^$2\(.*\)_$/\1/p"`
-
+
# debug "libhash" "hash_unbuild_field_name() -
TABLE=$___TABLE:FIELD=$___FIELD"

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

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

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

}

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


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

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

if [ ! -f "$file" ] ; then
- [ ! -f "$target_file" ] &&
+ [ ! -f "$target_file" ] &&
message "${PROBLEM_COLOR}Unable to find file
$file...${DEFAULT_COLOR}"
continue
fi
@@ -216,8 +216,8 @@ function init_install()
. ${INSTALL_ROOT}/etc/sysconfig/init

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

if [ ! -d "$runlevel_dir" ] ; then
diff --git a/var/lib/sorcery/modules/liblock b/var/lib/sorcery/modules/liblock
index 487c8e4..70cd4b2 100755
--- a/var/lib/sorcery/modules/liblock
+++ b/var/lib/sorcery/modules/liblock
@@ -10,15 +10,13 @@
## locks. Therefor, we need a list of locks for the current
## process. And we need to update this list at the same time we got the
## lock.
-## liblock is used to lock and unlock resources. It should be deadlock
+## liblock is used to lock and unlock resources. It should be deadlock
## free, and clean up locks after processes that had locks die without
## unlocking the files. It uses the directory $LOCK_DIR defined in
## /etc/sorcery/config
#-----------------------

-# global options that can be changed to suit your needs.
-#Perhaps this should be moved to the config? (Duff, 04/07)
-
+# global options for external users; sorcery defines these in its own config
[ -z "$LOCK_DIR" ] && LOCK_DIR=/tmp/lockdir
[ -z "$MAX_SLEEP" ] && MAX_SLEEP=2

@@ -26,13 +24,13 @@
## lock_resources
## @param Type of resource
## @param Name of resource
-##
+## <pre>
## Type of resource | Name of resource | Usage
## cast | spell name | when casting a spell
## file | file name | to lock a file
## summon | spell name | when downloading a spell
## network | network | ?
-## solo | resource name | when using a resource exclusively
+## solo | resource name | when using a resource exclusively
## libgrimoire | install | when a spell is in the install stage
## </pre>
## locking solo will not cause these routines to behave any different.
@@ -63,7 +61,7 @@ lock_resources()
## @param Type of resource
## @param Name of resource
##
-## this function tries to lock the specified resource. On success, it
+## this function tries to lock the specified resource. On success, it
## immediately returns 0 (true). On failure (the lock cannot be
## acquired), it returns 1 (false).
#---------------------------------------------------------------------
@@ -73,23 +71,24 @@ trylock_resources()
# echo "usage: trylock_resources type_of_resource name_of_resource"
# exit -1
# fi
-
+
local lockfile="$1.$2"
# we replace / with ^
lockfile="${LOCK_DIR}/${lockfile//\//^}"

debug "trylock_resources" "lockfile=${lockfile}"

- mkdir -p "${LOCK_DIR}"
+ [[ -d $LOCK_DIR ]] || mkdir -p "$LOCK_DIR"

- if ! mkdir "${lockfile}" 2>/dev/null; then
+ if [[ -d ${lockfile} ]] || ! mkdir "${lockfile}" 2>/dev/null; then
# we try to remove stale locks here and try again
+ sleep 0.1
global_clean_resources
if ! mkdir "${lockfile}" 2>/dev/null; then
return 1
fi
fi
- ln -sf /proc/$$ "${lockfile}/$$"
+ [[ -e ${lockfile}/$$ ]] || ln -s /proc/$$ "${lockfile}/$$"
return 0
}

@@ -111,13 +110,13 @@ excllock_resources()
# 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)
+ do
+ #^^^ 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
+ done
+ #theoretically, someone could create a lock now... tiny race
trylock_resources "$@"
}

@@ -129,7 +128,7 @@ excllock_resources()
## this function unlocks the specified resource and returns immediately
## if the specified resource is :
## - unlocked : nothing is done
-## - locked by this process : it's unlocked
+## - locked by this process : it's unlocked
## - locked by another process : it's kept locked.
## In all cases and for compatibility reasons with the old liblock, we
## return true
@@ -186,9 +185,9 @@ 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 &&
@@ -199,13 +198,13 @@ 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
+## Locks files for access to only this PID. Will cause attempts by
## other processes that want to lock the file(s) to block until this
## PID unlocks the file, or this PID dies.
-## It cannot prevent bad programs from modifying the file w/o
+## It cannot prevent bad programs from modifying the file w/o
## permission.
## Note: Files with funky chars may break things. No colons or stuff.
## @Blocking
@@ -213,88 +212,80 @@ global_clean_resources()
#---------------------------------------------------------------------
function lock_file()
{
- debug "liblock" "$FUNCNAME - $*"
- local FILE
- lock_resources $(
- for FILE in "$@" ; do
- echo file $FILE
- done
- )
+ debug "liblock" "$FUNCNAME - $*"
+ lock_resources file "$1"
}


#---------------------------------------------------------------------
-## @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 - $*"
+ unlock_resources file "$1"
}

#---------------------------------------------------------------------
-## @param File to start transaction on
-## @param <file> ... (optional)
+## @param File to start transaction on
+## @param <file> ... (optional)
+## @param variable to set (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
-## the transaction is commited. Furthermore, a transaction can be
-## killed before it is commited, ending the transaction and not
-## making any changes to the files. All files are locked at once.
-## If not all can be locked, they will be unlocked, and another try
+## the transaction is commited. Furthermore, a transaction can be
+## killed before it is commited, ending the transaction and not
+## making any changes to the files. All files are locked at once.
+## If not all can be locked, they will be unlocked, and another try
## will be made.
##
-## @return The name of a temporary file that should be written to
-## instead of the real file.
-##
+## @Stdout The name of a temporary file that should be written to instead of
the real file.
+## @return 0 If successful
+## @return 1 If not successful
#---------------------------------------------------------------------
function lock_start_transaction()
{
debug "liblock" "$FUNCNAME - $*"
- local i TRANSNAME NUMTRANS RET=""
-
- if lock_file "$@" ; then
-
+ local NUMTRANS transaction_file file="$1"
+
+ if lock_file "$file" ; then
+
lock_file $LOCK_TRANSACTIONS
[ -s $LOCK_TRANSACTIONS ] || echo "0:::" > $LOCK_TRANSACTIONS
-
+
NUMTRANS=`tail -n 1 $LOCK_TRANSACTIONS | cut -d : -f 1`
- NUMTRANS=${NUMTRANS:-1}
- RET=()
-
- for i in $* ; do
- let NUMTRANS++
- # cp file to temp file, if doesn't exist, create empty file.
- if [ -e "$i" ] ; then
- cp "$i" "$LOCK_TRANSACTIONS.$NUMTRANS"
- else
- echo -n "" > $LOCK_TRANSACTIONS.$NUMTRANS
- fi
- echo "$NUMTRANS:$i:$$" >$LOCK_TRANSACTIONS
- RET[$NUMTRANS]="${LOCK_TRANSACTIONS}.${NUMTRANS}"
- done
-
+ NUMTRANS=${NUMTRANS:-1} # TODO: check if this should fallback to 0
+
+ let NUMTRANS++
+ transaction_file="$LOCK_TRANSACTIONS.$NUMTRANS"
+ # cp file to temp file or if doesn't exist, create an empty file.
+ if [[ -e $file ]]; then
+ cp "$file" "$transaction_file"
+ else
+ echo -n "" > "$transaction_file"
+ fi
+ echo "$NUMTRANS:$file:$$" >> $LOCK_TRANSACTIONS
+
unlock_file $LOCK_TRANSACTIONS
- echo ${RET[*]}
+ if [[ $2 ]]; then
+ eval "$2=\"\$transaction_file\""
+ else
+ echo "$transaction_file"
+ fi
return 0
-
+
else
return 1
fi
}

#---------------------------------------------------------------------
-## @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.
@@ -304,7 +295,7 @@ function lock_commit_transaction()
{
debug "liblock" "$FUNCNAME - $*"
local TMP_FILE unlockList=""
-
+
lock_file $LOCK_TRANSACTIONS
for i in $* ; do
TMP_FILE=${LOCK_TRANSACTIONS}.$(grep ".*:$i:$$" $LOCK_TRANSACTIONS | cut
-d : -f 1)
@@ -312,34 +303,36 @@ function lock_commit_transaction()
if [ $? -ne 0 ] ; then
message "${PROBLEM_COLOR}Transaction commit failed on $i."
message "${DEFAULT_COLOR}The modified file is stored in $TMP_FILE."
- message "This normaly happens when the disk runs out of space."
+ message "This normally happens when the disk runs out of space."
if ! query "Do you wish to continue?" "n" ; then
exit 1
fi
else
- rm $TMP_FILE
+ rm $TMP_FILE
fi
unlock_file $i
cp $LOCK_TRANSACTIONS $LOCK_TRANSACTIONS.new
if [ $? -ne 0 ] ; then
message "${PROBLEM_COLOR}Transaction commit failed on
$LOCK_TRANSACTIONS."
message "${DEFAULT_COLOR}"
- message "This normaly happens when the disk runs out of space."
+ message "This normally happens when the disk runs out of space."
if ! query "Do you wish to continue?" "n" ; then
exit 1
fi
fi
grep -v ".*:$i:$$" $LOCK_TRANSACTIONS.new >$LOCK_TRANSACTIONS &&
- { rm $LOCK_TRANSACTIONS.new ||
- message "${PROBLEM_COLOR}Very odd case. Quitting."; exit 1; }
+ if ! rm $LOCK_TRANSACTIONS.new; then
+ message "${PROBLEM_COLOR}Very odd case. Quitting."
+ exit 1
+ fi
done
- unlock_file $LOCK_TRANSACTIONS
+ unlock_file $LOCK_TRANSACTIONS

}

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

#---------------------------------------------------------------------
@@ -393,7 +386,8 @@ function counter_down() {
counterfile="${LOCK_DIR}/${counterfile//\//^}"

touch $counterfile
- local tc=$(lock_start_transaction $counterfile)
+ local tc
+ lock_start_transaction "$counterfile" tc
for each in $(counter_clean $tc); do
[[ $foo ]] && echo $each && continue
if [[ $each == $$ ]] ; then foo=found ; else echo $each; fi
@@ -433,7 +427,8 @@ function counter_check() {
# we replace / with ^
counterfile="${LOCK_DIR}/${counterfile//\//^}"
if test -f $counterfile ; then
- local tc=$(lock_start_transaction $counterfile)
+ local tc
+ lock_start_transaction "$counterfile" tc
# sort saves a temp file since it has to read all the input
counter_clean $tc |sort > $tc
lock_commit_transaction $counterfile
@@ -444,7 +439,7 @@ function counter_check() {
}

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

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

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


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

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

}
diff --git a/var/lib/sorcery/modules/libmisc b/var/lib/sorcery/modules/libmisc
index 7df481c..dcbd21e 100755
--- a/var/lib/sorcery/modules/libmisc
+++ b/var/lib/sorcery/modules/libmisc
@@ -46,11 +46,11 @@ function explode()
## @param sed command
## @param file
##
-## First argument is a sed command. Second argument is a file.
-## sedit performs the sed command on the file, modifiying the
-## original file. For example,
+## First argument is a sed command. Second argument is a file.
+## sedit performs the sed command on the file, modifiying the
+## original file. For example,
## <br>sedit "s/foo/bar/g" /tmp/somefile <br>
-## will replace all occurances of foo with bar in /tmp/somefile.
+## will replace all occurances of foo with bar in /tmp/somefile.
## This function is often used in spells to make changes to source
## files before compiling. See the sed man page for more information.
##
@@ -62,29 +62,31 @@ function real_sedit() {
#---------------------------------------------------------------------
## @Type API
## @param string to check
+## @return 0 if true
+## @return 1 if false
##
## Argument is a string to check if the string contains all digits or
## not
#--------------------------------------------------------------------
function isdigit() {
- echo $1 | grep '[[:digit:]]+' >> /dev/null 2>&1 &&
- return 0
+ echo $1 | grep '[[:digit:]]+' >> /dev/null 2>&1
}

#--------------------------------------------------------------------
## @Type API
## @param string to check
+## @return 0 if true
+## @return 1 if false
##
-## Argumtemt is a string to check if it contains all chars a-zA-Z
+## Argument 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
}

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

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

if [ -z "$SILENT" ]; then

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

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

[[ $DEBUG ]] || return 0
-
+
local debugVar="DEBUG_${1}"
local i
if [[ ${!debugVar} != "no" ]] ; then
@@ -221,7 +229,7 @@ function debug() {
##
#---------------------------------------------------------------------
function progress_spinner() {
- let PROGRESS_SPINNER=$PROGRESS_SPINNER+1
+ let PROGRESS_SPINNER=$PROGRESS_SPINNER+1
if (( PROGRESS_SPINNER > ${#PROGRESS_SPINNER_CHARS}-1 )); then
PROGRESS_SPINNER=0;
fi
@@ -249,19 +257,19 @@ debug "libmisc" "progress_bar - $*"
else
len=${3:-${COLUMNS:-70}}
fi
-
+
# Can't make a bar because there's no total, or the length isn't
- # long enough, or if there is no length
+ # long enough, or if there is no length
if [ $# -lt 2 ] || [ $len -lt 8 ] ; then
message -n "."
return 0
fi
-
+
if [ $1 -lt 1 ] || [ $2 -lt 1 ] ; then return 1 ; fi
-
+
percent=$((100*$1/$2))
percent=`printf "%.0f" $percent`
-
+
if [[ $LAST_PERCENT == $percent ]] ; then
progress_spinner
return 0
@@ -323,7 +331,7 @@ function clear_line() {
#---------------------------------------------------------------------
##
## @Globals SOUND
-## Plays a given soundfile if sounds are on and the file exists in
+## Plays a given soundfile if sounds are on and the file exists in
## the chosen theme.
##
#---------------------------------------------------------------------
@@ -333,9 +341,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
@@ -435,24 +443,24 @@ function get_dirnames() {
## @param The string to itterate over. (optional)
## @Stdin is used when $3 isn't given.
##
-## $3 is optional, when it isn't used,
+## $3 is optional, when it isn't used,
## stdin is used and only the first letter in $2 is used. Note, using stdin
## can have odd side effects when your function uses read and stdin itself.
##
-## Special vars:
+## Special vars:
## BREAK: Use this to break out of the loop prematurely, also causes a
return of 1.
##
## If the function returns the value of the last return
## Notes:
-## In stdin mode, if the string does not terminate with the delimiter, the
last
+## In stdin mode, if the string does not terminate with the delimiter, the
last
## token will be ignored.
#----------------------------------------------------------------------
function iterate()
{ # $1=callback+args, $2=separator, $3=(opt)string
# debug "libmisc" "iterate - $@"
-
+
[ $# -lt 2 ] && return 2
-
+
local oldIFS="$IFS"
local token
local func="$1"
@@ -462,10 +470,10 @@ function iterate()
shift 2
for token in $* ; do
IFS="$oldIFS"
-
+
eval "$func \"$token\""
[[ $BREAK ]] && break
-
+
done
IFS="$oldIFS"
else
@@ -475,7 +483,7 @@ function iterate()
done
# debug "leftover token: $token"
fi
-
+
returnValue=$?
[[ $BREAK ]] && debug "libmisc" "iterate - I was BREAKed."
unset BREAK
@@ -483,10 +491,10 @@ function iterate()
}

#---------------------------------------------------------------------
-## @param return_var (must not be i, foo, temp, returnvar, stuff or default)
+## @param return_var (must not be i, foo, temp, number, returnvar, stuff,
msgstr or hashname)
## @param default choice
## @param elements, ..
-##
+##
## gives the user some nice select list and puts the selected
## item in return_var
##
@@ -496,23 +504,25 @@ function select_list()
local i
local foo temp number
local returnvar=$1
- local default=$2
+ local _default=$2
local stuff=()
+ local _default_num=0

shift 2
hash_unset select_list_hash
# see note in select_provider
stuff=(0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w
x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z)
-
+
let i=0
for foo in "$@"; do
message "\t$DEFAULT_COLOR(${stuff[$i]})
$SPELL_COLOR$foo$DEFAULT_COLOR"
hash_put select_list_hash "${stuff[$i]}" "$foo"
+ [[ "$foo" ]] && [[ "$foo" == "$_default" ]] &&
_default_num=${stuff[$i]}
let i++
done

- local msg="\n${QUERY_COLOR}Which one do you want?
[$default]$DEFAULT_COLOR "
- select_list_sub "$returnvar" select_list_hash "$msg" "$default"
+ local msgstr="\n${QUERY_COLOR}Which one do you want?
[$_default_num]$DEFAULT_COLOR "
+ select_list_sub "$returnvar" select_list_hash "$msgstr" "$_default_num"
hash_unset select_list_hash
}

@@ -529,23 +539,23 @@ function select_list_sub() {
local returnvar=$1
local hashname=$2
local msgstr=$3
- local default=$4
+ local _default=$4

- local result
+ local _result _answer

- while [[ ! $result ]] ; do
+ while [[ ! $_result ]] ; do
message -n "$msgstr"
- read -t $PROMPT_DELAY -n 1 answer
- [[ $answer ]] || answer=$default
- result="$(hash_get $hashname $answer)"
+ read -t $PROMPT_DELAY -n 1 _answer
+ [[ "$_answer" ]] || _answer=$_default
+ _result="$(hash_get $hashname $_answer)"
done
echo
- eval $returnvar=\"$result\"
+ eval $returnvar=\"$_result\"
}

#---------------------------------------------------------------------
## @param title
-##
+##
## sets the terminal title if TERM=xterm|rxvt or the window title if
## TERM=screen
##
@@ -554,11 +564,11 @@ function set_term_title()
{
if [ "$SET_TERM_TITLE" != "on" ]; then return; fi
case $TERM in
- xterm*|rxvt) echo -ne "\e]0;$@\007"
- ;;
- screen) echo -ne "\ek$@\e\\"
- ;;
- *) ;;
+ xterm*|rxvt*) echo -ne "\e]0;$@\007"
+ ;;
+ screen) echo -ne "\ek$@\e\\"
+ ;;
+ *) ;;
esac
}

@@ -574,9 +584,9 @@ function set_term_title()
function real_list_remove () {
local var=$1
shift
-
+
local i
-
+
for i in $@; do
eval "$var=\`echo \" \$$var \" | sed \
-e \"s/[[:space:]]\\+/ /g\" \
@@ -622,20 +632,29 @@ function real_list_add () {
## return 0 at least one element is in list
## return 1 none of supplied elements is not in list
##
-## Finds if at least one of given elements is in the string. Warning,
-## this function takes real string, not variable name as other list_*
-## functions
+## Finds if at least one of the given elements is in the string. They
+## can be delimited by spaces, tabs or newlines. The search elements
+## must not contain any of these or they won't match. The matching is
+## exact, regular expressions and globbing patterns are not supported.
+##
+## Warning, this function takes a real string, not a variable name as
+## other list_* functions.
##
#---------------------------------------------------------------------
function real_list_find () {
- local i
- local input="$1"
- shift
+ local item token
+ [[ "$1" ]] || return 1
+ local input=$1
+ shift

- for i in $@; do
- eval "echo \" $input \" | grep -q -e \"[[:space:]]$i[[:space:]]\" &&
return 0"
+ for item in $input
+ do
+ for token in "$@"
+ do
+ [[ "$item" == "$token" ]] && return 0
done
- return 1
+ done
+ return 1
}

#---------------------------------------------------------------------
@@ -705,11 +724,13 @@ function real_persistent_remove () {
function real_persistent_load () {
local PERSISTENT_LOADING=yes
local PERSISTENT_FILE=${1:-$SPELL_CONFIG.p}
+ lock_file "$PERSISTENT_FILE"
if [ -f "$PERSISTENT_FILE" ]; then
. "$PERSISTENT_FILE"
local line
persistent_add `while read line; do echo ${line%%=*}; done <
"$PERSISTENT_FILE"`
fi
+ unlock_file "$PERSISTENT_FILE"
}


@@ -722,12 +743,16 @@ function real_persistent_load () {
function real_persistent_save () {
local VAR
local TMP
- > "$SPELL_CONFIG.p"
+ local file=$SPELL_CONFIG.p
+ local tfile
+ lock_start_transaction "$file" tfile
+ > "$tfile"
for VAR in $PERSISTENT_VARIABLES; do
config_get_option $VAR TMP
- echo "$VAR=\"$TMP\"" >> "$SPELL_CONFIG.p"
+ echo "$VAR=\"$TMP\"" >> "$tfile"
unset "$VAR"
done
+ lock_commit_transaction "$file"
unset PERSISTENT_VARIABLES
}

@@ -869,7 +894,7 @@ function real_config_query () {
if config_get_option "$1" ANSWER; then
# option allready ANSWERed in config
echo -e "[[ ${QUERY_COLOR}$2${DEFAULT_COLOR} ->
${QUERY_COLOR}$ANSWER${DEFAULT_COLOR} ]]"
-
+
# already have a reasonable value...
[ "$ANSWER" == "y" ] || [ "$ANSWER" == "n" ] && return 0
fi
@@ -905,7 +930,7 @@ function real_config_query () {
#---------------------------------------------------------------------
function real_config_query_option () {
local ANSWER key
-
+
# If the option exists
# If the option contains option_yes or option_no
if config_get_option "$1" ANSWER && list_find "$ANSWER" $4 $5; then
@@ -926,7 +951,7 @@ function real_config_query_option () {
# Find out if the option was 'y' or 'n'
list_find "$last_answer" $4 && default=y
list_find "$last_answer" $5 && default=n
-
+
if query "$2" "$default"; then
list_add ANSWER $4
else
@@ -951,7 +976,7 @@ function real_config_query_option () {
#---------------------------------------------------------------------
function real_config_query_string () {
local ANSWER
-
+
if config_get_option "$1" ANSWER; then
# option allready answered in config
echo -e "[[ ${QUERY_COLOR}$2${DEFAULT_COLOR} ->
'${QUERY_COLOR}$ANSWER${DEFAULT_COLOR}' ]]"
@@ -999,19 +1024,10 @@ function real_config_query_list () {
# if there was an answer before, find it
local default default_num=0 foo
config_get_last_option "$VARIABLE" default
- [[ $default ]] || default="$1"
- let i=0
- for foo in "$@"; do
- if [[ "$foo" == "$default" ]] ; then
- default_num=$i
- break
- fi
- let i++
- done

- # we have to ask user
+ # we have to ask the user
message "$QUESTION"
- select_list ANSWER ${default_num} "$@"
+ select_list ANSWER "$default" "$@"
config_set_option "$VARIABLE" "$ANSWER"
fi

@@ -1079,7 +1095,7 @@ function remove_files_and_dirs() {
#---------------------------------------------------------------------
## Safely creates $TMP_DIR and exports the variable so we can use it
## even in subprocesses called through make.
-## @param name of the script needing the tmp dir
+## @param name of the script needing the tmp dir
#---------------------------------------------------------------------
function mk_tmp_dirs() {
debug "$FUNCNAME" "Making tmp dirs for $$"
@@ -1095,7 +1111,7 @@ function mk_tmp_dirs() {
tmp=$(ls -ld $BASE_DIR 2>/dev/null|awk '{printf "%s:%s:%s\n" ,$1,$3,$4; }')
if [[ "$tmp" != "drwxr-xr-x:root:root" ]] ; then
test -d $BASE_DIR &&
- message "$BASE_DIR has unknown permissions and ownership, replacing it"
2>/dev/null
+ message "$BASE_DIR has unknown permissions and ownership, replacing it"
>&2
rm -rf $BASE_DIR
install -d -o root -g root -m 755 "$BASE_DIR" &&
chmod a-s "$BASE_DIR" # work around installer bug where /tmp is suid/sgid
@@ -1122,7 +1138,7 @@ function mk_tmp_dirs() {


if [ -e $FULL_DIR ] ; then
- echo "Looks like you had an old $SCRIPT_NAME on PID $$. Cleaning it
out..." 2>/dev/null
+ message "Looks like you had an old $SCRIPT_NAME on PID $$. Cleaning it
out..." >&2
rm -rf $FULL_DIR
fi

@@ -1165,10 +1181,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"
@@ -1267,20 +1283,21 @@ function complain_sorcery_var() {
## @param (optional) Architecture to use
## Sets the SPECFILE glocal variable and the SMGL_COMPAT_ARCHS global array
## SPECFILE contains the compiler and other arch specifications
-## SMGL_COMPAT_ARCHS is an array that holds architectures which are
compatible
-## with the desired architecture. The desired architecture is determined as
+## SMGL_COMPAT_ARCHS is an array that holds architectures which are
compatible
+## with the desired architecture. The desired architecture is determined as
## follows:
+## <pre>
## 1) If function is gien an argument, the argument is used, or
## 2) If cross-install is on, the TARGET architecture is used, or
## 3) The local ARCHITECTURE is used
-##
-## The least specific arch is in SMGL_COMPAT_ARCHS[0],
+## </pre>
+## The least specific arch is in SMGL_COMPAT_ARCHS[0],
## SMGL_COMPAT_ARCHS[1] is more specific, et cetera. For example:
## desired architecture="athlon-xp" might result in:
## SPECFILE=/usr/share/archspecs/ia32/amd/athlon-xp
## SMGL_COMPAT_ARCHS=("ia32" "amd" "athlon-xp")
##
-## ARCHITECTURE is also modified to be an array, the reverse of
+## ARCHITECTURE is also modified to be an array, the reverse of
## SMGL_COMPAT_ARCHS. The result is an array from most specific arch to least
## specific. $ARCHITECTURE does not change meaning since $A == ${A[0]}.
#-------------------------------------------------------------------
@@ -1293,8 +1310,8 @@ function set_architecture() {

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

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

@@ -1348,9 +1365,9 @@ function set_architecture() {
## @param Function name
## @param (optional) Function name
## @param ...
-## Creates functions with identical bodies. It is useful if you need
+## Creates functions with identical bodies. It is useful if you need
## to override a bunch of functions which have already been defined.
-#---------------------------------------------------------------------
+#---------------------------------------------------------------------
function define_functions() {
local funcName
local funcContent="$1"
@@ -1364,15 +1381,121 @@ function define_functions() {
}

#---------------------------------------------------------------------
+## @param target
+## @param value
+## Set variable by name, useful for setting variables that were passed
+## by reference.
+## Example:
+## <pre>
+## function uber() {
+## local x
+## unter x 5
+## echo $x
+## }
+## function unter() {
+## local var=$1 y=$2
+## read -p "enter value (default $2)" y
+## upvar $var $y
+## }
+## </pre>
+#---------------------------------------------------------------------
+function upvar() {
+ # This makes eval see things as name=$2,
+ # which makes leading/trailing whitespace and special chars magically work.
+ eval "$1=\$2"
+
+}
+
+#---------------------------------------------------------------------
## Like uniq, but doesnt require a sorted list, implemented in awk.
#---------------------------------------------------------------------
function awkuniq() {
awk '{ if ( seen[$0] != 1) { seen[$0]=1;print $0;}}'
}

+#---------------------------------------------------------------------
+## Dirname written in bash, optionally uses an upvar (making it forkless).
+#---------------------------------------------------------------------
+function smgl_dirname() {
+ local __dir=$1
+ local __last_dir __next_dir
+
+ # Pull of any trailing /'s, there could be more than/one///
+ while [[ "$__dir" != "$__last_dir" ]] ; do
+ __last_dir=$__dir
+ __dir=${__dir%/}
+ done
+
+ # remove the basename
+ __next_dir=${__dir%/*}
+
+ # if the string had no more directory seperators in it (was aaa/, now aaa),
+ # then this is a special case, the answer is '.'
+ if [[ "$__next_dir" == "$__dir" ]] ; then
+ __dir="."
+ else
+ __dir=$__next_dir
+ # Trim off anymore leading /'s (was /aa//bb, now /aa//)
+ while [[ "$__dir" != "$__last_dir" ]] ; do
+ __last_dir=$__dir
+ __dir=${__dir%/}
+ [[ "$__dir" == "/" ]] && break
+ done
+ fi
+
+ if [[ "$2" ]] ; then
+ upvar "$2" "$__dir"
+ else
+ echo "$__dir"
+ fi
+}
+
+#---------------------------------------------------------------------
+## basename written in bash, optionally uses upvar (making it forkless).
+## Does not have ability to remove file extension like the real basename.
+#---------------------------------------------------------------------
+function smgl_basename() {
+ local __base=$1
+ local __last_base
+
+ # trim off leading /'s (foo/bar//// -> foo/bar)
+ while [[ "$__base" != "$__last_base" ]] ; do
+ __last_base=$__base
+ __base=${__base%/}
+ done
+
+ # if there are no more /'s then this does nothing which is what we want
+ __base=${__base##*/}
+
+ if [[ "$2" ]] ; then
+ upvar "$2" "$__base"
+ else
+ echo "$__base"
+ fi
+}
+
+#--------------------------------------------------------------------
+## @param new path to add
+## @param old path
+## @Stdout new path
+##
+## TODO: remove grimoire functions libgcc gcc_prepend_path and use
+## this one
+#--------------------------------------------------------------------
+function envar_prepend_path()
+{
+ if test -z $2
+ then
+ echo $1
+ else
+ echo $1:$2
+ fi
+}
+
+
# Standard debug line:
# file "function@line" "all" "args"
-STD_DEBUG='eval local _stddbg_file=${BASH_SOURCE[0]} ;
+STD_DEBUG='eval local _stddbg_file=${BASH_SOURCE[0]} ;
_stddbg_file=${_stddbg_file##*/};
debug "${_stddbg_file}" "${FUNCNAME[0]}@$LINENO" "$@"'

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

#------------------------------------------------------------------------
-# @param spell
-# @param version
-#
-# High level overview:
-#
-# ensure theres a cache tarball
-#
-# unpack the tarball somewhere
-#
-# if the spell is installed backup everything
-#
-# split the files into three categories: state data, config files, regular
files
-# this can be roughly viewed as (its slightly more complicated)
-# state data is data owned by sorcery (/var/state)
-# config files are defined in the /var/lib/sorcery/configs file
-# things not in the above categories are regular files
-#
-# copy regular files onto the system
-# copy config files carefully (dont trample on user changes)
-# if the file does not exist, just copy the new one
-# elif the file exists and is identical to the new one, do nothing
-# else the file exists and differs from the new one then
-# if it is owned by the old spell with a valid md5
-# replace the file
-# elif it is owned by the old spell with an invalid md5 (admin changed
it)
-# ask if the user wants to change it
-# else the file might be owned by another spell, or might be an alien
-# ask if the user wants to change it
-#
-# if the spell was installed
-# remove regular files unique to the old spell
-# remove unchanged config files
-# ask about changed config files
-#
-# update state data
-# call it a day
-#
-# FIXME: some of the informative message calls might work better as debug
messages
+## @param spell
+## @param version
+##
+## High level overview:
+##
+## ensure theres a cache tarball
+##
+## unpack the tarball somewhere
+##
+## if the spell is installed backup everything
+##
+## split the files into three categories: state data, config files, regular
files
+## this can be roughly viewed as (its slightly more complicated)
+## state data is data owned by sorcery (/var/state)
+## config files are defined in the /var/lib/sorcery/configs file
+## things not in the above categories are regular files
+##
+## copy regular files onto the system
+## copy config files carefully (dont trample on user changes)
+## if the file does not exist, just copy the new one
+## elif the file exists and is identical to the new one, do nothing
+## else the file exists and differs from the new one then
+## if it is owned by the old spell with a valid md5
+## replace the file
+## elif it is owned by the old spell with an invalid md5 (admin changed
it)
+## ask if the user wants to change it
+## else the file might be owned by another spell, or might be an alien
+## ask if the user wants to change it
+##
+## if the spell was installed
+## remove regular files unique to the old spell
+## remove unchanged config files
+## ask about changed config files
+##
+## update state data
+## call it a day
+##
+## FIXME: some of the informative message calls might work better as debug
messages
#------------------------------------------------------------------------
function resurrect() { (
debug "libresurrect" "resurrect - $*"
@@ -202,7 +202,7 @@ function resurrect() { (
tablet_get_grimoire_filter "$OLD_TABLET_DIR" configs
SECTION_CONFIG_FILTER
tablet_get_section_filter "$OLD_TABLET_DIR" configs
GRIMOIRE_CONFIG_FILTER
else
- unset $OLD_TABLET_DIR
+ unset OLD_TABLET_DIR
debug "libresurrect" "no tablet"
codex_set_current_spell_by_name $SPELL
SPELL_CONFIG_FILTER=$SCRIPT_DIRECTORY/configs
@@ -300,7 +300,9 @@ function resurrect() { (
#cleanse --fix $SILENT $SPELL

# n) run triggers
- #run_triggers
+ #TABLET_PATH=$STATE_DIRECTORY/tablet # reset to default, was relative
+ #SPELL_CONFIG="$DEPENDS_CONFIG/$SPELL"
+ #run_triggers # doesn't work since the spell isn't installed yet

return 0
) }
@@ -331,7 +333,7 @@ function resurrect_sub() {
# test -d so handle them specially
test -h ".$line" && echo .$line ||
test -d ".$line" || echo .$line
- done | sort | tar -cT - | tar -xvf - -C ${INSTALL_ROOT:-/} || {
+ done | sort | tar -cT - | tar -xvf - -C ${INSTALL_ROOT:-/} || {
debug "libresurrect" "Failed to install regular files"
resurrect_fail 1
return 1
@@ -347,7 +349,7 @@ function resurrect_sub() {
debug libresurrect "resurrect_install_conf_sub -- $@"
test -d ".$1" ||
internal_install_config_file ".$1" "${INSTALL_ROOT}${1}" $savetime \
- "$OLD_MD5_LOG" || {
+ "$OLD_MD5_LOG_R" ||
{
res_fail=1
BREAK=1
}
@@ -401,10 +403,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
-## $(date +'%Y%m%d%H%M')
+## @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() {
if [[ ! $1 ]] || [[ ! $2 ]] ; then
@@ -412,7 +413,7 @@ function real_install_config_file() {
"$DEFAULT_COLOR"
return 1
fi
-
+
local old_md5_log
if [[ $OLD_SPELL_VERSION ]] ; then
old_md5_log=$MD5SUM_LOGS/$SPELL-$OLD_SPELL_VERSION
@@ -430,11 +431,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,
-# must be in root form
+## @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() {
local from=$1
@@ -451,8 +451,8 @@ function internal_install_config_file() {
return $?
fi

- # if the file does not exist,
- if ! test -e "$to"; then
+ # if the file does not exist, or stage root is invoked
+ if ! test -e "$to" || [[ $STAGED_INSTALL == on ]] ; then
# copy the new one in (plus leading directories)
mkdir -p "$(dirname "$to")" &&
cp -pv "$from" "$to"
@@ -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
@@ -508,15 +508,15 @@ function real_handle_changed_config() {
local to=$2
local savetime=$3
local number
- local default=2 # TODO: this should come from a variable someday
+ local default=$DEFAULT_CHANGED_CONFIG_ACTION

local continue=yes
message "${MESSAGE_COLOR}Installing to $to, please choose an option:"
while [[ "$continue" == "yes" ]] ; do
- message "${QUERY_COLOR}"
+ message -n "${QUERY_COLOR}"
message "(0) trash $to and install over it"
- message "(1) backup $to to $to.$savetime, install the new file in its
place"
- message "(2) leave $to in its place, copy the new file to $to.$savetime"
+ message "(1) backup $to to $to.$savetime.old, install the new file in
its place"
+ message "(2) leave $to in its place, copy the new file to
$to.$savetime.new"
message "(3) do nothing"
message "(4) see a diff between $to and the new file"
# TODO: someday add an option to use an external merge tool
@@ -534,10 +534,10 @@ function real_handle_changed_config() {
case $number in
0) cp -pv "$from" "$to"
break ;;
- 1) cp -pv "$to" "$to.$savetime"
+ 1) cp -pv "$to" "$to.$savetime.old"
cp -pv "$from" "$to"
break ;;
- 2) cp -pv "$from" "$to.$savetime"
+ 2) cp -pv "$from" "$to.$savetime.new"
mark_file_modified "$to"
# this is deliberatly not track_manual, if this is run from
# FINAL the user might not have wanted the files tracked
@@ -572,15 +572,24 @@ function resurrect_success() {
# 15) commit state data:
if [[ $OLD_TABLET_DIR ]] ; then
# depends info if it exists
- local t_DEPENDS_STATUS=$(lock_start_transaction "$DEPENDS_STATUS")
# none of the old values are valid, only the new, uncommitted values are
- remove_depends_status $t_DEPENDS_STATUS $SPELL
+ remove_depends_status $DEPENDS_STATUS $SPELL
local spell_depends=$OLD_TABLET_DIR/depends
+ local t_DEPENDS_STATUS t_SUB_DEPENDS_STATUS
+ lock_start_transaction "$DEPENDS_STATUS" t_DEPENDS_STATUS
if [ -e $spell_depends ] ; then
cat $spell_depends >> $t_DEPENDS_STATUS
fi
lock_commit_transaction $DEPENDS_STATUS
-
+
+ remove_sub_depends $SUB_DEPENDS_STATUS ".*" $SPELL
+ local spell_sub_depends=$OLD_TABLET_DIR/sub_depends
+ if [[ -e $spell_sub_depends ]]; then
+ lock_start_transaction "$SUB_DEPENDS_STATUS" t_SUB_DEPENDS_STATUS
+ cat $spell_sub_depends >> $t_SUB_DEPENDS_STATUS
+ lock_commit_transaction $SUB_DEPENDS_STATUS
+ fi
+
# if theres a tablet dir, store it with a new timestamp
if new_tablet=$(tablet_get_path $SPELL) ; then
cp -Rp $OLD_TABLET_DIR/* $new_tablet
@@ -597,7 +606,7 @@ function resurrect_success() {
echo $COMPILE_LOG >> $TMP_INSTALL_LOG_STATE
echo $INSTALL_LOG >> $TMP_INSTALL_LOG_STATE
echo $MD5_LOG >> $TMP_INSTALL_LOG_STATE
-
+
# Use the cache's listing of files in filterable form
# dont use root form because it may be different
log_adjuster $NEW_DATA_F $TMP_INSTALL_LOG_DATA filterable root
@@ -621,14 +630,14 @@ function resurrect_success() {
activity_log "resurrect" "$SPELL" "$VERSION" "success"
message "${RESURRECT_COLOR}Resurrected spell: ${SPELL_COLOR}${SPELL}" \
"${DEFAULT_COLOR} version ${VERSION_COLOR}${VERSION}" \
- "${DEFAULT_COLOR}"
+ "${DEFAULT_COLOR}"
}


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

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

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

diff --git a/var/lib/sorcery/modules/libscreen
b/var/lib/sorcery/modules/libscreen
index 401a6cc..913a536 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}"
}

#-----
@@ -33,7 +33,7 @@ function screen_start() {

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

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

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

REALSOURCE=
- if test "$SOURCE" != ''
+ if test "$SOURCE" != ''
then
if [ -f $SOURCE_CACHE/$SOURCE ]
then
@@ -65,14 +65,14 @@ function gaze_checkmd5 () {
APPEND=
REALSOURCE="$OLDESTSOURCE"
fi
- else
+ else
APPEND=
SOURCE="$OLDESTSOURCE"
fi
fi
if test -z "$PRECACHEDF"
then
- if test `guess_compressor $SOURCE_CACHE/$SOURCE` != 'gzip' &&
+ if test `guess_compressor $SOURCE_CACHE/$SOURCE` != 'gzip' &&
test `guess_compressor $SOURCE_CACHE/$SOURCE` != 'bzip2' &&
test `guess_compressor $SOURCE_CACHE/$SOURCE` != 'compress'"'"'d' &&
test `guess_compressor $SOURCE_CACHE/$SOURCE` != 'Zip' &&
@@ -83,7 +83,7 @@ function gaze_checkmd5 () {
else
fMD5=$(
uncompress $SOURCE_CACHE/$SOURCE `
- guess_compressor $SOURCE_CACHE/$SOURCE` |
+ guess_compressor $SOURCE_CACHE/$SOURCE` |
md5sum | cut -d' ' -f1
)
fi
@@ -117,7 +117,7 @@ function gaze_checkmd5 () {
if test "$tMD5" == ""
then
echo -en "${YELLOW}${BOLD}UNCHECKED $SRCDATA INSERT
MD5[$MD5num]=$fMD5 or MD5[$MD5num]=IGNORE"
- else
+ else
if test "$tMD5" == "IGNORE"
then
echo -en "${YELLOW}IGNORED $SRCDATA"
@@ -126,7 +126,7 @@ function gaze_checkmd5 () {
then
bMD5="`md5sum $SOURCE_CACHE/$SOURCE | cut -d' ' -f1` | head -n
1"
else
- bMD5="`grep " $SOURCE\$" $PRECACHEDB | grep -Ev '\.[0-9]{14}$'
| grep -v '\.asc$'`"
+ bMD5="`grep " $SOURCE\$" $PRECACHEDB | grep -Ev '\.[0-9]{14}$'
| grep -v '\.asc$'`"
fi
if test "$tMD5" == "$bMD5"
then
@@ -155,7 +155,7 @@ function gaze_checkmd5 () {
fi
fi
fi
- fi
+ fi
echo -n " $APPEND"
if test "$tMD5" != "IGNORE" ; then
gaze_checkmd5syntax "$1" "$2"
@@ -174,7 +174,7 @@ function gaze_checkmd5 () {
##
## spelldirectory is the spell's directory
## sourcenumber is '' or '2', '3', '4', etc.
-## Checks the syntax related to md5 checking of a single source file
+## Checks the syntax related to md5 checking of a single source file
## sourcenumber in spelldirectory.
##
#---------------------------------------------------------------------
@@ -217,7 +217,7 @@ function gaze_checkmd5syntax () {
fi
fi
echo -en "${DEFAULT_COLOR}"
-
+
}

#---------------------------------------------------------------------
@@ -236,8 +236,8 @@ function gaze_checkmd5s() {
unset SOURCE
unset MD5 2> /dev/null
unset LICENSE 2> /dev/null
- SPELL_CONFIG=/etc/sorcery/local/depends/$spellname
- #echo $SPELL_CONFIG
+ SPELL_CONFIG=$DEPENDS_CONFIG/$spellname
+
source $spellpath > /dev/null 2> /dev/null

gaze_checkmd5 $spellroot ''
@@ -271,14 +271,14 @@ function gaze_checkmd5s() {
## @param [<item> ...]
##
## item is a spell or section name.
-## Checks the md5s of various spells, sections, or if called with no
+## Checks the md5s of various spells, sections, or if called with no
## arguments, the entire grimoire.
##
#---------------------------------------------------------------------
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 30e6538..73c886a 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
}

@@ -290,15 +293,63 @@ function save_libraries() {
else export LD_LIBRARY_PATH="$OLD_LIBS:$LD_LIBRARY_PATH"
fi

- # NOTE: remove this in 1.14
- if [ "$SPELL" == "glibc" ] ||
- [ "$SPELL" == "glibc-custom" ] ; then
- if [ -e $OLD_LIBS/ld-$OLD_VERSION.so ] ; then
- [[ `uname -m` == ppc* ]] && ln -sf $OLD_LIBS/ld-$OLD_VERSION.so
${INSTALL_ROOT}/lib/ld.so.1 ||
- ln -sf $OLD_LIBS/ld-$OLD_VERSION.so
${INSTALL_ROOT}/lib/ld-linux.so.2
- fi
+}
+
+#---------------------------------------------------------------------
+##
+## Saves the current libraries associated with the spell, from /lib
+## and /usr/lib into $SOURCE_DIRECTORY/old.libraries/
+## Also runs ldconfig with the saved libraries.
+##
+#---------------------------------------------------------------------
+function save_binaries() {
+ local dir
+ if [ -z "$SOURCE_DIRECTORY" ]
+ then return
fi

+ debug "libsorcery" "Running save_binaries()"
+
+ OLD_BINS=$SOURCE_DIRECTORY/old.binaries
+ mkdir -p $OLD_BINS
+
+ SAVED=$OLD_BINS/$SPELL.saved.binaries
+ lock_file $SAVED
+ rm -rf $SAVED
+
+ OLD_VERSION=`installed_version $SPELL`
+ OLD_LOG=$INSTALL_LOGS/$SPELL-$OLD_VERSION
+
+ grep "^/bin/\|^/sbin/\|^/usr/bin/\|^/usr/sbin/" $OLD_LOG |
+ while read LINE; do
+
+ if [ -f $LINE ] &&
+ file -bL $LINE |
+ grep -q "executable"
+ then
+ if [ -h $LINE ]; then
+ DEST=$( readlink "$LINE" )
+ mkdir -p $( dirname $OLD_BINS/$LINE )
+ ln -sf $DEST $OLD_BINS/$LINE
+ else
+ mkdir -p $( dirname $OLD_BINS/$LINE )
+ cp $LINE $OLD_BINS/$LINE
+ fi
+ echo $OLD_BINS/$LINE >> $SAVED
+ fi
+
+
+ done
+
+ unlock_file $SAVED
+
+ for dir in $( find $OLD_BINS )
+ do
+ if [[ -d $dir ]]
+ then
+ export PATH=$( envar_prepend_path "$dir" "$PATH" )
+ fi
+ done
}


@@ -337,10 +388,10 @@ function spell_recover() {
then
CONTINUE=true
fi
-
+
if $CONTINUE
then
-
+
if [ -n "$EXTENSION" ]; then
$COMPRESSBIN -cd $CACHE_COMP | tar -Pkx 2>/dev/null
else
@@ -402,7 +453,7 @@ function directories() {
function files() {

while read ITEM; do
-
+
if [ -f "$ITEM" ] &&
! [ -h "$ITEM" ]; then
echo "$ITEM"
@@ -441,19 +492,45 @@ function symlinks() {
##
#---------------------------------------------------------------------
function filter() {
- local thing RID_LIST
+ local thing RID_LIST NOT_RID_LIST
local files each invert
for each in $@; do
test -f $each && files="$files $each"
done
-
+
if [[ $files ]] ; then
RID_LIST=$(
- cat $files | while read thing; do
- echo -n "$thing\|"
- done
- echo -n /dev/null)
- grep -v "$RID_LIST"
+ cat $files |
+ grep -v '^!' | while read thing; do
+ echo -n "${thing}\|"
+ done)
+ NOT_RID_LIST=$(
+ cat $files |
+ grep '^!' | while read thing; do
+ echo -n "${thing/\!/}\|"
+ done)
+ RID_LIST=${RID_LIST%\\|}
+ NOT_RID_LIST=${NOT_RID_LIST%\\|}
+
+ local TMP_SSF=$(make_safe_dir)
+ local FILE=$TMP_SSF/ssf
+
+ if [[ $RID_LIST ]]
+ then
+ if [[ $NOT_RID_LIST ]]
+ then
+ cat > $FILE
+ {
+ grep -v "$NOT_RID_LIST\|$RID_LIST" $FILE
+ grep "$NOT_RID_LIST" $FILE
+ }
+ rm $FILE 2>/dev/null
+ else
+ grep -v "$RID_LIST"
+ fi
+ else
+ cat
+ fi
else
cat
fi
@@ -471,19 +548,39 @@ function filter() {
##
#---------------------------------------------------------------------
function filter_in() {
- local thing RID_LIST
+ local thing RID_LIST NOT_RID_LIST
local files each
for each in $@; do
test -f $each && files="$files $each"
done
-
+
if [[ $files ]] ; then
RID_LIST=$(
- cat $files | while read thing; do
- echo -n "$thing\|"
- done
- echo -n /dev/null)
- grep "$RID_LIST"
+ cat $files |
+ grep -v '^!' | while read thing; do
+ echo -n "${thing}\|"
+ done)
+ NOT_RID_LIST=$(
+ cat $files |
+ grep '^!' | while read thing; do
+ echo -n "${thing/\!/}\|"
+ done)
+ RID_LIST=${RID_LIST%\\|}
+ NOT_RID_LIST=${NOT_RID_LIST%\\|}
+
+ if [[ $RID_LIST ]]
+ then
+ if [[ $NOT_RID_LIST ]]
+ then
+ grep "$RID_LIST" |
+ grep -v "$NOT_RID_LIST"
+ else
+ grep "$RID_LIST"
+ fi
+ else
+ # grep '' outputs everything in this case we want nothing
+ cat > /dev/null
+ fi
else
cat
fi
@@ -493,11 +590,22 @@ function filter_generic() {
local args=$1
local filter_name=$2
local system_filter=$3
+ local spell_from=$4
local grimoire_filter section_filter spell_filter spell_dir
- tablet_find_spell_dir $SPELL spell_dir &>/dev/null &&
- tablet_get_spell_filter $spell_dir $filter_name spell_filter &>/dev/null
- tablet_get_section_filter $spell_dir $filter_name section_filter
&>/dev/null
- tablet_get_grimoire_filter $spell_dir $filter_name grimoire_filter
&>/dev/null
+ if [[ $spell_from == "codex" ]]
+ then
+ debug libsorcery "filter_generic codex at : $SCRIPT_DIRECTORY "
+ grimoire_filter=$GRIMOIRE/$filter_name
+ section_filter=$SECTION_DIRECTORY/$filter_name
+ spell_filter=$SCRIPT_DIRECTORY/$filter_name
+ else
+ if tablet_find_spell_dir $SPELL spell_dir &>/dev/null; then
+ debug libsorcery "filter_generic tablet at : $spell_dir "
+ tablet_get_spell_filter "$spell_dir" "$filter_name" spell_filter
&>/dev/null
+ tablet_get_section_filter "$spell_dir" "$filter_name" section_filter
&>/dev/null
+ tablet_get_grimoire_filter "$spell_dir" "$filter_name" grimoire_filter
&>/dev/null
+ fi
+ fi
set -- $args
if [ "$1" == -v ] ; then
shift
@@ -551,7 +659,7 @@ function pop_queue() { (
local ITEM=`esc_str $2`
local exit_code=0

- tQUEUE_FILE=$( lock_start_transaction $1 )
+ lock_start_transaction "$1" tQUEUE_FILE
if ! [ -f "$1" ]; then
exit_code=1
elif [ -n "$ITEM" ]; then
@@ -563,7 +671,7 @@ function pop_queue() { (
exit_code=1
else
FOUND=`esc_str $FOUND`
- grep -v "^$FOUND$" $1 > tQUEUE_FILE
+ grep -v "^$FOUND$" $1 > $tQUEUE_FILE
echo $FOUND
fi
fi
@@ -578,11 +686,11 @@ function pop_queue() { (
## @param filename
##
## The first argument is the name of the file that installed correctly
-## and will be removed from the install file (this makes a failure of
+## and will be removed from the install file (this makes a failure of
## the casting of the queue not have to recast completed spells).
##
#---------------------------------------------------------------------
-function pop_install_queue() {
+function pop_install_queue() {

pop_queue $INSTALL_QUEUE "$1"

@@ -600,7 +708,11 @@ function pop_install_queue() {
#---------------------------------------------------------------------
function push_queue() {

- pop_queue "$1" "$2"; echo "$2" >> $1;
+ pop_queue "$1" "$2"
+ local t_file
+ lock_start_transaction "$1" t_file
+ echo "$2" >> "$t_file";
+ lock_commit_transaction "$1"

}

@@ -651,7 +763,7 @@ function push_remove_queue() {
function optimize() {
debug "libsorcery" "In optimize()"

- unset CFLAGS CXXFLAGS LDFLAGS
+ unset CFLAGS CXXFLAGS LDFLAGS CPPFLAGS
unset COMBRELOC FAST PRELINK RISKY SMALL SPEEDY STRIP TINY

# if user specified --no-opts then use only the args from the command line
@@ -660,6 +772,7 @@ function optimize() {
export CFLAGS="$OVERRIDE_CFLAGS"
export CXXFLAGS="$OVERRIDE_CXXFLAGS"
export LDFLAGS="$OVERRIDE_LDLAGS"
+ export CPPFLAGS="$OVERRIDE_CPPFLAGS"
else
set_architecture
debug "ARCHITECTURE='${ARCHITECTURE}'"
@@ -708,6 +821,7 @@ function optimize() {
export CXXFLAGS=$(echo $CFLAGS $CUSTOM_CXXFLAGS $OVERRIDE_CXXFLAGS
$USER_SPELL_CXXFLAGS)
export CFLAGS=$(echo $CFLAGS $CUSTOM_CFLAGS $OVERRIDE_CFLAGS
$USER_SPELL_CFLAGS)
export LDFLAGS=$(echo $LDFLAGS $CUSTOM_LDFLAGS $OVERRIDE_LDLAGS
$USER_SPELL_LDFLAGS)
+ export CPPFLAGS=$(echo $CPPFLAGS $CUSTOM_CPPFLAGS $OVERRIDE_CPPFLAGS
$USER_SPELL_CPPFLAGS)
fi

}
@@ -742,6 +856,56 @@ function list_install_queue() {
fi
}

+#---------------------------------------------------------------------
+## Frontend routine to encapsulate whether or not a spell needs updating
+##
+#---------------------------------------------------------------------
+function does_spell_need_update() {
+ local line curr_updated curr_version status
+ local spell=$1
+ # this is in a subshell because the caller may not want to actually load
+ # the spell yet
+ (
+ line=$(search_spell_status $SPELL_STATUS $spell)
+ codex_set_current_spell_by_name $spell
+ explode "$line" ":" "info"
+ does_spell_need_update_sub "$spell" "${info[3]}" "${info[1]}" /dev/null
+ )
+}
+
+#---------------------------------------------------------------------
+##
+## common code between update_install_queue and does_spell_need_update
+## This helps keep update_install_queue optimized.
+#---------------------------------------------------------------------
+function does_spell_need_update_sub() {
+ local spell=$1
+ local curr_version=$2
+ local curr_updated=$3
+ local tmp_queue=$4
+ if [[ $VERSION != $curr_version ]] ; then
+ echo $spell >> $tmp_queue
+ return 0
+ else
+ curr_patchlevel=0
+ curr_sec_patch=0
+ if tablet_find_spell_dir $spell page_dir ; then
+ curr_updated=0
+ tablet_get_updated $page_dir curr_updated
+ tablet_get_patchlevel $page_dir curr_patchlevel
+ tablet_get_security_patch $page_dir curr_sec_patch
+ fi
+ if (( "${PATCHLEVEL:-0}" > "$curr_patchlevel" )) ||
+ # the following is subject to change
+ (( "${SECURITY_PATCH:-0}" > "$curr_sec_patch" )) ||
+ (( "${UPDATED:-0}" > "${curr_updated:-0}" )) ; then
+ echo $spell >> $tmp_queue
+ return 0
+ fi
+ fi
+ return 1
+}
+

#---------------------------------------------------------------------
##
@@ -751,45 +915,33 @@ function list_install_queue() {
#---------------------------------------------------------------------
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]}
curr_updated=${info[1]}
status=${info[2]}
curr_version=${info[3]}
-
+
( # do this in a subshell in case a spell mis-behaves and exits we
# still want queueing to work
if [[ "$status" == "installed" ]] &&
codex_set_current_spell_by_name $spell; then
- if [[ $VERSION != $curr_version ]] ; then
- echo $spell >> $tmp_queue
- else
- curr_patchlevel=0
- curr_sec_patch=0
- if tablet_find_spell_dir $spell page_dir ; then
- curr_updated=0
- tablet_get_updated $page_dir curr_updated
- tablet_get_patchlevel $page_dir curr_patchlevel
- tablet_get_security_patch $page_dir curr_sec_patch
- fi
- if (( "${PATCHLEVEL:-0}" > "$curr_patchlevel" )) ||
- # the following is subject to change
- (( "${SECURITY_PATCH:-0}" > "$curr_sec_patch" )) ||
- (( "${UPDATED:-0}" > "${curr_updated:-0}" )) ; then
- echo $spell >> $tmp_queue
- fi
- fi
+ does_spell_need_update_sub "$spell" "$curr_version" \
+ "$curr_updated" "$tmp_queue"
fi
)
+ let count++
done
-
+ clear_line
lock_file $INSTALL_QUEUE
rm -f $INSTALL_QUEUE
sort $tmp_queue | uniq > $INSTALL_QUEUE
@@ -809,7 +961,7 @@ function update_security_install_queue() {
explode "$line" ":" "info"
spell=${info[0]}
status=${info[2]}
-
+
( # do this in a subshell in case a spell mis-behaves and exits we
# still want queueing to work
if [[ "$status" == "installed" ]] &&
@@ -867,22 +1019,22 @@ function build_install_queue() {
##
#---------------------------------------------------------------------
function install_queue_history() {
- local PAGER2
- if [ "$PAGER" == "less" ] ; then PAGER2="more"; else PAGER2="$PAGER"; fi
- local spell=
+ local spell
for spell in `cat $INSTALL_QUEUE`; do
+ lock_file "$SPELL_STATUS"
local date="`grep "^${spell}:" $SPELL_STATUS | cut -d':' -f2`"
- local datedash="`echo "$date" | cut -c1-4`-`echo "$date" | cut
-c5-6`-`echo "$date" | cut -c7-8`"
- (
- echo -e "Viewing history since last update ($datedash) for spell --
${spell} -- :" &&
- echo &&
- gaze history $spell
- ) |
- awk -v date="$date" '{ d = (strtonum(substr($0,1,4) substr($0,6,2)
substr($0,9,2)) < date && strtonum(substr($0,1,4)) > 0) }; NR == 1, d { if
(!d) print }' |
- $PAGER2
- query "Would you like to ${RED} remove ${QUERY_COLOR} spell
${SPELL_COLOR} $spell ${QUERY_COLOR} from the install queue?" n &&
- sedit "s/^$spell$//" $INSTALL_QUEUE &&
+ unlock_file "$SPELL_STATUS"
+ local datedash="`echo "$date" | sed
's,^\(....\)\(..\)\(..\)$,\1-\2-\3,'`"
+
+ get_new_changes "Viewing history since last update ($datedash) for spell
-- ${spell} -- :" "$date" "$(codex_find_spell_by_name $spell)/HISTORY"
+
+ if query "Would you like to ${RED}remove ${QUERY_COLOR}spell
$SPELL_COLOR$spell$QUERY_COLOR from the install queue?" n; then
+ local t_queue
+ lock_start_transaction "$INSTALL_QUEUE" t_queue
+ sedit "s/^$spell$//" "$t_queue"
+ lock_commit_transaction "$INSTALL_QUEUE"
echo -e "${QUERY_COLOR} The spell ${SPELL_COLOR} $spell ${QUERY_COLOR}
removed from $INSTALL_QUEUE.${DEFAULT_COLOR}"
+ fi
done
}

@@ -893,30 +1045,18 @@ function install_queue_history() {
#---------------------------------------------------------------------
function grimoire_history() {

- if [ -e $grimoire/ChangeLog ] ; then
- local PAGER2
- if [ "$PAGER" == "less" ] ; then
- PAGER2="more"
- else
- PAGER2="$PAGER"
- fi
- local grimoire="$1"
+ local grimoire="$1"
+ if [ -e $grimoire/ChangeLog ] ; then
local grimoirename="${grimoire##*/}"
local date="`cat "$STATE_DIRECTORY/$grimoirename.lastupdate" 2>
/dev/null`"
[ -z "$date" ] && date="20030818"
- local datedash="`echo "$date" | cut -c1-4`-`echo "$date" | cut
-c5-6`-`echo "$date" | cut -c7-8`"
- (
- echo -e "Viewing history since last update ($datedash) for grimoire --
${grimoirename} -- :" &&
- echo &&
- cat "$grimoire/ChangeLog" 2> /dev/null
- ) |
- awk -v date="$date" '{ d = (strtonum(substr($0,1,4) substr($0,6,2)
substr($0,9,2)) < date && strtonum(substr($0,1,4)) > 0) }; NR == 1, d { if
(!d) print }' |
- $PAGER2
+ local datedash=$(echo "$date" | sed 's,^\(....\)\(..\)\(..\)$,\1-\2-\3,')
+ get_new_changes "Viewing history since last update ($datedash) for
grimoire -- ${grimoirename} -- :" "$date" "$grimoire/ChangeLog"
else
echo "No ChangeLog in the $grimoire Grimoire, skipping viewing..."
echo ""
fi
- echo "`date +%Y%m%d`" > "$STATE_DIRECTORY/$grimoirename.lastupdate"
+ date +%Y%m%d > "$STATE_DIRECTORY/$grimoirename.lastupdate"
}


@@ -926,23 +1066,84 @@ function grimoire_history() {
##
#---------------------------------------------------------------------
function sorcery_history() {
- local PAGER2
- if [ "$PAGER" == "less" ] ; then PAGER2="more"; else PAGER2="$PAGER"; fi
local date="`cat "$STATE_DIRECTORY/sorcery.lastupdate" 2> /dev/null`"
[ -z "$date" ] && date="20030818"
- local datedash="`echo "$date" | cut -c1-4`-`echo "$date" | cut
-c5-6`-`echo "$date" | cut -c7-8`"
- (
- echo -e "Viewing history since last update ($datedash) for sorcery :" &&
- echo &&
- cat "/usr/share/doc/sorcery/ChangeLog"
- ) |
- awk -v date="$date" '{ d = (strtonum(substr($0,1,4) substr($0,6,2)
substr($0,9,2)) < date && strtonum(substr($0,1,4)) > 0) }; NR == 1, d { if
(!d) print }' |
- $PAGER2
- echo "`date +%Y%m%d`" > "$STATE_DIRECTORY/sorcery.lastupdate"
+ local datedash="`echo "$date" | sed 's,^\(....\)\(..\)\(..\)$,\1-\2-\3,'`"
+
+ get_new_changes "Viewing history since last update ($datedash) for sorcery
:" "$date" /usr/share/doc/sorcery/ChangeLog
+
+ date +%Y%m%d > "$STATE_DIRECTORY/sorcery.lastupdate"
+}
+
+#---------------------------------------------------------------------
+##@param old date
+##@param changelog
+## Get the new changes from passed changelog argument
+##
+#---------------------------------------------------------------------
+function get_new_changes() {
+ local msg="$1"
+ local date="$2"
+ # This needs some explaination:
+ # The first item in {}'s extracts the date, assuming the format
yyyy-mm-dd
+ # then checks if its less than the last-update date ($date). The second
+ # part ensures that we're actually looking at a date and not a line
+ # of changelog. If both those are true, set 'd' to 1, otherwise d is '0'.
+ #
+ # In other words, d is 0 until it encounters a starting changelog entry
+ # from before the given $date. Then d is 1 for each starting entry. Its
+ # always 0 for bulleted changelog lines and blank lines.
+ #
+ # The second portion begins "NR==1,d". This is special awk syntax
+ # that says to run the stuff to the right in {}'s starting once the
+ # first statement is true, up through when the second one is true.
+ # For example, NR==1,NR==8 would run the right-hand block for lines 1
+ # through 8.
+ #
+ # NR is the line number, so its true on the first line. d is true once
the
+ # the dates are from before the last update. The if(!d) is necessary
+ # to skip the first line where the changelog date is less than $date.
+ #
+ local changelog="$( awk -v date="$date" '{ d = (strtonum(substr($0,1,4)
substr($0,6,2) substr($0,9,2)) < date && strtonum(substr($0,1,4)) > 0); }; NR
== 1, d { if (!d) print }' "$3" )"
+
+ if [[ "$changelog" ]] ; then
+ {
+ echo "$msg"
+ echo
+ echo "$changelog"
+ } > $TMP_DIR/pagerdata
+ timeout_pager "$TMP_DIR/pagerdata"
+ rm $TMP_DIR/pagerdata
+ else
+ echo "$msg"
+ echo
+ echo "Nothing new."
+ fi
}


#---------------------------------------------------------------------
+## Pager with timeouts, cannot be used from a pipe.
+## Invokes a subshell in case there are other background jobs running
+#---------------------------------------------------------------------
+function timeout_pager() { (
+ $PAGER "$@" &
+ sleep 1
+ for ((i=0;i<PAGER_TIMEOUT*10;i++)) ; do
+ jobs &>/dev/null # this makes bash clean up so the next line works
+ [[ "$(jobs)" ]] || return 0
+ sleep .1
+ done
+ jobs -p|xargs kill
+ jobs &>/dev/null # hide the [Done [2] blah blah] message
+ stty sane
+ if query "\nPager timeout, continue viewing $@" n; then
+ $PAGER "$@"
+ fi
+) 2>/dev/null # hides less complaining that it was killed
+}
+
+#---------------------------------------------------------------------
##
## Attempt to fix any spells that may be broken.
##
@@ -1052,16 +1253,17 @@ function run_details() {
#---------------------------------------------------------------------
##
## unsets variables set by DETAILS. <br>
-## vars: SPELL VERSION SOURCE_DIRECTORY WEB_SITE UPDATED ENTERED SHORT
SOURCE*
-##
+## vars: SPELL VERSION SOURCE_DIRECTORY WEB_SITE UPDATED ENTERED SHORT
SOURCE*
+##
## Needs to be merged with the libcodex function since they are both
## needed to fully unset a DETAILS (afk 4/21/04)
##
#---------------------------------------------------------------------
function unset_details() {

- local VARS="SPELL VERSION SOURCE_DIRECTORY WEB_SITE UPDATED ENTERED SHORT"
local TEMP=""
+ local VARS="SPELL VERSION SOURCE_DIRECTORY WEB_SITE UPDATED ENTERED SHORT"
+ VARS="$VARS SECURITY_PATCH PATCHLEVEL"

# Take care or SOURCEx and SOURCEx_URL
for i in ${!SOURCE*} ; do
@@ -1095,37 +1297,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.
##
@@ -1140,7 +1311,7 @@ function verify_source() { (
message "${PROBLEM_COLOR}Cast aborting.${DEFAULT_COLOR}"
activity_log "cast" "$SPELL" "$VERSION" "failed" \
"because it was missing source: $1"
- return 1
+ return 1
fi
done

@@ -1203,7 +1374,7 @@ function generate_keep_list() {
local type=$3
if [[ $type == installed_only ]] ; then
{
- get_all_spells_with_status installed
+ get_all_spells_with_status installed
get_all_spells_with_status held
} | sort | uniq | while read spell ; do
codex_find_spell_by_name $spell
@@ -1230,14 +1401,14 @@ function generate_keep_list() {
#---------------------------------------------------------------------
##
## Removes unnecessary files from the source cache and install cache.
-##
+##
#---------------------------------------------------------------------
function prune() {

debug "libsorcery" "Running prune()"
local NO_KEEP
local NUM_NO_KEEP=0
-
+
message "${MESSAGE_COLOR}Generating list of files to
keep...${DEFAULT_COLOR}"
local SOURCE_KEEP="$TMP_DIR/prune-keep-source"
local CACHE_KEEP="$TMP_DIR/prune-keep-cache"
@@ -1261,7 +1432,7 @@ function prune() {
}' $SOURCE_KEEP - |sort|uniq > $SOURCE_RM
if test -s $SOURCE_RM ; then
NUM_NO_KEEP=$(cat $SOURCE_RM|wc -l)
-
+
message "There are $NUM_NO_KEEP files that can be removed"
if query "Edit the list?" "n" ; then
edit_file $SOURCE_RM
@@ -1270,12 +1441,12 @@ function prune() {
cat $SOURCE_RM|xargs rm
fi
fi
-
+
message "${MESSAGE_COLOR}Cleaning up install cache" \

"(${DEFAULT_COLOR}$INSTALL_CACHE${MESSAGE_COLOR})...${DEFAULT_COLOR}"
local CACHE_RM="$TMP_DIR/prune.rm.cache"
find $INSTALL_CACHE -mindepth 1 -maxdepth 1 -type f|
- awk -F/ 'BEGIN {
+ awk -F/ 'BEGIN {
while ( getline < ARGV[1] ) {
keep[$NF] = 1;
}
@@ -1307,7 +1478,7 @@ function prune() {
## Adds /var/lib/sorcery/build to the C<PATH> if necessary.
##
#---------------------------------------------------------------------
-function invoke_build_dir() {
+function invoke_build_dir() {

# This merits some explaination:
#
@@ -1329,7 +1500,7 @@ function invoke_build_dir() {
# make matters worse inside make() we have to fiddle with the number of
# make jobs to use in case distcc is disabled (badly).
#
- # so the answer is:
+ # so the answer is:
# 1) make a new variable "USE_DISTCC" and set it to "off" if distcc
# is being disabled by the spell
# 2) check if USE_DISTCC == off in run_compiler, but still check the
@@ -1342,7 +1513,7 @@ function invoke_build_dir() {
# MAKE_NJOBS to that. This results in the number of jobs being $MAKE_NJOBS
# (default 1) when distcc is disabled (bug 6432), and allows an automatic
# increase in the number of jobs per host if its desired.
- #
+ #

USE_DISTCC=off
if [[ $DISABLE_DISTCC != yes ]] ; then
@@ -1356,9 +1527,9 @@ function invoke_build_dir() {
fi

if [[ "$CCACHE" == on ]] || [[ "$USE_DISTCC" == on ]] ; then
- export PATH="$RUN_COMPILER_DIR:$PATH"
+ export PATH="$RUN_COMPILER_DIR:$PATH"
fi
-}
+}


#---------------------------------------------------------------------
@@ -1422,7 +1593,7 @@ function verify_sources() {
##
## Will set the prefered compression type based on user filled option
## in dialog menu (either gzip/bzip).
-##
+##
#---------------------------------------------------------------------
function set_compression_type() {

@@ -1458,7 +1629,7 @@ function set_compression_type() {
modify_local_config "EXTENSION" "" ;;

esac
-
+
done

}
diff --git a/var/lib/sorcery/modules/libspell
b/var/lib/sorcery/modules/libspell
new file mode 100644
index 0000000..71e988f
--- /dev/null
+++ b/var/lib/sorcery/modules/libspell
@@ -0,0 +1,208 @@
+#!/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
+INSTALL_EXTRAS:install_extras
+POST_INSTALL:post_install
+TRANSFER:transfer
+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
new file mode 100755
index 0000000..cadfa98
--- /dev/null
+++ b/var/lib/sorcery/modules/libstage
@@ -0,0 +1,263 @@
+#!/bin/bash
+#---------------------------------------------------------------------
+## @Synopsis Functions for desling with the stage root and installing files
from the stage root
+## @Copyright Copyright (C) 2004 The Source Mage Team
<http://www.sourcemage.org>
+## Functions for desling with the stage root and installing files from the
stage root
+#---------------------------------------------------------------------
+
+#---------------------------------------------------------------------
+## @param stage root
+## Main for installing staged spell called imediatly after devoking
+## installwatch and stage root
+#---------------------------------------------------------------------
+function transfer_staged_spell()
+{
+ lock_file "$CONFIG_STAGE_DIRECTORY/$SPELL"
+ mkdir -p "$CONFIG_STAGE_DIRECTORY/$SPELL/current"
+ stage_install_configs
+ unlock_file "$CONFIG_STAGE_DIRECTORY/$SPELL"
+ stage_install_rest
+}
+
+function filter_spell_configs()
+{
+ filter_generic "$*" configs $CONFIGS codex
+}
+
+#---------------------------------------------------------------------
+## Install config files to a staged location on the system
+#---------------------------------------------------------------------
+function stage_install_configs()
+{
+ message "${MESSAGE_COLOR}Staging config files into the
system${DEFAULT_COLOR}"
+ get_all_package_files |
+ filter_spell_configs -v |
+ filter_excluded |
+ stage_install_files config
+}
+
+#---------------------------------------------------------------------
+## Install the rest of the files in the stage root
+#---------------------------------------------------------------------
+function stage_install_rest()
+{
+ message "${MESSAGE_COLOR}Installing the rest of the files${DEFAULT_COLOR}"
+ get_all_package_files |
+ filter_spell_configs |
+ stage_install_files
+}
+
+#---------------------------------------------------------------------
+## @Stdout list of files installed by package
+## lists all files the package installs relative to /
+#---------------------------------------------------------------------
+function get_all_package_files()
+{
+ find $STAGE_DIRECTORY/TRANSL | sed "s:$STAGE_DIRECTORY/TRANSL::"
+}
+
+#---------------------------------------------------------------------
+## @Stdin list of files to install
+## install the files from the stage directory to the system
+#---------------------------------------------------------------------
+function stage_install_files()
+{
+ local file
+ while read file ; do
+ [ "$file" ] || continue
+ stage_install_list "$file" "$1"
+ done
+}
+
+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 $OWNER:$GROUP $DIR${DEFAULT_COLOR}" &&
+ if [[ -d "${INSTALL_ROOT}/$DIR" ]]
+ then
+ chmod "$PERMISSION" "${INSTALL_ROOT}/$DIR" &&
+ chown $OWNER:$GROUP "${INSTALL_ROOT}/$DIR"
+ else
+ mkdir "${INSTALL_ROOT}/$DIR" &&
+ chmod "$PERMISSION" "${INSTALL_ROOT}/$DIR" &&
+ chown $OWNER:$GROUP "${INSTALL_ROOT}/$DIR"
+ fi
+}
+
+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 $OWNER:$GROUP $FILE${DEFAULT_COLOR}"
+ case $2 in
+ config)
+ if [[ -e "${INSTALL_ROOT}/$FILE" ]]
+ then
+ message "${MESSAGE_COLOR}Staging config to
$CONFIG_STAGE_DIRECTORY${DEFAULT_COLOR}"
+ mkdir -p "$(dirname $SAVE)" &&
+ cp -dp "$STAGE_DIRECTORY/TRANSL/$FILE" "${INSTALL_ROOT}/$SAVE"
+ else
+ cp -dp "$STAGE_DIRECTORY/TRANSL/$FILE" "${INSTALL_ROOT}/$FILE"
+ fi
+ ;;
+ *)
+ cp -fdp "$STAGE_DIRECTORY/TRANSL/$FILE" "${INSTALL_ROOT}/$FILE"
+ ;;
+ esac
+}
+
+function stage_install_symlink()
+{
+ local FILE=$1
+ local SAVE=$CONFIG_STAGE_DIRECTORY/$FILE.$(date +%Y%m%d%H%M%S)
+ local LINK=$(readlink "$STAGE_DIRECTORY/TRANSL/$FILE")
+ message "${FILE_COLOR}Symlink $FILE -> $LINK${DEFAULT_COLOR}"
+ case $2 in
+ config)
+ if [[ -e "${INSTALL_ROOT}/$FILE" ]]
+ then
+ touch "${INSTALL_ROOT}/$FILE" &&
+ mkdir -p $(dirname $SAVE) &&
+ ln -sfn "$LINK" "${INSTALL_ROOT}/$SAVE"
+ else
+ ln -sfn "$LINK" "${INSTALL_ROOT}/$FILE"
+ fi
+ ;;
+ *)
+ ln -sfn $(readlink "$STAGE_DIRECTORY/TRANSL/$FILE")
"${INSTALL_ROOT}/$FILE"
+ ;;
+ 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
+}
+
+#---------------------------------------------------------------------
+## @param file
+## install the file from the stage root to the system does check for
+## dir so that the file can be moved
+#---------------------------------------------------------------------
+function stage_install_list()
+{
+ 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 [[ -f $STAGE_DIRECTORY/TRANSL/$1 ]]
+ then
+ stage_install_file "$@"
+ elif [[ -d $STAGE_DIRECTORY/TRANSL/$1 ]]
+ then
+ stage_install_directory "$@"
+ else
+ message "${PROBLEM_COLOR}Oh, God I don't know what to do..."
+ message "${FILE_COLOR}$(dirname ${1})${PROBLEM_COLOR}"
+ message "is some other kind of a file and not a
directory${DEFAULT_COLOR}"
+ fi
+}
+
+#--------------------------------------------------------------------
+## Removes the passed file and possibly its parent directories up
+## to $CONFIG_STAGE_DIRECTORY if they are empty
+##
+## @param file
+## @param spell owner of the file, so we don't need to look that up
+#--------------------------------------------------------------------
+function recursive_config_stage_cleanup()
+{
+ local file=$1 dirname
+ local spell=$2
+
+ smgl_dirname "$file" dirname
+ # make it a relative path for rmdir -p
+ dirname="${dirname#$CONFIG_STAGE_DIRECTORY/}"
+
+ # lock_file works on dirs too
+ lock_file "$CONFIG_STAGE_DIRECTORY/$spell"
+ rm "$file"
+ {
+ pushd $CONFIG_STAGE_DIRECTORY
+ rmdir -p "$dirname"
+ popd
+ } &> /dev/null
+ unlock_file "$CONFIG_STAGE_DIRECTORY/$spell"
+}
diff --git a/var/lib/sorcery/modules/libstate
b/var/lib/sorcery/modules/libstate
index de96b5a..dafec00 100755
--- a/var/lib/sorcery/modules/libstate
+++ b/var/lib/sorcery/modules/libstate
@@ -9,7 +9,7 @@

#---------------------------------------------------------------------
##
-## Adds a dependency to the a depends database file. Returns 1 is the
+## Adds a dependency to the a depends database file. Returns 1 is the
## 3rd or 4th fields are not valid.
##
## @param Depends status file
@@ -25,56 +25,29 @@
#---------------------------------------------------------------------
function add_depends()
{ # $1=depends file $2=spell, $3=depends, $4=on/off, $5=optional/required,
$6=on arg, $7=off arg
- debug "libstate" "add_depends() - $*"
+ debug "libstate" "add_depends() - $*"

- #already here for some reason
- search_depends_status_exact "$@" >/dev/null && return 0
-
- #probably not needed with commit on succeed
- #remove stale depends info
- search_depends_status "$@" >/dev/null && remove_depends_status "$@"
+ #already here for some reason
+ search_depends_status_exact "$@" >/dev/null && return 0

- local depends_status=$1
- shift
-
- #ensure the info is valid (perhaps add check that spells exist?)
- if ( [[ $3 != on ]] && [[ $3 != off ]] ) ||
- ( [[ $4 != required ]] && [[ $4 != optional ]] )
- then
- return 1
- fi
-
- echo "$1:$2:$3:$4:$5:$6" >> $depends_status
-
- return 0
+ local depends_status=$1
+ shift

-}
+ # ensure the info is valid (perhaps add check that spells exist?)
+ list_find "on off" "$3" || return 1
+ list_find "required optional runtime suggest" "$4" || return 1
+
+ # Allow add_depends to override previous ones for the same pair of spells
+ search_depends_status "$depends_status" "$1" "$2" >/dev/null &&
+ remove_depends_status "$depends_status" "$1" "$2"
+
+ local t_status
+# lock_start_transaction "$depends_status" t_status
+ echo "$1:$2:$3:$4:$5:$6" >> "$depends_status"
+# lock_commit_transaction "$depends_status"
+
+ return 0

-#---------------------------------------------------------------------
-## Sets up the uncommitted depends file. If the name isn't
-## found in the hash table create it. If the file already exists
-## move it to the abandoned depends directory and start with a new one.
-## The uncommitted_hash hash table should be hash_export'ed to
-## make it through the call to make.
-##
-## @param spell
-## @param variable name to put the filename name in (pass by reference)
-##
-#---------------------------------------------------------------------
-function get_uncommitted_depends_file() {
- local SPELL=$1
- local temp_spell_depends=$(hash_get "uncommitted_hash" $SPELL)
- if ! [[ $temp_spell_depends ]] ; then
- temp_spell_depends="$UNCOMMITTED_DEPENDS/$SPELL"
- hash_put "uncommitted_hash" "$SPELL" "$temp_spell_depends"
- fi
- eval "$2=\"$temp_spell_depends\""
- if [ -e $temp_spell_depends ]; then
- mkdir -p "$ABANDONED_DEPENDS"
- mv "$temp_spell_depends" "$ABANDONED_DEPENDS"
- fi
- mkdir -p "$UNCOMMITTED_DEPENDS"
- touch "$temp_spell_depends"
}

#---------------------------------------------------------------------
@@ -93,42 +66,27 @@ function get_uncommitted_depends_file() {
## @param on arg
## @param off arg
##
+## @return 0 if entry was found
+## @return 1 if entry was not found
+## @return 2 on error
+##
#---------------------------------------------------------------------
function search_depends_status_exact()
{ # $1=depends file $2=spell, $3=depends, $4=on/off, $5=optional/required,
$6=on arg, $7=off arg

- local depends_status=$1
- shift
-
- local a1 a2 a3 a4 a5 a6
- a1=`esc_str "$1"` ; a2=`esc_str "$2"` ; a3=`esc_str "$3"` ;
a4=`esc_str "$4"`; a5=`esc_str "$5"`; a6=`esc_str "$6"`
- debug "libstate" "search_depends_status_exact:
[$a1:$a2:$a3:$a4:$a5:$a6]"
- grep "^$a1:$a2:$a3:$a4:$a5:$a6$" $depends_status
-
-}
-
-
-#---------------------------------------------------------------------
-## @param depends file
-## @param spell
-## @param depends (optional)
-## @Stdout mathing lines
-## In case you want to search by spell or dependency in $1
-##
-## Arguments can be regexp
-##
-## Prints out the matching line(s)
-##
-#---------------------------------------------------------------------
-function search_depends_status()
-{ # $1=depends file $2=spell, $3=(opt)depends
-
local depends_status=$1
shift

- [ $# -eq 1 ] && grep "^`esc_str "$1"`:" $depends_status
- [ $# -gt 1 ] && grep "^`esc_str "$1"`:`esc_str "$2"`:" $depends_status
+ local a1 a2 a3 a4 a5 a6
+ a1=`esc_str "$1"` ; a2=`esc_str "$2"` ; a3=`esc_str "$3"` ; a4=`esc_str
"$4"`; a5=`esc_str "$5"`; a6=`esc_str "$6"`
+ debug "libstate" "search_depends_status_exact: [$a1:$a2:$a3:$a4:$a5:$a6]"
+
+ lock_file "$depends_status"
+ grep "^$a1:$a2:$a3:$a4:$a5:$a6$" "$depends_status"
+ rc=$?
+ unlock_file "$depends_status"

+ return $rc
}

#---------------------------------------------------------------------
@@ -160,12 +118,44 @@ function search_depends_status_simple()
a5=`esc_str "$5"`; a6=`esc_str "$6"`
a5=${5:-.*} ; a6=${6:-.*}

- grep "^$a1:$a2\(([^:]*)\)\?:$a3:$a4:$a5:$a6$" $depends_status
+ lock_file "$depends_status"
+ grep "^$a1:$a2\(([^:]*)\)\?:$a3:$a4:$a5:$a6$" "$depends_status"
+ unlock_file "$depends_status"
+}
+
+
+#---------------------------------------------------------------------
+## @param depends file
+## @param spell
+## @param depends (optional)
+## @Stdout matching lines
+## In case you want to search by spell or dependency in $1
+##
+## Arguments can be regexp
+##
+## Prints out the matching line(s)
+##
+#---------------------------------------------------------------------
+function search_depends_status()
+{ # $1=depends file $2=spell, $3=(opt)depends
+
+ [[ -z $2 ]] && return 1
+ local depends_status=$1
+ shift

+# lock_file "$depends_status"
+ if [[ -z $2 ]]; then
+ grep "^`esc_str "$1"`:" "$depends_status"
+ else
+ grep "^`esc_str "$1"`:`esc_str "$2"`:" "$depends_status"
+ fi
+# unlock_file "$depends_status"
}

+
+
#---------------------------------------------------------------------
-##
+##
## @param depends file
## @param spell
## @param dependency spell
@@ -189,7 +179,9 @@ function get_depends_options()

local START="$(esc_str $1)"
debug "libstate" "get_depends_options() - START=$START"
+ lock_file "$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
+ unlock_file "$depends_status"
}


@@ -209,47 +201,182 @@ function get_depends_options()
function remove_depends_status()
{ # $1=depends file $2=spell, $3=(OPT)depends, $4=(OPT)on/off,
$5=(OPT)optional/required, $6=(OPT)on arg, $7=(OPT)off arg

- local depends_status=$1
- shift
+ local depends_status=$1
+ shift
+
+ local a1 a2 a3 a4 a5 a6
+ # arguments 1 and 2 are spell names, which might have characters that
+ # look like regexps, 5 and 6 might like funny too
+ # contrast 3 and 4 which are "on", "off", "required" or "optional"
+ # if they are regexps its probably desired so dont escape those
+ a1=`esc_str "$1"`; a2=`esc_str "$2"`
+ a1=${a1:-.*}; a2=${a2:-.*}
+
+ a3=${3:-.*} ; a4=${4:-.*}
+
+ a5=`esc_str "$5"`; a6=`esc_str "$6"`
+ a5=${a5:-.*}; a6=${a6:-.*}
+ [[ "$a5" == "[none]" ]] && a5="\\[none\\]"
+
+ local t_status
+ lock_start_transaction "$depends_status" t_status
+ sedit "/^$a1:$a2:$a3:$a4:$a5:$a6$/D" "$t_status"
+ lock_commit_transaction "$depends_status"
+}
+
+#---------------------------------------------------------------------
+## Sets up the uncommitted depends file. If the name isn't
+## found in the hash table create it. If the file already exists
+## move it to the abandoned depends directory and start with a new one.
+## The uncommitted_hash hash table should be hash_export'ed to
+## make it through the call to make.
+##
+## @param spell
+## @param variable name to put the filename name in (pass by reference)
+##
+#---------------------------------------------------------------------
+function get_uncommitted_depends_file() {
+ local SPELL=$1
+ local temp_spell_depends=$(hash_get "uncommitted_hash" $SPELL)
+ if ! [[ $temp_spell_depends ]] ; then
+ temp_spell_depends="$UNCOMMITTED_DEPENDS/$SPELL"
+ hash_put "uncommitted_hash" "$SPELL" "$temp_spell_depends"
+
+ mkdir -p "$ABANDONED_DEPENDS"
+ mv "$temp_spell_depends" "$ABANDONED_DEPENDS" &>/dev/null
+ mv "$temp_spell_depends:*" "$ABANDONED_DEPENDS" &>/dev/null
+
+ mkdir -p "$UNCOMMITTED_DEPENDS"
+ touch "$temp_spell_depends"
+ fi
+ eval "$2=\"$temp_spell_depends\""
+}
+
+#---------------------------------------------------------------------
+## Get the uncommitted sub-depends file. Uses get_uncommitted_depends_file.
+## This file is intended for use by the sub-dependee.
+##
+## @param spell
+## @param variable name to put the filename in
+#---------------------------------------------------------------------
+function get_uncommitted_sub_depends_file() {
+ local SPELL=$1
+ local upvar=$2
+ local __tmp
+ get_uncommitted_depends_file "$SPELL" __tmp
+ # : cannot be in spell names, so we can take advantage of the namespace
+ __tmp=${__tmp}:s
+ # we can assume that the parent directory exists because
+ # get_uncommitted_depends_file creates it
+ touch "$__tmp"
+ eval "$2=\"$__tmp\""
+}
+
+#---------------------------------------------------------------------
+## Get the uncommitted sub-depends file. Uses get_uncommitted_depends_file
+## This file is intended for use by the requester.
+##
+## @param spell
+## @param variable name to put the filename in
+#---------------------------------------------------------------------
+function get_uncommitted_rsub_depends_file() {
+ local SPELL=$1
+ local upvar=$2
+ local __tmp
+ get_uncommitted_depends_file "$SPELL" __tmp
+ # : cannot be in spell names, so we can take advantage of the namespace
+ __tmp=${__tmp}:rs
+ # we can assume that the parent directory exists because
+ # get_uncommitted_depends_file creates it
+ touch "$__tmp"
+ eval "$2=\"$__tmp\""
+}

- local a1 a2 a3 a4 a5 a6
- # why do we esc_str the args? spells shouldnt have regexps in their
name
- # and "on" "off" "optional" and "required" are the only valid
- # values for a3 and a4, also, with the exception of dispel depends
- # this isnt ever called with more than a1 as a parameter...
- #a1=`esc_str $1` ; a2=`esc_str $2` ; a3=`esc_str $3` ; a4=`esc_str
$4`;
- a1=$1 ; a2=$2 ; a3=$3 ; a4=$4;
- a5=`esc_str $5`; a6=`esc_str $6`
-
- a2=${a2:-.*}
- a3=${a3:-.*}
- a4=${a4:-.*}
- a5=${a5:-.*}
- a6=${a6:-.*}
+#---------------------------------------------------------------------
+## Add a sub-dependency.
+##
+## @param sub-depends file
+## @param requester file
+## @param sub-dependee
+## @param sub-depends
+#---------------------------------------------------------------------
+function add_sub_depends() {
+ $STD_DEBUG
+ remove_sub_depends "$@" || return 1
+ local file=$1
+ shift

- [[ "$a5" == "[none]" ]] && a5="\\[none\\]"
+ local t_file
+ lock_start_transaction "$file" t_file
+ echo "$1:$2:$3" >> "$t_file"
+ lock_commit_transaction "$file"
+}

- sedit "/^$a1:$a2:$a3:$a4:$a5:$a6$/D" $depends_status
+#---------------------------------------------------------------------
+## Search in sub-depends file.
+##
+## @param sub-depends file
+## @param requester file (optional)
+## @param sub-dependee (optional)
+## @param sub-depends (optional)
+#---------------------------------------------------------------------
+function search_sub_depends() {
+ $STD_DEBUG
+ local file=$1
+ shift
+ local a1 a2 a3
+ a1=`esc_str "$1"` ; a2=`esc_str "$2"` ; a3=`esc_str "$3"`
+ a1=${a1:-.*}
+ a2=${a2:-.*}
+ a3=${a3:-.*}
+
+ lock_file "$file"
+ grep "^$a1:$a2:$a3$" "$file"
+ unlock_file "$file"
+}

+#---------------------------------------------------------------------
+## Remove a sub-depends.
+##
+## @param sub-depends file
+## @param requester file
+## @param sub-dependee
+## @param sub-depends
+#---------------------------------------------------------------------
+function remove_sub_depends() {
+ $STD_DEBUG
+ local file=$1
+ shift
+
+ test -f $file || return
+
+ local a1 a2 a3
+ a1=`esc_str "$1"`; a2=`esc_str "$2"`; a3=`esc_str "$3"`
+ a1=${a1:-.*}; a2=${a2:-.*}; a3=${a3:-.*}
+
+ local t_file
+ lock_start_transaction "$file" t_file
+ sedit "/^$a1:$a2:$a3$/D" "$t_file"
+ lock_commit_transaction "$file"
}

#---------------------------------------------------------------------
-# Default depends and default provider api
-# default depends examples:
-#
-# default xfree86 provider to ImageMagick is xfree86
-# ImageMagick:X11-LIBS:xfree86
-#
-# default answer to optional_depends graphviz for ImageMagick is "no"
-# ImageMagick:graphviz:off
-#
-#
-# default provider examples:
-# use xorg as X11-LIBS even if its optional
-# xorg:X11-LIBS:on
-#
-# use xfree86 as X11-LIBS unless the [none] option exists (and use that
instead)
-# xfree86:X11-LIBS:off
+## Default depends and default provider api
+## default depends examples:
+##
+## default xfree86 provider to ImageMagick is xfree86
+## ImageMagick:X11-LIBS:xfree86
+##
+## default answer to optional_depends graphviz for ImageMagick is "no"
+## ImageMagick:graphviz:off
+##
+##
+## default provider examples:
+## use xorg as X11-LIBS even if its optional
+## xorg:X11-LIBS:on
+##
+## use xfree86 as X11-LIBS unless the [none] option exists (and use that
instead)
+## xfree86:X11-LIBS:off
#---------------------------------------------------------------------

#---------------------------------------------------------------------
@@ -287,11 +414,11 @@ function add_default_depends() {
return 1
fi

- tfile=`lock_start_transaction $file`
+ lock_start_transaction "$file" tfile
remove_default_depends $tfile $1 $2
echo "$1:$2:$3" >> $tfile
lock_commit_transaction $file
-
+
return 0

}
@@ -313,12 +440,15 @@ function remove_default_depends() {
shift
test -e $file || return

- local a1 a2 a3
- a1=`esc_str $1` ; a2=`esc_str $2` ; a3=`esc_str $3`
-
- a3=${a3:-.*}
+ local a1 a2 a3
+ a1=`esc_str $1` ; a2=`esc_str $2` ; a3=`esc_str $3`
+
+ a3=${a3:-.*}

- sedit "/^$a1:$a2:$a3$/D" $file
+ local t_file
+ lock_start_transaction "$file" t_file
+ sedit "/^$a1:$a2:$a3$/D" $t_file
+ lock_commit_transaction "$file"
}

#---------------------------------------------------------------------
@@ -337,12 +467,17 @@ function search_default_depends() {
shift
[[ -s $default_depends ]] || return

- local a1 a2 a3
- a1=`esc_str "$1"` ; a2=`esc_str "$2"` ; a3=`esc_str "$3"`
- a3=${a3:-.*}
+ local a1 a2 a3
+ a1=`esc_str "$1"` ; a2=`esc_str "$2"` ; a3=`esc_str "$3"`
+ a3=${a3:-.*}

debug "libstate" "search_default_depends: [$a1:$a2:$a3]"
- grep "^$a1:$a2:$a3$" $default_depends
+ lock_file "$default_depends"
+ grep "^$a1:$a2:$a3$" $default_depends
+ rc=$?
+ unlock_file "$default_depends"
+
+ return $rc
}


@@ -357,40 +492,41 @@ function search_default_depends() {
##
#---------------------------------------------------------------------
function add_default_provider() {
- debug "libstate" "add_default_depends() - $*"
+ debug "libstate" "add_default_depends() - $*"

- #already here
- search_default_provider "$@" >/dev/null && return 0
+ #already here
+ search_default_provider "$@" >/dev/null && return 0

- local file=$1
- shift
+ local file=$1
+ shift

- #ensure the info is valid...
- { [[ ! $1 ]] && [[ ! $2 ]] ; } && return 1
- { [[ $3 != on ]] && [[ $3 != off ]] ; } && return 1
- if [[ $1 ]] && ! codex_does_spell_exist $1 &>/dev/null ; then
- return 1
- fi
- if [[ $2 ]] && ! codex_does_service_exist $2 &>/dev/null ; then
- return 1
- fi
+ #ensure the info is valid...
+ { [[ ! $1 ]] && [[ ! $2 ]] ; } && return 1
+ { [[ $3 != on ]] && [[ $3 != off ]] ; } && return 1

- tfile=`lock_start_transaction $file`
- remove_default_provider $tfile "" $2
- echo "$1:$2:$3" >> $tfile
- lock_commit_transaction $file
-
- return 0
+ if [[ $1 ]] && ! codex_does_spell_exist $1 &>/dev/null ; then
+ return 1
+ fi
+ if [[ $2 ]] && ! codex_does_service_exist $2 &>/dev/null ; then
+ return 1
+ fi
+
+ lock_start_transaction "$file" tfile
+ remove_default_provider $tfile "" $2
+ echo "$1:$2:$3" >> $tfile
+ lock_commit_transaction $file
+
+ return 0
}

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

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

#---------------------------------------------------------------------
@@ -420,7 +556,7 @@ function add_spell_status()
fi
[[ $spell ]] && [[ $action ]] && [[ $version ]] || return 1
date=`date +%Y%m%d`
- tSPELL_STATUS=`lock_start_transaction $SPELL_STATUS`
+ lock_start_transaction "$SPELL_STATUS" tSPELL_STATUS
echo "$spell:$date:$action:$version" >> $tSPELL_STATUS
lock_commit_transaction $SPELL_STATUS

@@ -438,30 +574,65 @@ function add_spell() {
add_spell_status $1 $2 $3
}

+#---------------------------------------------------------------------
+## @param spell status file
+## @param spell
+## @param version (optional)
+## @Stdout mathing lines
+##
+## Arguments can be regexp
+##
+## Prints out the matching line(s)
+##
+#---------------------------------------------------------------------
+function search_spell_status() {
+ [[ -z $2 ]] && return 1
+ local spell_status=$1
+ shift
+
+ lock_file "$spell_status"
+ if [[ -z $2 ]]; then
+ grep "^`esc_str "$1"`:" $spell_status
+ else
+ grep "^`esc_str "$1:$2"`:" $spell_status
+ fi
+ unlock_file "$spell_status"
+}

#---------------------------------------------------------------------
##
## @param spell ( [A-Za-z0-9_-] )
-## @param version ( may not contain space,
-## '.' and '*' have special meaning)
+## @param version (optional and may not contain spaces or colons; '.' and
'*' have special meaning)
+## @param variable to set
## @Stdout last matching line ( only one even if there are more )
##
-## Searches the SPELL_STATUS file for a spell and optionaly
+## Searches the SPELL_STATUS file for a spell and optionally
## a version.
##
## Prints out the matching spell's status
-## Returns 1 only for critical problems ( missing SPELL_STAUS file )
-## 0 for all other cases ( even when spell is not found )
+## @return 1 only for critical problems ( missing SPELL_STATUS file )
+## @return 0 for all other cases ( even when spell is not found )
##
#---------------------------------------------------------------------
function query_spell_status()
{ #$1=spell, $2=(OPT)version

- local version
- version=`esc_str ${2:-".*"}`
+ local return_var __status
+ [[ -e $SPELL_STATUS ]] || return 1
+
+ lock_file "$SPELL_STATUS"
+ if [[ -z $3 ]]; then
+ [[ -z $2 ]] && return 0
+ return_var="$2"
+ __status=$(awk -F: -v spell="$1" '{ if (spell == $1) status=$3 }
END{print status}' "$SPELL_STATUS" 2>/dev/null)
+ else
+ return_var="$3"
+ __status=$(awk -F: -v spell="$1" -v version="$2" '{ if (spell == $1 &&
version == $4) status=$3 } END{print status}' "$SPELL_STATUS" 2>/dev/null)
+ fi
+ unlock_file "$SPELL_STATUS"

- tac $SPELL_STATUS | grep -m 1 "^$1:.*:.*:$version$" | \
- cut -d ":" -f 3
+ eval "$return_var=\"\$__status\""
+ return 0
}

#---------------------------------------------------------------------
@@ -471,7 +642,9 @@ function query_spell_status()
## @return 0 if the given spell's status is "installed"
#---------------------------------------------------------------------
function real_spell_installed() {
- [ "$( query_spell_status $1 )" == "installed" ];
+ local status
+ query_spell_status "$1" status
+ [[ $status == installed ]]
}


@@ -482,7 +655,9 @@ function real_spell_installed() {
##
#---------------------------------------------------------------------
function real_spell_held() {
- [ "$( query_spell_status $1 )" == "held" ];
+ local status
+ query_spell_status "$1" status
+ [[ $status == held ]]
}

#---------------------------------------------------------------------
@@ -492,8 +667,9 @@ function real_spell_held() {
## @return 0 if the given spell's status is "installed" or "held"
#---------------------------------------------------------------------
function real_spell_ok() {
- local res="$( query_spell_status $1 )"
- [ "$res" == "installed" ] || [ "$res" == "held" ]
+ local status
+ query_spell_status "$1" status
+ [[ $status == installed ]] || [[ $status == held ]]
}


@@ -518,6 +694,7 @@ function real_provider_ok() {
## @param If empty get the uncommited spell info, if anything else get info
from the committed ($DEPENDS_STATUS) database. If the uncommited db doesnt
exist (maybe we're not casting) use DEPENDS_STATUS
##
## @return 0 if a provider could be found 1 if not
+## @return 0 if a dependency from $1 on $2 is enabled, 1 otherwise.
## @stdout the provider name(s)
#---------------------------------------------------------------------
function real_get_spell_provider() {
@@ -532,6 +709,26 @@ function real_get_spell_provider() {
'on' '.*' '.*' '.*' |cut -f2 -d:|cut -f1 -d\(|sort|uniq
}

+#---------------------------------------------------------------------
+## @Type API
+## @param Spell name
+## @param Target spell name
+## @param If empty get the uncommited spell info, if anything else get info
from the committed ($DEPENDS_STATUS) database. If the uncommited db doesnt
exist (maybe we're not casting) use DEPENDS_STATUS
+##
+## @return 0 if a dependency from $1 on $2 is enabled, 1 otherwise.
+## @stdout the provider name(s)
+#---------------------------------------------------------------------
+function real_is_depends_enabled() {
+ local dep_status
+ if [[ $3 ]] ; then
+ dep_status=$DEPENDS_STATUS
+ else
+ dep_status=$(hash_get uncommitted_hash $1)
+ [[ $dep_status ]] || dep_status=$DEPENDS_STATUS
+ fi
+ [[ -n $(search_depends_status_simple $dep_status "$1" "$2" 'on' ) ]]
+}
+

#---------------------------------------------------------------------
## @param spell name
@@ -540,7 +737,9 @@ function real_get_spell_provider() {
##
#---------------------------------------------------------------------
function real_spell_exiled() {
- [ "$( query_spell_status $1 )" == "exiled" ];
+ local status
+ query_spell_status "$1" status
+ [[ $status == exiled ]]
}


@@ -552,10 +751,10 @@ function real_spell_exiled() {
function remove_spell_status()
{ #$1=spell to remove status of

- tSPELL_STATUS=`lock_start_transaction $SPELL_STATUS`
+ lock_start_transaction "$SPELL_STATUS" tSPELL_STATUS
grep -v "^$1:" $SPELL_STATUS > $tSPELL_STATUS
lock_commit_transaction $SPELL_STATUS
-
+
}

#---------------------------------------------------------------------
@@ -582,9 +781,9 @@ function remove_spell() {
#---------------------------------------------------------------------
function all_spell_status()
{
-
+ lock_file "$SPELL_STATUS"
cat $SPELL_STATUS
-
+ unlock_file "$SPELL_STATUS"
}


@@ -594,8 +793,8 @@ function all_spell_status()
##
#---------------------------------------------------------------------
function set_held () {
- local t_status=$(lock_start_transaction $SPELL_STATUS)
- cp $SPELL_STATUS $t_status
+ local t_status
+ lock_start_transaction "$SPELL_STATUS" t_status
for to_hold in $@; do
sedit 's/\(^'$(esc_str $to_hold)':[^:]*:\)installed/\1held/'
$t_status
done
@@ -614,7 +813,7 @@ function set_exiled () {
local MY_STATUS

for TO_EXILE in $@; do
- MY_STATUS=$(query_spell_status "$TO_EXILE")
+ query_spell_status "$TO_EXILE" MY_STATUS
case "$MY_STATUS" in
"" )
add_spell_status $TO_EXILE exiled 0.0
@@ -652,7 +851,7 @@ function set_unexiled () {
local MY_STATUS
local TO_UNEXILE
for TO_UNEXILE in $@; do
- MY_STATUS=$(query_spell_status "$TO_UNEXILE")
+ query_spell_status "$TO_UNEXILE" MY_STATUS
if [ x"$MY_STATUS" == x"exiled" ]; then
remove_spell $TO_UNEXILE
else
@@ -669,8 +868,8 @@ function set_unexiled () {
##
#---------------------------------------------------------------------
function set_unheld () {
- local t_status=$(lock_start_transaction $SPELL_STATUS)
- cp $SPELL_STATUS $t_status
+ local t_status
+ lock_start_transaction "$SPELL_STATUS" t_status
for to_hold in $@; do
sedit 's/\(^'$(esc_str $to_hold)':[^:]*:\)held/\1installed/'
$t_status
done
@@ -691,25 +890,6 @@ function get_all_spells_with_status () {
unlock_file $SPELL_STATUS
}

-#---------------------------------------------------------------------
-## @Type API
-## @param Spell name
-## @param Target spell name
-## @param If empty get the uncommited spell info, if anything else get info
from the committed ($DEPENDS_STATUS) database. If the uncommited db doesnt
exist (maybe we're not casting) use DEPENDS_STATUS
-##
-## @return 0 if a dependency from $1 on $2 is enabled, 1 otherwise.
-## @stdout the provider name(s)
-#---------------------------------------------------------------------
-function real_is_depends_enabled() {
- local dep_status
- if [[ $3 ]] ; then
- dep_status=$DEPENDS_STATUS
- else
- dep_status=$(hash_get uncommitted_hash $1)
- [[ $dep_status ]] || dep_status=$DEPENDS_STATUS
- fi
- [[ -n $(search_depends_status_simple $dep_status "$1" "$2" 'on' ) ]]
-}

#---------------------------------------------------------------------
## @param variable
@@ -717,7 +897,7 @@ function real_is_depends_enabled() {
## @param command (optional)
##
## Modifies (or adds) an entry in the local/config.
-## If "command" is the third argument, a space will separate the
+## If "command" is the third argument, a space will separate the
## variable and value rather than the equals sign.
##
#---------------------------------------------------------------------
@@ -734,7 +914,7 @@ function modify_local_config() {
## @param command (optional)
##
## Modifies (or adds) an entry in the local/config.
-## If "command" is the third argument, a space will separate the
+## If "command" is the third argument, a space will separate the
## variable and value rather than the equals sign.
##
#---------------------------------------------------------------------
@@ -743,17 +923,17 @@ function modify_config() {
debug "libstate" "modify_config() - $*"
local FILE=$1
shift;
-
+
if ! [[ $1 ]]; then
debug "libstate" "modify_config() - Warning: No name given for config
option."
return 1
fi
-
+
local TEMP separator EQUALS_COL VARIABLE
-
+
# what to use as separator?
- if [[ $3 == command ]]
- then separator=" "
+ if [[ $3 == command ]]
+ then separator=" "
else separator="=" ; fi

if ! test -f $FILE; then
@@ -771,7 +951,7 @@ function modify_config() {
fi

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

# justifying...
@@ -781,13 +961,13 @@ function modify_config() {
for (( ; EQUALS_COL>0 ; EQUALS_COL-- )) ; do
TEMP="$TEMP "
done
-
+
debug "libstate" "modify_config() - entering new value $VARIABLE
$seperator $@ into $tFILE"
# put new value and justification in
echo "${TEMP}${1}${separator}\"$2\"" >> $tFILE

lock_commit_transaction $FILE
-
+
}

#---------------------------------------------------------------------
@@ -796,7 +976,7 @@ function modify_config() {
## @param command (optional)
##
## Modifies (or adds) an entry in the local/config.
-## If "command" is the third argument, a space will separate the
+## If "command" is the third argument, a space will separate the
## variable and value rather than the equals sign.
##
#---------------------------------------------------------------------
@@ -805,24 +985,24 @@ function remove_config() {
debug "libstate" "remove_config() - $*"
local FILE=$1
shift;
-
+
if ! [[ $1 ]]; then
debug "libstate" "remove_config() - Warning: No name given for config
option."
return 1
fi
-
+
local TEMP separator EQUALS_COL VARIABLE
-
+
# what to use as separator?
- if [[ $2 == command ]]
- then separator=" "
+ if [[ $2 == command ]]
+ then separator=" "
else separator="=" ; fi
-
+
# remove previous reference
- tFILE=`lock_start_transaction $FILE`
+ lock_start_transaction "$FILE" tFILE
grep -v "^[[:blank:]]*${1}${separator}" $FILE > $tFILE
lock_commit_transaction $FILE
-
+
}

#---------------------------------------------------------------------
@@ -831,16 +1011,16 @@ function remove_config() {
## returns true if the grimoire is set local, false otherwise.
#---------------------------------------------------------------------
function codex_is_local () {(
- local g_name=$1
+ local g_name=$1

- local grimoire=$(codex_find_grimoire $g_name)
- if ! [[ $grimoire ]]; then
- return 1
- fi
+ local grimoire=$(codex_find_grimoire $g_name)
+ if ! [[ $grimoire ]]; then
+ return 1
+ fi

- . "$grimoire/GRIMOIRE"
+ . "$grimoire/GRIMOIRE"

- [[ $CODEX_IS_LOCAL == "yes" ]]
+ [[ $CODEX_IS_LOCAL == "yes" ]]
)}


diff --git a/var/lib/sorcery/modules/libsummon
b/var/lib/sorcery/modules/libsummon
index 83fb9e7..eaf0e2a 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
@@ -85,11 +78,11 @@ function get_spell_files_and_urls() {

#-------------------------------------------------------------------------
## @param none
-##
+##
## 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
@@ -105,9 +98,6 @@ function real_default_download() {
## Acquire the source. Check locally unless options insist on not
## doing so.
##
-## Inspects $FORCE_DOWNLOAD and ${FORCE_DOWNLOAD[$srcnum]}
-## if either are set then downloading is forced, a local copy of the
-## file is ignored.
#-------------------------------------------------------------------------
function real_acquire_src() {
$STD_DEBUG
@@ -115,26 +105,49 @@ function real_acquire_src() {
local SVAR="SOURCE${DLNUM}"
local target=${!SVAR}

-
- REASON="for spell ${SPELL_COLOR}${SPELL}${DEFAULT_COLOR}"
-
# maybe we already have the file
# but we can only use it if not FORCE_DOWNLOADing
+ is_downloaded "$target" "$DLNUM" \
+ "for spell ${SPELL_COLOR}${SPELL}${DEFAULT_COLOR} " && return 0
+
+ # else the source must be downloaded/updated
+ download_src "$DLNUM"
+}
+
+#-------------------------------------------------------------------------
+## @param download target
+## @param source number
+## @return 0 if the target already exsists and FORCE_DOWNLOADing is disabled
+## @return 1 otherwise
+##
+## Checks if the download target is already downloaded,
+## Inspects $FORCE_DOWNLOAD and ${FORCE_DOWNLOAD[$srcnum]}
+## if either are set then downloading is forced, a local copy of the
+## file is ignored.
+##
+#-------------------------------------------------------------------------
+function is_downloaded() {
+ local target="$1"
+ local dlnum="${2:-1}"
+ local reason="$3"
+
if file_exists "$SOURCE_CACHE/$target " &&
! [[ ${FORCE_DOWNLOAD} ]] &&
- ! [[ ${FORCE_DOWNLOAD[${DLNUM:-1}]} ]] ; then
+ ! [[ ${FORCE_DOWNLOAD[$dlnum]} ]] ; then
+ # file_exists does a fuzzy match with gz, tgz and bz2
+ # lookup what file it actually found and use that for the message
+ local real_target=$(guess_filename $SOURCE_CACHE/$target)
message "${MESSAGE_COLOR}Found source file" \
- "${FILE_COLOR}${target}${DEFAULT_COLOR}" \
- "$REASON in ${FILE_COLOR}${SOURCE_CACHE}${DEFAULT_COLOR}"
+ "${FILE_COLOR}${real_target}${DEFAULT_COLOR}" \
+ "${reason}in ${FILE_COLOR}${SOURCE_CACHE}${DEFAULT_COLOR}"
return 0
fi
- # else the source must be downloaded/updated
- download_src "$DLNUM"
+ return 1
}

#-------------------------------------------------------------------------
## @param source number or '' for the first $SOURCE
-##
+##
## Expands $SOURCEx, $SOURCEx_URL[*] and $SOURCEx_HINTS
## then calls download_src_args with them.
##
@@ -231,14 +244,21 @@ function download_src_args() {
if [[ $summon_target != $new_target ]] ; then
mv -f $summon_target $new_target
fi &&
- message "Repackaging $target"
+ message "${MESSAGE_COLOR}Repackaging
${SPELL_COLOR}$target${DEFAULT_COLOR}"
tar --remove-files -cjf $target $new_target &&
rm -rf $new_target
elif [[ "$summon_type" == file ]] ; then
# there is no penalty for guessing tree when the result is a file
-
if [[ $summon_target != $target ]] ; then
- mv -f $summon_target $target
+ mv -f "$summon_target" "$target"
+ fi
+ local type
+ if ! source_sanity "$target" "type"; then
+ message "${PROBLEM_COLOR}Sanity check of${DEFAULT_COLOR}" \
+ "${FILE_COLOR}${target}${DEFAULT_COLOR}" \
+ "${PROBLEM_COLOR}failed:${DEFAULT_COLOR}"
+ message "$type"
+ return 1
fi
else
message "${PROBLEM_COLOR}Unknown download type: \"$summon_type\""\
@@ -272,7 +292,7 @@ function download_src_sub() {
local _summon_target=$5
local _summon_type=$6

- {
+ {
[[ $guess_type == file ]] &&
download_from_leapforward "$target" "$url_list" "$hints" \
"$_summon_target" "$_summon_type"
@@ -311,7 +331,7 @@ function download_from_leapforward() {
local hints="$3"
local _summon_target=$4
local _summon_type=$5
-
+
message "${MESSAGE_COLOR}Attempting to get file from" \
"leap-forward mirror ${DEFAULT_COLOR}${LEAPFORWARD_URL}"
# leap forwards dont need to be expanded or sorted
@@ -350,7 +370,7 @@ function download_from_fallback() {
idx=$[($i + $offset) % $FURLNUM]
FALL_BACKS="$FALL_BACKS ${FALLBACK_URL_MIRROR[$idx]}/$target"
done
- [ -n "$FALL_BACKS" ] &&
+ [ -n "$FALL_BACKS" ] &&
# dont order fall backs, above we use a random ordering
url_download "$target" "$FALL_BACKS" "$hints" "$_summon_target" \
"$_summon_type"
@@ -404,6 +424,35 @@ function unpack_for_update() {
fi
return 0
}
+
+#---------------------------------------------------------------------
+## Perform rudimentary source sanity checks on summoned files.
+## Currently only checks that files are not zero sized or html 404 notices.
+## Some sites, notably sourceforge, break http by having missing files
+## do a 30X redirect to a 404 html file which when downloaded has a
+## 200 (OK) status. Other sites do 30X redirect to the new location of
+## the requested file, which then successfully downloads (which is
+## the correct thing to do). We catch that here rather than wait for
+## file verification to catch it.
+#---------------------------------------------------------------------
+function source_sanity() {
+ [[ "$1" ]] || return 0
+ [[ "$SUMMON_SANITY" == off ]] && return 0
+ if ! test -s "$1"; then
+ upvar "$2" "Empty"
+ return 1
+ fi
+ if [[ "$1" != "${1%.tar.bz2}" ]] ||
+ [[ "$1" != "${1%.tar.gz}" ]] ||
+ [[ "$1" != "${1%.tgz}" ]]; then
+ local _type=$(file -bi "$1")
+ if echo $_type | grep -iq "text/"; then
+ upvar "$2" "$_type"
+ return 1
+ fi
+ fi
+
+}
#---------------------------------------------------------------------
## This software is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
diff --git a/var/lib/sorcery/modules/libtablet
b/var/lib/sorcery/modules/libtablet
index bc5472f..794523e 100755
--- a/var/lib/sorcery/modules/libtablet
+++ b/var/lib/sorcery/modules/libtablet
@@ -39,7 +39,7 @@
## known defects pre tablet version 1 (and the functions that fix them) :
## no version file : tablet_0_repair_version
## no updated file : tablet_0_repair_updated
-## spell/<spellname>/<spell files>, should be spell/<spell files>
+## spell/<spellname>/<spell files>, should be spell/<spell files>
## tablet_0_repair_spell DONE
## no tb_version : tablet_0_repair (bumps to version 1)
##
@@ -50,7 +50,7 @@
## $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
@@ -62,6 +62,8 @@
## tablet_get_patchlevel
## tablet_get_security_patch
## tablet_get_depends
+## tablet_get_sub_depends
+## tablet_get_rsub_depends
## tablet_get_status
## tablet_get_sources
## tablet_get_spell_filter
@@ -158,6 +160,29 @@ function tablet_get_depends() {
return 0
}

+function tablet_get_sub_depends() {
+ local tb_dir=$1 tb_version value
+ tablet_get_tb_version $tb_dir tb_version
+ [[ $? != 0 ]] && return 1
+ case $tb_version in
+ 1) test -f $tb_dir/sub_depends && value=$tb_dir/sub_depends|| return 2 ;;
+ *) return 3 ;;
+ esac
+ eval "$2=\"$value\""
+ return 0
+}
+
+function tablet_get_rsub_depends() {
+ local tb_dir=$1 tb_version value
+ tablet_get_tb_version $tb_dir tb_version
+ [[ $? != 0 ]] && return 1
+ case $tb_version in
+ 1) test -f $tb_dir/rsub_depends && value=$tb_dir/rsub_depends|| return 2
;;
+ *) return 3 ;;
+ esac
+ eval "$2=\"$value\""
+ return 0
+}
function tablet_get_status() {
local tb_dir=$1 tb_version value
tablet_get_tb_version $tb_dir tb_version
@@ -275,7 +300,7 @@ function tablet_get_tb_version() {
return 1
fi
if ! test -f $tb_dir/tb_version ||
- [[ "$(cat $tb_dir/tb_version)" == 0 ]] ; then
+ [[ "$(< $tb_dir/tb_version)" == 0 ]] ; then
tablet_0_repair $tb_dir || return 1
fi
local ____tb_version=$(<$tb_dir/tb_version)
@@ -299,7 +324,10 @@ function tablet_get_tb_version() {
## basename of that is <spell>
#---------------------------------------------------------------------
function tablet_get_spell_name_from_path() {
- [[ $1 ]] && basename $(dirname $1)
+ [[ $1 ]] || return
+ local tmp
+ smgl_dirname "$1" tmp
+ smgl_basename "$tmp" $2 # quotes deliberatly left off, (hack for speed)
}

######################################################################
@@ -315,7 +343,7 @@ function tablet_get_path() {
local tb_dir=$TABLET_PATH/$SPELL/$(date +%Y%m%d%H%M%S)
local sleep_time
local made
-
+
mkdir -p $TABLET_PATH/$SPELL &&
for (( i=0 ; $i < 20 ; i++ )) ; do
if mkdir $tb_dir > /dev/null; then
@@ -334,11 +362,25 @@ function tablet_get_path() {
}

#----------------------------------------------------------------------
-# @param spell name
-# @param upvar
-# @param timestamp (optional)
+## @param spell name
+## @param upvar
+## @param timestamp (optional)
+##
+## @global TABLET_IGNORE if set means that there isnt a tablet for this
+## @global and somewhere up the stack knows this<br />
+## @global TABLET_SPELL_DIR if set, is the value of the tablet for this
+## @global spell, because somewhere up the stack it was just created (so
dont bother
+## @global looking for it)
+##
+## the idea for the two globals is to simplify the layers in-between
+## and skip searching when it isn't necessary
#----------------------------------------------------------------------
function tablet_find_spell_dir() {
+ [[ $TABLET_IGNORE ]] && return 1
+ if [[ $TABLET_SPELL_DIR ]] ; then
+ eval "$2=\"$TABLET_SPELL_DIR\""
+ return 0
+ fi
local SPELL=$1
if ! test -d $TABLET_PATH; then
mkdir -p $TABLET_PATH
@@ -441,8 +483,17 @@ function tablet_install_spell_files() {
test -e $SPELL_CONFIG.p && cp ${SPELL_CONFIG}.p spell_config.p

# depends info
+ get_uncommitted_depends_file $SPELL spell_depends &&
test -e $spell_depends && cp $spell_depends depends

+ # sub-depends we provide
+ local sub_depends_file rsub_depends_file
+ get_uncommitted_sub_depends_file $SPELL sub_depends_file &&
+ test -e $sub_depends_file && cp $sub_depends_file sub_depends
+ # get sub-depend we request
+ get_uncommitted_rsub_depends_file $SPELL sub_depends_file &&
+ test -e $rsub_depends_file && cp $sub_depends_file rsub_depends
+
# logs
mkdir logs
ln -s $INST_LOG logs/install
@@ -523,62 +574,89 @@ function tablet_set_spell() {


############################ REPAIR files #############################
-function tablet_import_repair_files() {
+#---------------------------------------------------------------------
+## Import repair files for all tablet pages
+#---------------------------------------------------------------------
+function tablet_import_repair_files() { (
local tablet_path=$1
local dir rc chapter page

+ codex_create_in_memory_cache_all -i spell_lookup_hash
+
+ shopt -s nullglob # so REPAIR^* evaluates to nothing if no REPAIR files
+
for chapter in $tablet_path/* ; do
test -d $chapter || continue
for page in $chapter/*; do
test -d $page || continue
- tablet_import_repair_files_page $page
+ tablet_import_repair_files_page "$page" spell_lookup_hash
done
done
-}
+) }

-function tablet_import_repair_files_page() { (
+#---------------------------------------------------------------------
+## Import repair files for a specific tablet page, expects caller
+## to have spell_lookup_hash setup for a spell lookup, and nullglob set.
+#---------------------------------------------------------------------
+function tablet_import_repair_files_page() {
local page=$1
- local spell=$(tablet_get_spell_name_from_path $page)
- codex_set_current_spell_by_name $spell || return 1
- local spell_version spell_updated codex_md5 repair_file tablet_file
tablet_md5
+
+ local spell spell_dir
+ tablet_get_spell_name_from_path "$page" spell
+ hash_get_ref $2 $spell spell_dir
+ codex_get_spell_paths "$spell_dir"
+
local name key
- tablet_get_version $page spell_version
- tablet_get_updated $page spell_updated
- tablet_get_patchlevel $page spell_patchlevel
- for repair_file in $(find $SPELL_DIRECTORY -maxdepth 1 -mindepth 1 -type f
-name 'REPAIR\^*'); do
- name=$(basename $repair_file|cut -f3- -d^)
- key=$(basename $repair_file|cut -f2 -d^)
- [[ $name ]] || continue
- [[ $key ]] || continue
+ local loaded
+ local spell_version spell_updated codex_md5 repair_file tablet_file
tablet_md5
+ for repair_file in $SPELL_DIRECTORY/REPAIR^*; do
+ [[ -f "$repair_file" ]] || continue
+ name=$(smgl_basename "$repair_file"|cut -f3- -d^)
+ key=$(smgl_basename "$repair_file"|cut -f2 -d^)
+ [[ $name ]] || continue
+ [[ $key ]] || continue
tablet_check_repair_file spell
done

- for repair_file in $(find $SECTION_DIRECTORY -maxdepth 1 -mindepth 1 -type
f -name 'REPAIR\^*'); do
- name=$(basename $repair_file|cut -f3- -d^)
- key=$(basename $repair_file|cut -f2 -d^)
- [[ $name ]] || continue
- [[ $key ]] || continue
+ for repair_file in $SECTION_DIRECTORY/REPAIR^*; do
+ [[ -f "$repair_file" ]] || continue
+ name=$(smgl_basename "$repair_file"|cut -f3- -d^)
+ key=$(smgl_basename "$repair_file"|cut -f2 -d^)
+ [[ $name ]] || continue
+ [[ $key ]] || continue
tablet_check_repair_file section
done

- for repair_file in $(find $GRIMOIRE -maxdepth 1 -mindepth 1 -type f -name
'REPAIR\^*'); do
- name=$(basename $repair_file|cut -f3- -d^)
- key=$(basename $repair_file|cut -f2 -d^)
- [[ $name ]] || continue
- [[ $key ]] || continue
+ for repair_file in $GRIMOIRE/REPAIR^*; do
+ [[ -f "$repair_file" ]] || continue
+ name=$(smgl_basename "$repair_file"|cut -f3- -d^)
+ key=$(smgl_basename "$repair_file"|cut -f2 -d^)
+ [[ $name ]] || continue
+ [[ $key ]] || continue
tablet_check_repair_file grimoire
done
-) }
+}

+#---------------------------------------------------------------------
+## Private subroutine for tablet_import_repair_files_page, do not call
+## from anywhere else.
+#---------------------------------------------------------------------
function tablet_check_repair_file() {
local type=$1
local replace=0

+ if ! [[ "$loaded" ]] ; then
+ tablet_get_version "$page" spell_version
+ tablet_get_updated "$page" spell_updated
+ tablet_get_patchlevel "$page" spell_patchlevel
+ loaded=done
+ fi
+
case $type in
spell) tablet_get_spell_file $page $name tablet_file;;
section) tablet_get_section_file $page $name tablet_file;;
grimoire) tablet_get_grimoire_file $page $name tablet_file;;
- *) return 1
+ *) return 1 ;;
esac

if ! [[ $tablet_file ]] ; then
@@ -598,9 +676,9 @@ function tablet_check_repair_file() {
replace=2
fi
fi
- if [[ $replace == 1 ]] ||
+ if [[ $replace == 1 ]] ||
{ [[ $replace == 2 ]] && [[ $codex_md5 != $tablet_md5 ]] ; } ; then
- message "${MESSAGE_COLOR}Tablet Repair: replacing${DEFAULT_COLOR}"
+ message "${MESSAGE_COLOR}Tablet Repair: replacing${DEFAULT_COLOR}"
message "$tablet_file\nwith repair file \n$repair_file"
cp $repair_file $tablet_file
else
@@ -619,15 +697,16 @@ function tablet_cleanse_tablet() {
local file_backup_dir=$backup_dir/tablet_files
local dir rc

- mkdir -p $file_backup_dir
+ mkdir -p "$file_backup_dir"
for dir in $tablet_path/* ; do
- if test -d $dir ; then
- tablet_cleanse_chapter $dir $backup_dir
+ if test -d "$dir" ; then
+ tablet_cleanse_chapter "$dir" "$backup_dir" no
else
message "$dir is not a directory! backing it up in $backup_dir"
- mv $dir $file_backup_dir
+ mv "$dir" "$file_backup_dir"
fi
done
+ tablet_import_repair_files "$tablet_path"
}

#---------------------------------------------------------------------
@@ -636,20 +715,26 @@ function tablet_cleanse_tablet() {
function tablet_cleanse_chapter() {
local sdir=$1
local backup_dir=$2
+ local do_repair=$3
local spell=$(basename $sdir)
local page rc

- mkdir -p $backup_dir/duplicates
- mkdir -p $backup_dir/chapter_files
- tablet_fix_duplicates $spell $sdir $backup_dir/duplicates
- test -d $sdir || return 0
+ mkdir -p "$backup_dir/duplicates"
+ mkdir -p "$backup_dir/chapter_files"
+ tablet_fix_duplicates "$spell" "$sdir" "$backup_dir/duplicates"
+ test -d "$sdir" || return 0
+

for page in $sdir/*; do
- if ! test -d $page; then
+ if ! test -d "$page"; then
message "$dir is not a directory! backing it up in $backup_dir"
- mv $page $backup_dir/chapter_files/$page.$spell
- else
- tablet_import_repair_files_page $page
+ mv "$page" "$backup_dir/chapter_files/$page.$spell"
+ elif [[ $do_repair == yes ]] ; then
+ ( # pretend we're tablet_import_repair_files
+ shopt -s nullglob
+ hash_put spell_lookup_hash "$spell" "$(codex_find_spell_by_name
$spell)"
+ tablet_import_repair_files_page "$page" spell_lookup_hash
+ )
fi
done
}
@@ -687,7 +772,7 @@ function tablet_fix_duplicates() {
tablet_does_tablet_point_to_itself ${tablets[$i]} ||
tablet_backup_page ${tablets[$i]} $backup_dir
done
-
+
if ! [[ $(ls $tbc_dir) ]] ; then
message "Empty tablet chapter: $tbc_dir, removing it"
rmdir $tbc_dir
@@ -824,7 +909,7 @@ function tablet_0_repair() {

#---------------------------------------------------------------------
## @param tablet dir
-##
+##
## tablet may have either
## $tb_dir/spell/DETAILS or
## $tb_dir/spell/<spellname>/DETAILS
diff --git a/var/lib/sorcery/modules/libtrack
b/var/lib/sorcery/modules/libtrack
index 5e31ff6..c9a2aa9 100755
--- a/var/lib/sorcery/modules/libtrack
+++ b/var/lib/sorcery/modules/libtrack
@@ -6,6 +6,17 @@
#---------------------------------------------------------------------

#---------------------------------------------------------------------
+##
+## Initialize libtrack, currently this is just the modified files list.
+## This is used by cast to exclude files it's modified from the md5 list.
+##
+#---------------------------------------------------------------------
+function libtrack_init() {
+ [[ $__MODIFIED_FILES ]] || export
__MODIFIED_FILES="$TMP_DIR/modified_files"
+}
+
+
+#---------------------------------------------------------------------
## @Stdin list of files
## @Stdout list of files
## Reads a list of files from standard in, and returns a list of the
@@ -26,7 +37,8 @@ function exists() {
##
#---------------------------------------------------------------------
function real_track_manual() {
- if [[ -z "$INSTALLWATCHFILE" ]]; then
+ if [[ -z "$STAGED_INSTALL" || $STAGED_INSTALL == off ]] &&
+ [[ -z "$INSTALLWATCHFILE" ]] ; then
echo "Can't tell installwatch to manually track... installwatch isn't
running."
return 1
fi
@@ -37,6 +49,105 @@ function real_track_manual() {
return 0
}

+#--------------------------------------------------------------------
+## Some simple castfs sanity checking
+## make a file, check to see if it exists, check to see if the
+## contents of the file is what we made it
+#--------------------------------------------------------------------
+function run_castfs_sanity()
+{
+ export CASTFS_LOGFILE=${CASTFS_DBGLOG}
+ export CASTFS_DBGLVL=${CASTFS_DEBUG_LEVEL}
+ debug "libtrack" "$FUNCNAME on $SPELL"
+
+ # first check if /dev/null is really a character device #13315
+ if [[ ! -c /dev/null ]]; then
+ debug "libtrack" "$FUNCNAME failure: damaged /dev/null"
+ return 1
+ fi
+
+ mkdir -p "${TMP_DIR}/test-mount" &&
+ mkdir -p "${TMP_DIR}/test-stage" &&
+ castfs "${TMP_DIR}/test-mount" -o "stage=${TMP_DIR}/test-stage" -o
"ignore=/tmp" &&
+ pushd "${TMP_DIR}/test-mount" > /dev/null &&
+ (
+ (echo stuff > foo) &&
+ (ls foo > /dev/null 2>&1) &&
+ (test "stuff" = "`cat foo`") &&
+ rm -f foo
+ )
+ local rc=$?
+ popd > /dev/null
+ if [[ $rc == 0 ]]
+ then
+ debug "libtrack" "$FUNCNAME success"
+ else
+ debug "libtrack" "$FUNCNAME failure"
+ fi
+ umount -l "${TMP_DIR}/test-mount"
+ return $rc
+}
+
+#---------------------------------------------------------------------
+##
+## Starts Translation Stage Root
+##
+#---------------------------------------------------------------------
+function real_invoke_stage_root()
+{
+ export CASTFS_LOGFILE=${CASTFS_DBGLOG}
+ export CASTFS_DBGLVL=${CASTFS_DEBUG_LEVEL}
+ local CASTFS_IGNORE_LIST=""
+ local LOCAL_IGNORE_DIRS="${CCACHE_DIR} ${DISTCC_DIR}"
+ # this forks and daemonizes so it will exit you simply unmount the dir to
stop the process
+ for dir in ${CASTFS_UNSTAGED_PATHS} ${LOCAL_IGNORE_DIRS}
+ do
+ CASTFS_IGNORE_LIST="${CASTFS_IGNORE_LIST} -o ignore=$dir"
+ done &&
+ castfs "${STAGE_DIRECTORY}/MOUNT" -o "stage=${STAGE_DIRECTORY}/TRANSL"
$CASTFS_IGNORE_LIST &&
+ for dir in /dev /dev/pts /proc /sys
+ do
+ mount -o bind "$dir" "${STAGE_DIRECTORY}/MOUNT$dir"
+ done
+}
+
+#---------------------------------------------------------------------
+##
+## Stops Translation Stage Root
+##
+#---------------------------------------------------------------------
+function real_devoke_stage_root()
+{
+ unset CASTFS_LOGFILE
+ unset CASTFS_DBGLVL
+ for dir in /dev/pts /dev /proc /sys
+ do
+ umount -l "${STAGE_DIRECTORY}/MOUNT$dir"
+ done &&
+ umount -l "${STAGE_DIRECTORY}/MOUNT"
+}
+
+#---------------------------------------------------------------------
+##
+## Prepare Stage Root
+##
+#---------------------------------------------------------------------
+function prepare_stage_root()
+{
+ mk_source_dir "${STAGE_DIRECTORY}" &&
+ mk_source_dir "${STAGE_DIRECTORY}/TRANSL" &&
+ mk_source_dir "${STAGE_DIRECTORY}/MOUNT"
+}
+
+#---------------------------------------------------------------------
+##
+## Destroy Stage Root
+##
+#---------------------------------------------------------------------
+function destroy_stage_root()
+{
+ rm_source_dir $STAGE_DIRECTORY
+}

#---------------------------------------------------------------------
##
@@ -46,18 +157,10 @@ function real_track_manual() {
function real_invoke_installwatch() {
if [ -e /usr/lib/installwatch.so ]; then
export INSTALLWATCHFILE=$IW_LOG
- export INSTW_LOGFILE=$IW_LOG
- export INSTW_DBGFILE="$TMP_DIR/dbgfile"
- export INSTW_ROOTPATH=$TMP_DIR
- export INSTW_TRANSL=0
- export INSTW_BACKUP=0
- export INSTW_DBGLVL=0
- export INSTW_EXCLUDE="/dev,/proc,/tmp,/var/tmp,/usr/src,/sys"
export LD_PRELOAD=/usr/lib/installwatch.so
fi
}

-
#---------------------------------------------------------------------
##
## Stops using installwatch
@@ -66,15 +169,25 @@ function real_invoke_installwatch() {
function real_devoke_installwatch() {
unset LD_PRELOAD
unset INSTALLWATCHFILE
- unset INSTW_LOGFILE
- unset INSTW_DBGFILE
- unset INSTW_ROOTPATH
- unset INSTW_TRANSL
- unset INSTW_BACKUP
- unset INSTW_DBGLVL
- unset INSTW_EXCLUDE
}

+function is_castfs_installed()
+{
+ local loc
+ if smgl_which castfs loc >/dev/null 2>&1 &&
+ (
+ modprobe fuse > /dev/null 2>&1 ||
+ grep -q '^nodev[[:space:]]*fuse$' /proc/filesystems
+ ) &&
+ [[ -c /dev/fuse ]]
+ then
+ message "${MESSAGE_COLOR}staging enabled${DEFAULT_COLOR}"
+ return 0
+ else
+ message "${MESSAGE_COLOR}staging disabled${DEFAULT_COLOR}"
+ return 1
+ fi
+}

#---------------------------------------------------------------------
##
@@ -87,7 +200,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'
@@ -106,14 +219,22 @@ function create_install_log() {
local OUTPUT=$2

rm -f $OUTPUT
- parse_iw $INPUT |
- sort |
- uniq |
- install_log_filter $INSTALL_ROOT "" |
- grep -v -x "" |
- filter_excluded |
- install_log_filter "" $INSTALL_ROOT |
- exists > $OUTPUT
+ if [[ $STAGED_INSTALL != off ]]
+ then
+ find "${STAGE_DIRECTORY}/TRANSL/" |
+ sed "s#${STAGE_DIRECTORY}/TRANSL##g"|
+ grep -v -x '/' |
+ filter_excluded > $OUTPUT
+ else
+ parse_iw $INPUT |
+ sort |
+ uniq |
+ install_log_filter $INSTALL_ROOT "" |
+ grep -v -x "" |
+ filter_excluded |
+ install_log_filter "" $INSTALL_ROOT |
+ exists > $OUTPUT
+ fi

echo "$C_LOG_COMP" >> $OUTPUT
echo "$MD5_LOG" >> $OUTPUT
@@ -122,6 +243,30 @@ function create_install_log() {
}

#---------------------------------------------------------------------
+##
+## Creates the install log containing all staged files. It reuses
+## the existing install log and just prepends $STAGE_DIRECTORY/TRANSL
+## to every line
+##
+## @param input log file
+## @param output log file
+##
+#---------------------------------------------------------------------
+function create_stage_install_log() {
+ debug "libtrack" "$FUNCNAME on $SPELL"
+ local input="$1"
+ local output="$2"
+
+ # treat the logs specially, as they weren't staged
+ grep -v "$C_LOG_COMP\|$MD5_LOG\|$INST_LOG" "$input" > "$output"
+ sed -i "s#^#$STAGE_DIRECTORY/TRANSL#" "$output"
+ echo "$C_LOG_COMP" >> "$output"
+ echo "$MD5_LOG" >> "$output"
+ echo "$INST_LOG" >> "$output"
+
+}
+
+#---------------------------------------------------------------------
## Makes a list of files with the md5sum
#---------------------------------------------------------------------
function create_md5list() {
@@ -141,6 +286,16 @@ function create_md5list() {
}

#---------------------------------------------------------------------
+## External api to note config files
+#---------------------------------------------------------------------
+function real_note_config_file() {
+ if check_if_modified "$1"; then
+ mark_file_modified "$1"
+ fi
+}
+
+
+#---------------------------------------------------------------------
## Notes that a file was previously modified so that its md5 is
## deliberatly munged
#---------------------------------------------------------------------
@@ -176,6 +331,7 @@ function check_if_modified() {
fi
}

+
#---------------------------------------------------------------------
##
## Creates a bzip/gzip'ed tar file containing an archived backup of
@@ -335,14 +491,10 @@ function log_adjuster() {
fi
fi

- local TMP_SSF=$TMP_DIR/$RANDOM
- while ! mkdir $TMP_SSF &>/dev/null; do
- TMP_SSF=$TMP_DIR/$RANDOM
- sleep 1
- done
+ local TMP_SSF=$(make_safe_dir)
local TMP_DATA=$TMP_SSF/foo.data
local TMP_MDATA=$TMP_SSF/foo.mdata
-
+
seperate_state_files $input $TMP_DATA $TMP_MDATA
{
if [[ $cat_metadata ]] ; then
@@ -354,6 +506,7 @@ function log_adjuster() {
} > $output
rm $TMP_DATA $TMP_MDATA
rmdir $TMP_SSF
+ return 0
}

#---------------------------------------------------------------------
@@ -370,21 +523,53 @@ function seperate_state_files() {
local REAL_STATE_DIR=${STATE_DIRECTORY#$STATE_ROOT}

# the input file is almost certainly a pipe, and things get weird
- # since we have to grep twice, so just dump the data into a unique
- # file, the loop below shouldn't go forever unless there's ~30,000 pipes
+ # since we have to grep twice, so just dump the data into a unique file

- local FILE=$TMP_DIR/ssf.$RANDOM
- while test -e $FILE; do
- FILE=$TMP_DIR/ssf.$RANDOM
- done
+ local TMP_SSF=$(make_safe_dir)
+ local FILE=$TMP_SSF/ssf
cat $1 > $FILE
grep -v "$REAL_LOG_DIR\|$REAL_STATE_DIR" $FILE | grep -xv '' > $2
grep "$REAL_LOG_DIR\|$REAL_STATE_DIR" $FILE | grep -xv '' > $3
rm $FILE
+ rmdir $TMP_SSF
return 0
}

#---------------------------------------------------------------------
+## Try to make a unique directory using $RANDOM, leverage the fact that
+## two simultaneous mkdir's will have one succeed and the other fail.
+##
+## This is run from log_adjuster primarily which may be invoked several
+## times in a pipe, when this happens, bash does a fork, but does not
+## seem to reseed the random number generator, causing a high rate of
+## collisions. This is not easily reproducable outside of sorcery at
+## the time of writing, but inside it happens nearly everytime with bash
+## 3.1. This may actually be a bash 3.1 bug.
+##
+## The collisions aren't bad necessarily, but they result in un-necesary
+## delay.
+##
+## Setting RANDOM re-seeds the random number generator.
+##
+## Despite the fact that the subshell and invocation of date are slow
+## the consequence for not doing them are worse. The nano-seconds
+## are usually going to be different between forks so the liklihood
+## of a collision is greatly reduced.
+#---------------------------------------------------------------------
+function make_safe_dir() { (
+ RANDOM=$(date "+%N")
+ local TMP_SSF=$TMP_DIR/$RANDOM
+ while ! mkdir "$TMP_SSF" &> /dev/null; do
+ RANDOM=$(date "+%N")
+ TMP_SSF=$TMP_DIR/$RANDOM
+ sleep .1
+ debug "libtrack" "safe dir collision on $TMP_SSF"
+ done
+ echo $TMP_SSF
+ return 0
+) }
+
+#---------------------------------------------------------------------
## @License
##
## This software is free software; you can redistribute it and/or modify
diff --git a/var/lib/sorcery/modules/libtriggers
b/var/lib/sorcery/modules/libtriggers
index 1029e23..a42c099 100755
--- a/var/lib/sorcery/modules/libtriggers
+++ b/var/lib/sorcery/modules/libtriggers
@@ -18,28 +18,23 @@
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

}

#---------------------------------------------------------------------
## @param spell
##
-## Remove's all of a spell's triggers from the list of registered
+## Remove's all of a spell's triggers from the list of registered
## triggers.
##
#---------------------------------------------------------------------
function remove_triggers ()
-{
+{
debug "libtriggers" "remove_triggers - $*"

[ -f $TRIGGER_LIST ] || return 0
- tTRIGGER_LIST=`lock_start_transaction $TRIGGER_LIST`
- [ -f $tTRIGGER_LIST ] || return 0
+ lock_start_transaction "$TRIGGER_LIST" tTRIGGER_LIST
grep -v "^$SPELL:" $TRIGGER_LIST > $tTRIGGER_LIST
lock_commit_transaction $TRIGGER_LIST
return $?
@@ -52,17 +47,17 @@ function remove_triggers ()
##
## @Stdout Query and warnings
## @Stdin y/n
-## Triggers an event and performs necessary actions. Argument 2 is
+## Triggers an event and performs necessary actions. Argument 2 is
## optional. If omitted, the value of SPELL will be used.
##
#---------------------------------------------------------------------
function trigger ()
-{
+{
debug "libtriggers" "trigger - $*"

local spell TRIGGER action
action=$1
- spell=`esc_str ${SPELL:-$4}`
+ spell=`esc_str ${SPELL:-$2}`

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


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


#---------------------------------------------------------------------
-## @param filename
-## @param compressor
+## @param filename
+## @param compressor
## @Stdout uncompressed
##
## unpack_core takes the uncompressed stream and turns it into the
@@ -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 ;;
@@ -282,7 +282,7 @@ function unpack_spell_required() {
if ! spell_ok "$1" && ! smgl_which $2 x &> /dev/null; then
query "This spell has an option to check its integrity via spell "\
"${SPELL_COLOR}${1}${QUERY_COLOR} with the $2 command for $3, you might
consider installing it. "\
-"Abort?" n &&
+"Abort?" n &&
return 1 ||
return 200
else
@@ -352,7 +352,7 @@ function is_allowed_hash() {
rc=1
elif [[ "$VRF_ALLOW_NEW_HASHES" == "on" ]]
then
- message "${MESSAGE_COLOR}Allowing new hash${hash}${DEFAULT_COLOR}"
+ message "${MESSAGE_COLOR}Allowing new hash ${hash}${DEFAULT_COLOR}"
if is_allowed_verf_level $HASHLEVEL ; then rc=0 ; else rc=1; fi
else
message "${PROBLEM_COLOR}Disallowing new hash ${hash}${DEFAULT_COLOR}"
@@ -362,12 +362,12 @@ function is_allowed_hash() {
}

#---------------------------------------------------------------------
-## @param file to unpack
+## @param file to unpack
## @param gpg public key file (.gpg) ":" gpg signature file (.asc)
##
-## Given a file, unpack checks the gpg signature for that file, and, if
-## appropriate, runs the decompression program for that file, as well as
-## untar'ing the file. Note: zip is a special case because it doesn't
+## Given a file, unpack checks the gpg signature for that file, and, if
+## appropriate, runs the decompression program for that file, as well as
+## untar'ing the file. Note: zip is a special case because it doesn't
## work with streams.
##
#---------------------------------------------------------------------
@@ -399,7 +399,14 @@ function unpack_gpg() {
rc="$?"
case "$rc" in
0)
- if is_allowed_hash $GPGALGO_USED $GPGLEVEL ; then rc=0 ; else rc=1 ; fi
+ local algo
+ rc=1
+ for algo in $GPGALGO_USED; do
+ if is_allowed_hash "$algo" "$GPGLEVEL"; then
+ rc=0
+ break
+ fi
+ done
;;
3) message_file="Signature" ;;
4) message_file="Source" ;;
@@ -409,10 +416,10 @@ function unpack_gpg() {
then
message "${PROBLEM_COLOR}AHHH!!! ${message_file} file not
found${DEFAULT_COLOR}"
fi
- if [ "$rc" -eq 200 ]; then
+ if [ "$rc" -eq 200 ]; then
return 200
fi
-
+
gpg_user_query $rc $SPELL spell || return 1
return 0

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


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

if [[ "$ALGORITHM" == md5 ]] || [[ "$ALGORITHM" == sha1 ]] ; then
unpack_spell_required coreutils "${ALGORITHM}sum" "$ALGORITHM" ||
- return "$?"
+ return "$?"
HASH="$(${ALGORITHM}sum "$FILENAME" | cut -d' ' -f1)"
else
unpack_spell_required gnupg gpg "$ALGORITHM" || return "$?"
if list_find "$(gpg_get_hashes)" $ALGORITHM; then
HASH="$(gpg_hashsum "${ALGORITHM}" "$FILENAME" | cut -d' ' -f1)"
- else
+ else
message "${PROBLEM_COLOR}Algorithm $ALGORITHM is not"\
"known!${DEFAULT_COLOR}"
return 200
@@ -468,7 +475,8 @@ function unpack_hash() {
error_message "$HASH (computed) != $HASHSUM (expected)!$DEFAULT_COLOR"
&&
hash_user_query 1 "$SPELL" spell || return 1
else
- if is_allowed_hash ${ALGORITHM} ${HLEVEL} ; then rc=0 ; else rc=1 ; fi
+ is_allowed_hash "$ALGORITHM" "$HLEVEL"
+ rc=$?
hash_user_query $rc "$SPELL" spell || return 1
fi
else
@@ -479,11 +487,11 @@ function unpack_hash() {

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

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


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


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

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

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


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

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

# Outer subshell is necessary to redirect stderr to stdout
(
diff --git a/var/lib/sorcery/modules/liburl b/var/lib/sorcery/modules/liburl
index fb7674c..7b6199d 100755
--- a/var/lib/sorcery/modules/liburl
+++ b/var/lib/sorcery/modules/liburl
@@ -18,14 +18,14 @@
##
## The F<url_download> function parses the url prefix (in this
## case, http) and passes the url to the http download handler
-## (F<url_http_download>). A similar approach is used for url
+## (F<url_http_download>). A similar approach is used for url
## verification.
##
## This file provides an infrastructure that makes it relatively easy
## to add new url handlers. In order to add new handlers, all that
## has to be done is add a new file to the sorcerer library directory
## with the new url handler functions defined in the file. This new
-## file will automatically be discovered and used by the sorcerer
+## file will automatically be discovered and used by the sorcerer
## scripts.
##
## The following section describes how to add new url handlers in
@@ -83,8 +83,8 @@
if ! [[ $URL_HANDLER_FILES ]] ; then
URL_HANDLER_FILES=`ls $SGL_LIBRARY_MODULES/url_handlers/url_*[^~]`
for url_handler_file in $URL_HANDLER_FILES; do
- [ -x $url_handler_file ] &&
- URL_PREFIX=`echo $url_handler_file | sed "s/.*\/url_//"` &&
+ [ -x $url_handler_file ] &&
+ URL_PREFIX=`echo $url_handler_file | sed "s/.*\/url_//"` &&
URL_TYPES[${#URL_TYPES[@]}]=$URL_PREFIX &&
. $url_handler_file
done
@@ -126,7 +126,7 @@ function url_download_expand_sort() {
# limit and doing netselect on that many urls is absurd
expanded_urls=$(echo "$expanded_urls"|head -n 50)
debug "liburl" "expanded urls $expanded_urls"
- # sort urls
+ # sort urls
url_sort_urls sorted_urls "$expanded_urls"
if ! [[ "$sorted_urls" ]] ; then
message "No sorted urls! If you get this it is a sorcery bug"
@@ -139,19 +139,15 @@ function url_download_expand_sort() {
}

#---------------------------------------------------------------------
-## @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 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
##
## @return 0 if file could be downloaded
## @return 1 otherwise
-## Downloads the specified url. Returns true if file could be
+## Downloads the specified url. Returns true if file could be
## downloaded, false otherwise.
##
##
@@ -190,7 +186,7 @@ function url_download() {
message "Failed to find a download handler for $url, this is likely to
be a sorcery bug"
fi
done
-
+
# sort buckets, someday a better algorithm may be used, however
# this should be sufficient for now.
buckets=$(hash_get_table_fields dl_buckets|sort)
@@ -289,7 +285,7 @@ function url_rank() {
# want netselect to find the fastest one

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

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

@@ -349,7 +345,7 @@ function url_rank() {

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

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

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

#---------------------------------------------------------------------
-## @param url
+## @param url
##
## Parse the url somehow. The results are url specific right now,
## this is usually only called by dl handlers who know what url types
@@ -406,7 +402,7 @@ function url_bucketize() {
#---------------------------------------------------------------------
function url_crack() {
$STD_DEBUG
- url_generic_apifunc crack $1
+ url_generic_apifunc crack "$@"
}

#---------------------------------------------------------------------
@@ -422,7 +418,7 @@ function url_expand() {
}

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

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

#---------------------------------------------------------------------
-## @param url
+## @param url
## @Stdout url netslect output
## @return 0 valid url
## @return 1 otherwise
diff --git a/var/lib/sorcery/modules/url_handlers/url_cvs
b/var/lib/sorcery/modules/url_handlers/url_cvs
index fa55616..b8dd995 100755
--- a/var/lib/sorcery/modules/url_handlers/url_cvs
+++ b/var/lib/sorcery/modules/url_handlers/url_cvs
@@ -2,7 +2,7 @@
#---------------------------------------------------------------------
##
##=head1 SYNOPSIS
-##
+##
## Url handler functions for grabbing cvs urls.
##
##=head1 DESCRIPTION
@@ -11,7 +11,7 @@
##
##=head1 CVS URL Format
##
-## There is no standard (that I know of) for cvs urls so we use a
+## There is no standard (that I know of) for cvs urls so we use a
## source mage specific format:
##
## cvs://CVSROOT:MODULE_NAME
@@ -22,13 +22,13 @@
##
## cvs://CVSROOT:MODULE_NAME:REVISION_TAG
##
-## The CVSROOT portion of the url may include information such as type of
cvs
-## server, port number for the server, user name, password, cvs repository
+## The CVSROOT portion of the url may include information such as type of cvs
+## server, port number for the server, user name, password, cvs repository
## directory, etc. The CVSROOT syntax is defined by cvs and is as follows:
-##
+##
## :method:[[user][:password]@]hostname[:[port]]/path/to/repository
##
-## For more details, see the CVS manual at
+## For more details, see the CVS manual at
## http://www.cvshome.org/docs/manual/cvs.html
##
##=head1 EXAMPLES
@@ -44,15 +44,15 @@
## cvs://:pserver:anonymous AT mplayerhq.hu:/cvsroot/mplayer:main:1_0pre7
##
## Some cvs repositories require passwords. One such repository is the
-## cvs repository for the ROOT package (an object-oriented data analysis
-## framework, see L<http://root.cern.ch/root/>). The CVSROOT, without the
+## cvs repository for the ROOT package (an object-oriented data analysis
+## framework, see L<http://root.cern.ch/root/>). The CVSROOT, without the
## password, would look like this:
##
## :pserver:cvs AT root.cern.ch:/user/cvs
##
## The password for their cvs repository is I<cvs>. Adding the password
would
## make the CVSROOT look like this:
-##
+##
## :pserver:cvs:cvs AT root.cern.ch:/user/cvs
##
## Thus, the full cvs url, including the password, would be:
@@ -71,7 +71,7 @@

#---------------------------------------------------------------------
##=item url_file_download <url>
-##
+##
## Parse the specified cvs url.
##
## @global URL
@@ -80,12 +80,12 @@
## @global CVS_TAG
##
#---------------------------------------------------------------------
-function url_cvs_crack() {
+function url_cvs_crack() {

URL=`url_strip_prefix "$1" cvs`
CVS_ROOT=`echo $URL | sed "s#\(^[^/]*[^:]*\):.*#\1#"`
local CVS_MODULE_TAG=`echo $URL | sed "s#^[^/]*[^:]*\(.*\)#\1#"`
- CVS_MODULE=`echo $CVS_MODULE_TAG | cut -d : -f2`
+ CVS_MODULE=`echo $CVS_MODULE_TAG | cut -d : -f2`
local CVS_TAGNAME=`echo $CVS_MODULE_TAG | cut -d : -f3`
CVS_TAG=${CVS_TAGNAME:=HEAD}

diff --git a/var/lib/sorcery/modules/url_handlers/url_default
b/var/lib/sorcery/modules/url_handlers/url_default
index ff97283..812cb46 100755
--- a/var/lib/sorcery/modules/url_handlers/url_default
+++ b/var/lib/sorcery/modules/url_handlers/url_default
@@ -1,7 +1,7 @@
#!/bin/bash
#---------------------------------------------------------------------
##
-## @Synopsis
+## @Synopsis
##
## Default implementations of url_handler api.
##
@@ -12,7 +12,7 @@
#---------------------------------------------------------------------
##=item url_default_bucketize
## @param url
-##
+##
## Outputs file as that is the dl handler for file:// urls
##
#---------------------------------------------------------------------
@@ -22,7 +22,7 @@ function url_default_bucketize() {

#---------------------------------------------------------------------
##=item url_default_crack
-##
+##
## Outputs the url with the prefix removed
##
#---------------------------------------------------------------------
@@ -41,10 +41,10 @@ function url_default_expand() {

#---------------------------------------------------------------------
##=item url_default_is_valid
-## @param url
+## @param url
##
## True if url_crack returns true
-##
+##
#---------------------------------------------------------------------
function url_default_is_valid() {
url_crack $1 >/dev/null
@@ -52,7 +52,7 @@ function url_default_is_valid() {

#---------------------------------------------------------------------
##=url_default_verify
-##
+##
## Always returns true
##
#---------------------------------------------------------------------
@@ -78,7 +78,7 @@ function url_default_hostname() {
#---------------------------------------------------------------------
function url_default_netselect() {
local each
- for each in $@ ; do
+ for each in $@ ; do
echo "0 $each"
done
}
diff --git a/var/lib/sorcery/modules/url_handlers/url_dir
b/var/lib/sorcery/modules/url_handlers/url_dir
index c09b804..498aa31 100755
--- a/var/lib/sorcery/modules/url_handlers/url_dir
+++ b/var/lib/sorcery/modules/url_handlers/url_dir
@@ -2,23 +2,23 @@
#---------------------------------------------------------------------
##
##=head1 SYNOPSIS
-##
+##
## Url handler functions for grabbing directory urls.
##
##=head1 DESCRIPTION
##
## This type of url was added as a response to the following request:
##
-## I'm an AbiWord developer, and I keep the latest source
-## tree in my abi directory. If I could make the abi spell
-## (not to be confused with the abispell) use my current
+## I'm an AbiWord developer, and I keep the latest source
+## tree in my abi directory. If I could make the abi spell
+## (not to be confused with the abispell) use my current
## CVS checked-out tree, that would be nice.
##
## This file contains functions for I<downloading> (actually it just
-## copies, tars, and compresses) directories which can be accessed
+## copies, tars, and compresses) directories which can be accessed
## through the local file system.
##
-## Url's of this type are specified using the format
+## Url's of this type are specified using the format
##
## dir://<directory>
##
@@ -37,8 +37,8 @@

#---------------------------------------------------------------------
##=item url_dir_verify <url>
-##
-## Verifies the specified directory exists. Returns true if the
+##
+## Verifies the specified directory exists. Returns true if the
## directory exists OR if the dir is an empty string.
##
#---------------------------------------------------------------------
diff --git a/var/lib/sorcery/modules/url_handlers/url_file
b/var/lib/sorcery/modules/url_handlers/url_file
index 25e8d6c..aec1488 100755
--- a/var/lib/sorcery/modules/url_handlers/url_file
+++ b/var/lib/sorcery/modules/url_handlers/url_file
@@ -4,7 +4,7 @@
## @Synopsis Url handler functions for grabbing file urls.
## This file contains functions for I<downloading> (actually it just
## copies) files which can be accessed through the local file system.
-## Url's of this type are specified using the format
+## Url's of this type are specified using the format
##
## file://<path>
##
@@ -15,8 +15,8 @@
#---------------------------------------------------------------------

#---------------------------------------------------------------------
-## @param url
-##
+## @param url
+##
## Verifies the specified file exists. Returns true if the file exists
## OR if the file is an empty string.
##
diff --git a/var/lib/sorcery/modules/url_handlers/url_git
b/var/lib/sorcery/modules/url_handlers/url_git
index ae61565..8934911 100755
--- a/var/lib/sorcery/modules/url_handlers/url_git
+++ b/var/lib/sorcery/modules/url_handlers/url_git
@@ -2,14 +2,14 @@
#---------------------------------------------------------------------
##
##=head1 SYNOPSIS
-##
+##
## Url handler functions for downloading git urls
##
##=head1 DESCRIPTION
##
-## This file contains functions for downloading and verifying
+## This file contains functions for downloading and verifying
## git urls. This file uses the "git" program.
-##
+##
##=head1 COPYRIGHT
##
## Copyright 2002 by the Source Mage Team
@@ -22,7 +22,7 @@

#---------------------------------------------------------------------
##=item url_git_crack <url>
-##
+##
## Parse the specified git url.
##
## @Global URL
@@ -39,15 +39,14 @@ function url_git_crack() {
local GIT_DIRECTORY_TAG=`echo $URL | sed "s#^[^/]*[^:]*\(.*\)#\1#"`
GIT_DIRECTORY=`echo $GIT_DIRECTORY_TAG | cut -d : -f2`
local GIT_TAGNAME=`echo $GIT_DIRECTORY_TAG | cut -d : -f3`
- GIT_TAG=${SVN_TAGNAME:=master}
+ GIT_TAG=${GIT_TAGNAME:=master}

}

#---------------------------------------------------------------------
##=item url_git_bucketize <url>
-##
-## Verifies the specified git url. Returns true if the url exists
-## OR if the url is an empty string.
+##
+## echoes the download handler - git
##
#---------------------------------------------------------------------
function url_git_bucketize() {
@@ -56,7 +55,7 @@ function url_git_bucketize() {

#---------------------------------------------------------------------
##=item url_git_verify <url>
-##
+##
## Verifies the specified git url. Returns true if the url exists
## OR if the url is an empty string.
##
diff --git a/var/lib/sorcery/modules/url_handlers/url_git_http
b/var/lib/sorcery/modules/url_handlers/url_git_http
new file mode 100755
index 0000000..12765a2
--- /dev/null
+++ b/var/lib/sorcery/modules/url_handlers/url_git_http
@@ -0,0 +1,121 @@
+#!/bin/bash
+#---------------------------------------------------------------------
+##
+##=head1 SYNOPSIS
+##
+## Url handler functions for downloading git urls
+##
+##=head1 DESCRIPTION
+##
+## This file contains functions for downloading and verifying
+## git urls. This file uses the "git" program.
+##
+##=head1 COPYRIGHT
+##
+## Copyright 2002 by the Source Mage Team
+##
+##=head1 FUNCTIONS
+##
+##=over 4
+##
+#---------------------------------------------------------------------
+
+#---------------------------------------------------------------------
+##=item url_git_crack <url>
+##
+## Parse the specified git url.
+##
+## @Global URL
+## @Global GIT_ROOT
+## @Global GIT_DIRECTORY
+## @Global GIT_TAG
+##
+#---------------------------------------------------------------------
+function url_git_http_crack() {
+
+ URL=`url_strip_prefix "$1" git_http`
+ GIT_ROOT=`echo $URL | sed "s#\(^[^/]*[^:]*\):.*#\1#"`
+ GIT_ROOT=http://$GIT_ROOT
+ local GIT_DIRECTORY_TAG=`echo $URL | sed "s#^[^/]*[^:]*\(.*\)#\1#"`
+ GIT_DIRECTORY=`echo $GIT_DIRECTORY_TAG | cut -d : -f2`
+ local GIT_TAGNAME=`echo $GIT_DIRECTORY_TAG | cut -d : -f3`
+ GIT_TAG=${GIT_TAGNAME:=master}
+
+}
+
+#---------------------------------------------------------------------
+##=item url_git_bucketize <url>
+##
+## echoes the download handler - git
+##
+#---------------------------------------------------------------------
+function url_git_http_bucketize() {
+ echo git
+}
+
+#---------------------------------------------------------------------
+##=item url_git_verify <url>
+##
+## Verifies the specified git url. Returns true if the url exists
+## OR if the url is an empty string.
+##
+#---------------------------------------------------------------------
+function url_git_http_verify() {
+ local URL GIT_ROOT GIT_DIRECTORY GIT_TAG item
+ url_git_http_crack $1
+ for item in URL GIT_ROOT GIT_DIRECTORY GIT_TAG ; do
+ if ! [[ ${!item} ]] ; then
+ return 1
+ fi
+ done
+}
+
+#---------------------------------------------------------------------
+##=item url_<prefix>_hostname <url>
+##
+## Gets the hostname out of the url
+#---------------------------------------------------------------------
+function url_git_http_hostname() {
+ echo $1|sed 's:^.*//\([^/]*\).*$:\1:'
+}
+
+#---------------------------------------------------------------------
+##=item url_git_netselect <url>
+##
+## Gets a netselect type output for the url
+##
+#---------------------------------------------------------------------
+function url_git_http_netselect() {
+ local tmp_hostname url_speed each
+
+ for each in "$@" ; do
+ tmp_hostname=$(url_git_http_hostname $each)
+ # since we had to pull the url apart to give netselect
+ # something it can understand we'll just pretend like
+ # multiple A records wont exist for this host...
+ url_speed=$(netselect -s 1 $tmp_hostname 2>/dev/null|awk '{print $1}')
+ [[ -n $url_speed ]] && echo "$url_speed $each"
+ done
+}
+
+
+#---------------------------------------------------------------------
+##=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/url_handlers/url_http
b/var/lib/sorcery/modules/url_handlers/url_http
index 8fbb86e..ff6381d 100755
--- a/var/lib/sorcery/modules/url_handlers/url_http
+++ b/var/lib/sorcery/modules/url_handlers/url_http
@@ -22,9 +22,8 @@

#---------------------------------------------------------------------
##=item url_http_bucketize <url>
-##
-## Verifies the specified http url. Returns true if the url exists
-## OR if the url is an empty string.
+##
+## echoes the download handler - wget
##
#---------------------------------------------------------------------
function url_http_bucketize() {
diff --git a/var/lib/sorcery/modules/url_handlers/url_rsync
b/var/lib/sorcery/modules/url_handlers/url_rsync
index afac2a8..7f071bc 100755
--- a/var/lib/sorcery/modules/url_handlers/url_rsync
+++ b/var/lib/sorcery/modules/url_handlers/url_rsync
@@ -2,7 +2,7 @@
#---------------------------------------------------------------------
##
##=head1 SYNOPSIS
-##
+##
## Url handler functions for grabbing rsync urls.
##
##=head1 DESCRIPTION
@@ -10,7 +10,7 @@
## This file contains functions for I<downloading> files through rsync.
##
## In order for rsync urls to be downloaded, the I<rsync> spell must have
been
-## cast. This script first determines if rsync has been installed before
+## cast. This script first determines if rsync has been installed before
## attempting to download a rsync url.
##
##=head1 RSYNC URL Format
diff --git a/var/lib/sorcery/modules/url_handlers/url_smgl_tla
b/var/lib/sorcery/modules/url_handlers/url_smgl_tla
index 31272bc..b9bcb5b 100755
--- a/var/lib/sorcery/modules/url_handlers/url_smgl_tla
+++ b/var/lib/sorcery/modules/url_handlers/url_smgl_tla
@@ -2,7 +2,7 @@
##
----------------------------------------------------------------------------
##
##=head1 SYNOPSIS
-##
+##
## Url handler functions for parsing smgl's tla urls.
##
##=head1 DESCRIPTION
@@ -11,7 +11,7 @@
##
##=head1 TLA URL Format
##
-## There is no standard (that I know of) for tla urls so we use a
+## There is no standard (that I know of) for tla urls so we use a
## source mage specific format:
##
## smgl_tla://location%archive%revision
@@ -21,7 +21,7 @@
## Revision is the category--branch--version[--patch] construct defined by
## tla.
##
-## For more details, see the tla manual at
+## For more details, see the tla manual at
## http://www.gnu.org/software/gnu-arch/
##
##=head1 EXAMPLES
@@ -29,13 +29,13 @@
## Suppose we want to download the latest version of the emacs-wiki
## scripts from tla. We'd use the following url:
##
-##
smgl_tla://http://sacha.free.net.ph/notebook/arch%sacha AT free.net.ph--main%emacs-wiki--stable--1.0

+##
smgl_tla://http://sacha.free.net.ph/notebook/arch%sacha AT free.net.ph--main%emacs-wiki--stable--1.0
##
## If we want the 1.0.13 release instead (i.e., patch level 13)
## we would use the following url:
##
##
smgl_tla://http://sacha.free.net.ph/notebook/arch%sacha AT free.net.ph--main%emacs-wiki--stable--1.0--patch-13
-##
+##
##=head1 COPYRIGHT
##
## Copyright 2005 the SourceMage Team
@@ -54,7 +54,7 @@ function url_smgl_tla_bucketize() {

#
-----------------------------------------------------------------------------
##=item url_smgl_tla_crack <url>
-##
+##
## Parse the url
##
## @global URL
@@ -63,8 +63,8 @@ function url_smgl_tla_bucketize() {
## @global TLA_REVISION
##
#
-----------------------------------------------------------------------------
-function url_smgl_tla_crack() {
-
+function url_smgl_tla_crack() {
+
URL=`url_strip_prefix "$1" smgl_tla`
TLA_LOCATION=`echo $URL|cut -d"%" -f1`
TLA_ARCHIVE=`echo $URL|cut -d"%" -f2`
@@ -74,7 +74,7 @@ function url_smgl_tla_crack() {

#
-----------------------------------------------------------------------------
##=item url_smgl_tla_is_valid<url>
-##
+##
## Verifies the specified tla url exists. Returns true for now...
##
#
----------------------------------------------------------------------------
diff --git a/var/lib/sorcery/modules/url_handlers/url_svn
b/var/lib/sorcery/modules/url_handlers/url_svn
index 5861575..af19970 100755
--- a/var/lib/sorcery/modules/url_handlers/url_svn
+++ b/var/lib/sorcery/modules/url_handlers/url_svn
@@ -2,40 +2,35 @@
#---------------------------------------------------------------------
##
##=head1 SYNOPSIS
-##
-## Url handler functions for grabbing svn urls.(subversion)
##
-##=head1 DESCRIPTION
-##
-## This file contains functions for parsing svn urls.
+## Url handler functions for parsing subversion urls.
##
##=head1 SVN URL Format
##
-## There did not used to be a standard for svn urls, a source mage
-## specific format was invented:
+## The source mage specific format is:
##
## svn://SVNURL:DIR_NAME
+## svn://SVNURL:DIR_NAME:REVISION_TAG
##
-## The above url will download the latest version of the specified
-## module (i.e., the HEAD revision). To specify a specific revision,
-## the following format can be used:
+## It is exactly the same as a standard svn:// url, with additional
+## tokens at the end DIR_NAME and optional REVISITION_TAG
##
-## svn://SVNURL:DIR_NAME:REVISION_TAG
+## The svn://SVNURL portion of the url will appear on the svn command
+## line as the url.
##
-## The SVNURL portion of the url will appear as a normal http url.
## The DIR_NAME will be the tail element of the SOURCE_DIRECTORY.
##
-## Future work will differntiate between real svn urls and our smgl
-## specific version, and expanding our smgl version to use protocols
-## besides http.
+## In order to maintain compatibility with the original svn url format,
+## which uses http:// as the underlying protocol, a hint may be specified
+## named "old_svn_compat".
##
-## For more details, see the SVN manual at
+## For more details, see the SVN manual at
## http://svnbook.red-bean.com/svnbook/ch03s04.html
##
##=head1 EXAMPLES
##
-## Suppose we want to download the latest version of the sorcery
-## scripts from svn. We'd use the following url:
+## Suppose we want to download the latest version of bmp-plugins
+## from svn. We'd use the following url:
##
## svn://svn.pld-linux.org/svn/bmp-plugins/trunk:bmp-plugins-svn
##
@@ -43,15 +38,12 @@
##
## svn://svn.pld-linux.org/svn/bmp-plugins/trunk:bmp-plugins-svn:4474
##
-## The assumption is made that the svn url is actually an http url.
-## ie. you could use your web browser to access:
-## http://svn.pld-linux.org/svn/bmp-plugins/trunk
-##
## svn repositories requiring passwords are not currently supported.
##
##=head1 COPYRIGHT
##
## Copyright 2004 by the Source Mage Team
+## Copyright 2005 by the Source Mage Team
##
##=head1 FUNCTIONS
##
@@ -60,8 +52,8 @@
#---------------------------------------------------------------------

#---------------------------------------------------------------------
-##=item url_file_download <url>
-##
+##=item url_svn_crack <url>
+##
## Parse the specified svn url.
##
## @Global URL
@@ -70,12 +62,17 @@
## @Global SVN_TAG
##
#---------------------------------------------------------------------
-function url_svn_crack() {
+function url_svn_crack() {

URL=`url_strip_prefix "$1" svn`
SVN_ROOT=`echo $URL | sed "s#\(^[^/]*[^:]*\):.*#\1#"`
+ if list_find "$2" old_svn_compat; then
+ SVN_ROOT=http://$SVN_ROOT
+ else
+ SVN_ROOT=svn://$SVN_ROOT
+ fi
local SVN_MODULE_TAG=`echo $URL | sed "s#^[^/]*[^:]*\(.*\)#\1#"`
- SVN_MODULE=`echo $SVN_MODULE_TAG | cut -d : -f2`
+ SVN_MODULE=`echo $SVN_MODULE_TAG | cut -d : -f2`
local SVN_TAGNAME=`echo $SVN_MODULE_TAG | cut -d : -f3`
SVN_TAG=${SVN_TAGNAME:=HEAD}

diff --git a/var/lib/sorcery/modules/url_handlers/url_svn_http
b/var/lib/sorcery/modules/url_handlers/url_svn_http
new file mode 100644
index 0000000..2392146
--- /dev/null
+++ b/var/lib/sorcery/modules/url_handlers/url_svn_http
@@ -0,0 +1,131 @@
+#!/bin/bash
+#---------------------------------------------------------------------
+##
+##=head1 SYNOPSIS
+##
+## Url handler functions for parsing subversion over http urls.
+##
+##=head1 DESCRIPTION
+##
+## This file contains functions for parsing svn_http urls.
+##
+##=head1 SVN HTTP URL Format
+##
+## The sourcemage specific svn+ssh url is as follows:
+## specific format was invented:
+##
+## svn_http://SVNURL:DIR_NAME
+##
+## The above url will download the latest version of the specified
+## module (i.e., the HEAD revision). To specify a specific revision,
+## the following format can be used:
+##
+## svn://SVNURL:DIR_NAME:REVISION_TAG
+##
+## The SVNURL portion of the url will appear as a normal http url
+## sans http:// prefix.
+##
+## The DIR_NAME will be the tail element of the SOURCE_DIRECTORY.
+##
+## For more details, see the SVN manual at
+## http://svnbook.red-bean.com/svnbook/ch03s04.html
+## and url_svn.
+##
+##=head1 COPYRIGHT
+##
+## Copyright 2004 by the Source Mage Team
+## Copyright 2005 by the Source Mage Team
+##
+#---------------------------------------------------------------------
+
+#---------------------------------------------------------------------
+##=item url_svn_http_bucketize
+## @param url
+##
+## Outputs svn as that is the dl handler for svn_http:// urls
+#---------------------------------------------------------------------
+function url_svn_http_bucketize() {
+ echo svn
+}
+
+#---------------------------------------------------------------------
+##=item url_file_download <url>
+##
+## Parse the specified svn_http url.
+##
+## @Global URL
+## @Global SVN_ROOT
+## @Global SVN_MODULE
+## @Global SVN_TAG
+##
+#---------------------------------------------------------------------
+function url_svn_http_crack() {
+
+ URL=`url_strip_prefix "$1" svn_http`
+ SVN_ROOT=http://`echo $URL | sed "s#\(^[^/]*[^:]*\):.*#\1#"`
+ local SVN_MODULE_TAG=`echo $URL | sed "s#^[^/]*[^:]*\(.*\)#\1#"`
+ SVN_MODULE=`echo $SVN_MODULE_TAG | cut -d : -f2`
+ local SVN_TAGNAME=`echo $SVN_MODULE_TAG | cut -d : -f3`
+ SVN_TAG=${SVN_TAGNAME:=HEAD}
+
+}
+
+#---------------------------------------------------------------------
+##=item url_svn_http_is_valid <url>
+##
+## Ensure that all the fields that should be parsed out from a url
+## do indeed exist
+#---------------------------------------------------------------------
+function url_svn_http_is_valid() {
+ url_svn_is_valid "$@"
+}
+
+#---------------------------------------------------------------------
+##=item url_svn_http_hostname <url>
+##
+## Get the hostname of the url
+##
+#---------------------------------------------------------------------
+function url_svn_http_hostname() {
+ echo $1|sed 's#^svn_http://\([^/:]*\)[/:].*$#\1#'
+}
+
+#---------------------------------------------------------------------
+##=item url_svn_http_netselect <url>
+##
+## Gets a netselect type output for the url
+##
+#---------------------------------------------------------------------
+function url_svn_http_netselect() {
+ local tmp_hostname url_speed each
+
+ for each in "$@" ; do
+ tmp_hostname=$(url_svn_http_hostname $each)
+ # since we had to pull the url apart to give netselect
+ # something it can understand we'll just pretend like
+ # multiple A records wont exist for this host...
+ url_speed=$(netselect -s 1 $tmp_hostname 2>/dev/null|awk '{print $1}')
+ [[ -n $url_speed ]] && echo "$url_speed $each"
+ done
+}
+
+#---------------------------------------------------------------------
+##=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/url_handlers/url_svn_https
b/var/lib/sorcery/modules/url_handlers/url_svn_https
new file mode 100644
index 0000000..7e71645
--- /dev/null
+++ b/var/lib/sorcery/modules/url_handlers/url_svn_https
@@ -0,0 +1,131 @@
+#!/bin/bash
+#---------------------------------------------------------------------
+##
+##=head1 SYNOPSIS
+##
+## Url handler functions for parsing subversion over https urls.
+##
+##=head1 DESCRIPTION
+##
+## This file contains functions for parsing svn_https urls.
+##
+##=head1 SVN HTTP URL Format
+##
+## The sourcemage specific svn+ssh url is as follows:
+## specific format was invented:
+##
+## svn_https://SVNURL:DIR_NAME
+##
+## The above url will download the latest version of the specified
+## module (i.e., the HEAD revision). To specify a specific revision,
+## the following format can be used:
+##
+## svn://SVNURL:DIR_NAME:REVISION_TAG
+##
+## The SVNURL portion of the url will appear as a normal https url
+## sans https:// prefix.
+##
+## The DIR_NAME will be the tail element of the SOURCE_DIRECTORY.
+##
+## For more details, see the SVN manual at
+## https://svnbook.red-bean.com/svnbook/ch03s04.html
+## and url_svn.
+##
+##=head1 COPYRIGHT
+##
+## Copyright 2004 by the Source Mage Team
+## Copyright 2005 by the Source Mage Team
+##
+#---------------------------------------------------------------------
+
+#---------------------------------------------------------------------
+##=item url_svn_https_bucketize
+## @param url
+##
+## Outputs svn as that is the dl handler for svn_https:// urls
+#---------------------------------------------------------------------
+function url_svn_https_bucketize() {
+ echo svn
+}
+
+#---------------------------------------------------------------------
+##=item url_file_download <url>
+##
+## Parse the specified svn_https url.
+##
+## @Global URL
+## @Global SVN_ROOT
+## @Global SVN_MODULE
+## @Global SVN_TAG
+##
+#---------------------------------------------------------------------
+function url_svn_https_crack() {
+
+ URL=`url_strip_prefix "$1" svn_https`
+ SVN_ROOT=https://`echo $URL | sed "s#\(^[^/]*[^:]*\):.*#\1#"`
+ local SVN_MODULE_TAG=`echo $URL | sed "s#^[^/]*[^:]*\(.*\)#\1#"`
+ SVN_MODULE=`echo $SVN_MODULE_TAG | cut -d : -f2`
+ local SVN_TAGNAME=`echo $SVN_MODULE_TAG | cut -d : -f3`
+ SVN_TAG=${SVN_TAGNAME:=HEAD}
+
+}
+
+#---------------------------------------------------------------------
+##=item url_svn_https_is_valid <url>
+##
+## Ensure that all the fields that should be parsed out from a url
+## do indeed exist
+#---------------------------------------------------------------------
+function url_svn_https_is_valid() {
+ url_svn_is_valid "$@"
+}
+
+#---------------------------------------------------------------------
+##=item url_svn_https_hostname <url>
+##
+## Get the hostname of the url
+##
+#---------------------------------------------------------------------
+function url_svn_https_hostname() {
+ echo $1|sed 's#^svn_https://\([^/:]*\)[/:].*$#\1#'
+}
+
+#---------------------------------------------------------------------
+##=item url_svn_https_netselect <url>
+##
+## Gets a netselect type output for the url
+##
+#---------------------------------------------------------------------
+function url_svn_https_netselect() {
+ local tmp_hostname url_speed each
+
+ for each in "$@" ; do
+ tmp_hostname=$(url_svn_https_hostname $each)
+ # since we had to pull the url apart to give netselect
+ # something it can understand we'll just pretend like
+ # multiple A records wont exist for this host...
+ url_speed=$(netselect -s 1 $tmp_hostname 2>/dev/null|awk '{print $1}')
+ [[ -n $url_speed ]] && echo "$url_speed $each"
+ done
+}
+
+#---------------------------------------------------------------------
+##=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/url_handlers/url_svn_ssh
b/var/lib/sorcery/modules/url_handlers/url_svn_ssh
new file mode 100644
index 0000000..a2d2ec6
--- /dev/null
+++ b/var/lib/sorcery/modules/url_handlers/url_svn_ssh
@@ -0,0 +1,127 @@
+#!/bin/bash
+#---------------------------------------------------------------------
+##
+##=head1 SYNOPSIS
+##
+## Url handler functions for parsing smgl specific subversion over ssh urls.
+##
+##=head1 SVN URL Format
+##
+## The sourcemage specific svn+ssh url is as follows:
+## specific format was invented:
+##
+## svn_ssh://SVNURL:DIR_NAME
+##
+## The above url will download the latest version of the specified
+## module (i.e., the HEAD revision). To specify a specific revision,
+## the following format can be used:
+##
+## svn://SVNURL:DIR_NAME:REVISION_TAG
+##
+## The SVNURL portion of the url will appear as a normal svn+ssh url
+## sans svn+ssh:// prefix.
+##
+## The DIR_NAME will be the tail element of the SOURCE_DIRECTORY.
+##
+## For more details, see the SVN manual at
+## http://svnbook.red-bean.com/svnbook/ch03s04.html
+## and url_svn.
+##
+##=head1 COPYRIGHT
+##
+## Copyright 2004 by the Source Mage Team
+## Copyright 2005 by the Source Mage Team
+##
+#---------------------------------------------------------------------
+
+#---------------------------------------------------------------------
+##=item url_svn_http_bucketize
+## @param url
+##
+## Outputs svn as that is the dl handler for svn_http:// urls
+#---------------------------------------------------------------------
+function url_svn_ssh_bucketize() {
+ echo svn
+}
+
+#---------------------------------------------------------------------
+##=item url_file_download <url>
+##
+## Parse the specified svn_ssh url.
+##
+## @Global URL
+## @Global SVN_ROOT
+## @Global SVN_MODULE
+## @Global SVN_TAG
+##
+#---------------------------------------------------------------------
+function url_svn_ssh_crack() {
+
+ URL=`url_strip_prefix "$1" svn_ssh`
+ SVN_ROOT=svn+ssh://`echo $URL | sed "s#\(^[^/]*[^:]*\):.*#\1#"`
+ local SVN_MODULE_TAG=`echo $URL | sed "s#^[^/]*[^:]*\(.*\)#\1#"`
+ SVN_MODULE=`echo $SVN_MODULE_TAG | cut -d : -f2`
+ local SVN_TAGNAME=`echo $SVN_MODULE_TAG | cut -d : -f3`
+ SVN_TAG=${SVN_TAGNAME:=HEAD}
+
+}
+
+#---------------------------------------------------------------------
+##=item url_svn_ssh_is_valid <url>
+##
+## Ensure that all the fields that should be parsed out from a url
+## do indeed exist
+#---------------------------------------------------------------------
+function url_svn_ssh_is_valid() {
+ url_svn_is_valid "$@"
+}
+
+#---------------------------------------------------------------------
+##=item url_svn_ssh_hostname <url>
+##
+## Get the hostname of the url
+##
+#---------------------------------------------------------------------
+function url_svn_ssh_hostname() {
+ echo $1|sed 's#^svn_ssh://\([^/:]*\)[/:].*$#\1#'
+}
+
+#---------------------------------------------------------------------
+##=item url_svn_ssh_netselect <url>
+##
+## Gets a netselect type output for the url
+##
+#---------------------------------------------------------------------
+function url_svn_ssh_netselect() {
+ local tmp_hostname url_speed each
+
+ for each in "$@" ; do
+ tmp_hostname=$(url_svn_ssh_hostname $each)
+ # since we had to pull the url apart to give netselect
+ # something it can understand we'll just pretend like
+ # multiple A records wont exist for this host...
+ url_speed=$(netselect -s 1 $tmp_hostname 2>/dev/null|awk '{print $1}')
+ [[ -n $url_speed ]] && echo "$url_speed $each"
+ done
+}
+
+#---------------------------------------------------------------------
+##=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/protected b/var/lib/sorcery/protected
index 47ea3e8..24ecff6 100755
--- a/var/lib/sorcery/protected
+++ b/var/lib/sorcery/protected
@@ -43,6 +43,7 @@
^/etc/ssl/certs/
^/etc/sudoers$
^/etc/services$
+^/etc/sysconfig/facilities$
^/etc/protocols$
^/lib/modules
^/lib/ld\.so\.1$



  • [SM-Commit] GIT changes to test-1.13 sorcery by Jaka Kranjc (7c8d984b745792719e7c03bc9335f30a4fd8e682), Jaka Kranjc, 03/24/2008

Archive powered by MHonArc 2.6.24.

Top of Page