Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to test-1.13 sorcery by Andrew Stitt

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Andrew Stitt <scm AT mail.sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to test-1.13 sorcery by Andrew Stitt
  • Date: Sun, 28 May 2006 17:51:08 -0500

GIT changes to test-1.13 sorcery by Andrew Stitt <astitt AT sourcemage.org>:

ChangeLog | 3 ++
usr/sbin/cast | 72
+++++++++++++++++++++++++++++-----------------------------
2 files changed, 40 insertions(+), 35 deletions(-)

New commits:
commit 76d385689d4f3549fef817bad4204f5c62230331
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
(cherry picked from ee80631dbd1695bf18fd00a205ec128ec339d469 commit)

diff --git a/ChangeLog b/ChangeLog
index 23e56e9..cf2ef4d 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-23 Andrew Stitt <astitt AT sourcemage.org>
diff --git a/usr/sbin/cast b/usr/sbin/cast
index e73cfe8..9c39ec2 100755
--- a/usr/sbin/cast
+++ b/usr/sbin/cast
@@ -71,10 +71,6 @@ ## @Globals DEPS_ONLY RECONFIGURE COMPIL
## @Globals FORCE_DOWNLOAD SOURCE_CACHE SILENT FIX NOFIX 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() {

@@ -104,36 +100,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

@@ -682,6 +649,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"

}
@@ -745,7 +724,30 @@ 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")
+ 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

for spell in $SPELLS ; do
codex_does_spell_exist $spell




Archive powered by MHonArc 2.6.24.

Top of Page