sm-commit AT lists.ibiblio.org
Subject: Source Mage code commit list
List archive
- From: scm AT mail.sourcemage.org
- To: sm-commit AT lists.ibiblio.org
- Subject: [SM-Commit] GIT changes to devel sorcery by
- Date: Sun, 28 May 2006 17:50:06 -0500
GIT changes to devel sorcery by <>:
ChangeLog | 3 ++
usr/sbin/cast | 71
++++++++++++++++++++++++++++++----------------------------
2 files changed, 40 insertions(+), 34 deletions(-)
New commits:
commit 5a371c49ac907f82095a9a64fb61fcaac293afc8
Merge: 62f6edd... ee80631...
Author: Andrew Stitt <astitt AT sourcemage.org>
Commit: Andrew Stitt <astitt AT sourcemage.org>
Merge branch '11740'
Conflicts:
ChangeLog
commit ee80631dbd1695bf18fd00a205ec128ec339d469
Author: Andrew Stitt <astitt AT sourcemage.org>
Commit: Andrew Stitt <astitt AT sourcemage.org>
factor cast --queue code out of argument parsing, doing this fixes the
return code issues
diff --git a/ChangeLog b/ChangeLog
index f733a6e..1ca03c7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
2006-05-28 Andrew Stitt <astitt AT sourcemage.org>
+ * cast: factor cast --queue code out of argument parsing, fixed bug
11740
+
+2006-05-28 Andrew Stitt <astitt AT sourcemage.org>
* libcast: fix bug 11902, conflicts are broken for multi-spell
conflicts
2006-05-28 Andrew Stitt <astitt AT sourcemage.org>
diff --git a/usr/sbin/cast b/usr/sbin/cast
index 33c6f4f..4038a4c 100755
--- a/usr/sbin/cast
+++ b/usr/sbin/cast
@@ -88,10 +88,6 @@ ## @Globals DEPS_ONLY RECONFIGURE COMPIL
## @Globals FORCE_DOWNLOAD SOURCE_CACHE SILENT SEPARATE
## @Globals BASE_URL INSTALL_QUEUE
##
-## Sets these globals except INSTALL_QUEUE according to cast's
-## arguments.
-## Requires some user interaction if --queue is given and starts
-## another cast with INSTALL_QUEUE's content as parameter.
#---------------------------------------------------------------------
function process_parameters() {
@@ -127,36 +123,7 @@ function process_parameters() {
-s) export SEPARATE="$1"; shift 1
;;
--url) export BASE_URL="$2"; shift 2
;;
--pam) cast -c `find_pam_aware` ; shift 1
;;
- --queue)
- if query "Would you like review the queue history for
each spell?" n ; then
- sorcery review-queue
- fi
-
- if [ -s $INSTALL_QUEUE ]; then
- message -n "${MESSAGE_COLOR}Casting install
queue..."
- message "${DEFAULT_COLOR}"
-
- # remove possible empty lines from queue.
- grep -Ev '^$' $INSTALL_QUEUE >"$INSTALL_QUEUE.new"
- rm -f "$INSTALL_QUEUE"
- mv "$INSTALL_QUEUE.new" "$INSTALL_QUEUE"
-
- # cast the queue.
- # SILENT and RECONFIGURE may be empty, they
- # must be at the end or it will confuse parameter
- # parsing
- cast -c `cat $INSTALL_QUEUE 2>/dev/null` "$SILENT"
"$RECONFIGURE"
-
- # report spells still in queue.
- if [ -s $INSTALL_QUEUE ] ; then
- message "${MESSAGE_COLOR}The install queue is not
empty, "
- message "it still contains the following spells: "
- message
"---------------------------------${PROBLEM_COLOR}"
- message "`cat $INSTALL_QUEUE 2>/dev/null`"
- message "${DEFAULT_COLOR}"
- fi
- fi;
- shift 1 ;;
+ --queue) CAST_QUEUE=yes ; COMPILE=$1; shift 1
;;
*) help ;;
esac
@@ -731,6 +698,18 @@ function pass_five() {
fi
+ if [[ "$CAST_QUEUE" == "yes" ]] ; then
+ if [ -s $INSTALL_QUEUE ] ; then
+ message "${MESSAGE_COLOR}The install queue is not empty, "
+ message "it still contains the following spells: "
+ message "---------------------------------${PROBLEM_COLOR}"
+ for item in `cat $INSTALL_QUEUE 2>/dev/null`; do
+ message "$item"
+ done | column
+ message "${DEFAULT_COLOR}"
+ return 1
+ fi
+ fi
debug "cast" "End of pass_five"
}
@@ -796,6 +775,30 @@ function main() {
process_parameters "$@"
SPELLS=`strip_parameters "$@"`
+ if [[ "$CAST_QUEUE" == yes ]] ; then
+
+ touch "$INSTALL_QUEUE"
+ local tfile=$(lock_start_transaction "$INSTALL_QUEUE")
+ grep -Ev '^$' $INSTALL_QUEUE > $tfile
+ lock_commit_transaction "$INSTALL_QUEUE"
+ if [ -s $INSTALL_QUEUE ]; then
+ message -n "${MESSAGE_COLOR}Casting install queue..."
+ message "${DEFAULT_COLOR}"
+
+ # remove possible empty lines from queue.
+ if query "Would you like review the queue history for each spell?" n ;
then
+ sorcery review-queue
+ fi
+
+ SPELLS=$(<$INSTALL_QUEUE)
+ else
+ message "${MESSAGE_COLOR}Install queue is empty${DEFAULT_COLOR}"
+ exit
+ fi
+ else
+ SPELLS=`strip_parameters "$@"`
+ fi
+
if [[ $OVERRIDE_GRIMOIRES ]] ; then
codex_set_grimoires $OVERRIDE_GRIMOIRES
fi
-
[SM-Commit] GIT changes to devel sorcery by,
scm, 05/28/2006
- <Possible follow-up(s)>
- [SM-Commit] GIT changes to devel sorcery by, scm, 05/28/2006
- [SM-Commit] GIT changes to devel sorcery by, scm, 05/28/2006
- [SM-Commit] GIT changes to devel sorcery by, scm, 05/28/2006
Archive powered by MHonArc 2.6.24.