Skip to Content.
Sympa Menu

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

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Jaka Kranjc <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (3de7e51c25f6dc38dc2c6fe4320a0872e31cdf0b)
  • Date: Mon, 29 Dec 2008 14:01:40 -0600

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

ChangeLog | 5 +++++
usr/sbin/cast | 26 +++++++++++++++++++++++++-
var/lib/sorcery/modules/libcodex | 3 ++-
3 files changed, 32 insertions(+), 2 deletions(-)

New commits:
commit 3de7e51c25f6dc38dc2c6fe4320a0872e31cdf0b
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

* libcodex: made codex_find_grimoire also check dirs under $CODEX_ROOT
* cast: -g now verifies the grimoires and offers to fetch them if they
are not present

diff --git a/ChangeLog b/ChangeLog
index 1e50658..6381038 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-12-29 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * libcodex: made codex_find_grimoire also check dirs under $CODEX_ROOT
+ * cast: -g now verifies the grimoires and offers to fetch them if they
+ are not present
+
2008-12-23 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* gaze, gaze.1: solidified the gaze from matching and added optional
regex support (pass -regex)
diff --git a/usr/sbin/cast b/usr/sbin/cast
index 56c4e90..b1beb0b 100755
--- a/usr/sbin/cast
+++ b/usr/sbin/cast
@@ -105,7 +105,7 @@ function process_parameters() {
--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
;;
+ -g|--grimoire*) 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
;;
@@ -204,6 +204,30 @@ function get_option() {
}

#---------------------------------------------------------------------
+## Check that we have all the passed grimoires and use them to
+## override the default selection (all)
+#---------------------------------------------------------------------
+function override_grimoires() {
+ local grimoires=$1
+ local grimoire
+
+ for grimoire in $grimoires; do
+ if ! codex_find_grimoire $grimoire > /dev/null; then
+ error_message "Grimoire $grimoire does not exist!"
+ if query "Do you want to add it?" y; then
+ scribe add $grimoire || exit 13
+ echo
+ else
+ list_remove grimoires $grimoire
+ fi
+ fi
+ done
+ [[ -z $grimoires ]] && message "Using default grimoire selection!\n"
+
+ export OVERRIDE_GRIMOIRES="$grimoires"
+}
+
+#---------------------------------------------------------------------
## 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
diff --git a/var/lib/sorcery/modules/libcodex
b/var/lib/sorcery/modules/libcodex
index db3c248..5ce28fd 100755
--- a/var/lib/sorcery/modules/libcodex
+++ b/var/lib/sorcery/modules/libcodex
@@ -145,7 +145,8 @@ function codex_find_grimoire() {

local cfg_idx
let cfg_idx=0
- for cfg_grimoire in $(codex_get_all_grimoires); do
+ for cfg_grimoire in $(codex_get_all_grimoires) $CODEX_ROOT/*; do
+ [[ -d $cfg_grimoire ]] || continue
# this will be empty if "$foo" matches the glob "*$bar"
match=$(eval echo ${cfg_grimoire%%*$cfg_lookup})
# if empty, echo and succeed



  • [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (3de7e51c25f6dc38dc2c6fe4320a0872e31cdf0b), Jaka Kranjc, 12/29/2008

Archive powered by MHonArc 2.6.24.

Top of Page