Skip to Content.
Sympa Menu

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

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 (cfc8c2d9a36f9761519b6c762b173bfc7ed2408a)
  • Date: Sat, 30 Aug 2008 05:24:46 -0500

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

ChangeLog | 4 ++++
usr/sbin/cast | 19 +++++++++++++++++++
var/lib/sorcery/modules/build_api/api2 | 3 ++-
var/lib/sorcery/modules/build_api/common | 17 +++++++++++++++++
4 files changed, 42 insertions(+), 1 deletion(-)

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

common, api2, cast: duplicate the FINAL outputs at the end of cast,
bug #8830

So, if you have something important to tell to the user, do it in FINAL

diff --git a/ChangeLog b/ChangeLog
index 768e3e7..3e55867 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-08-29 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * common, api2, cast: duplicate the FINAL outputs at the end of cast,
+ bug #8830
+
2008-08-28 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* libhash: added hash_unset_part, the opposite of hash_append
* libdepends: improved the cleanup algorithm further, now also the
diff --git a/usr/sbin/cast b/usr/sbin/cast
index a96186c..747f827 100755
--- a/usr/sbin/cast
+++ b/usr/sbin/cast
@@ -605,6 +605,23 @@ function pass_five() {

debug "cast" "Function : pass_five"
local rc=0
+ local notice_log=$TMP_DIR/notice_log
+
+ if [[ -s $notice_log ]]; then
+ message "$DEFAULT_COLOR"
+ message "${MESSAGE_COLOR}Spell notices are repeated below:"
+ message "-----------------------------------------------$DEFAULT_COLOR"
+ cp $notice_log $CAST_BACKUPDIR
+ if (( $(wc -l < $notice_log) > 40 )); then
+ cat - $notice_log > $notice_log.2 <<< "Spell notices are repeated
below:"
+ mv $notice_log.2 $notice_log
+ timeout_pager $notice_log
+ else
+ cat $notice_log
+ fi
+ message "These notices are backed up to $CAST_BACKUPDIR/notice_log ."
+ message "$DEFAULT_COLOR"
+ fi

# must exist or we get problems with checks here.
touch $SUCCESS_LIST
@@ -862,6 +879,8 @@ elif [ "$UID" -gt 0 ]; then
elif [ ${0:0:5} != "/tmp/" ]; then

# Make a nice dir structure to put stuff in, this exits if it fails
+ mk_tmp_dirs backup /tmp/cast
+ export CAST_BACKUPDIR=$TMP_DIR
mk_tmp_dirs cast

export SAFE_CAST="$TMP_DIR/casting.safe"
diff --git a/var/lib/sorcery/modules/build_api/api2
b/var/lib/sorcery/modules/build_api/api2
index 824a89b..dd6d66b 100755
--- a/var/lib/sorcery/modules/build_api/api2
+++ b/var/lib/sorcery/modules/build_api/api2
@@ -90,7 +90,7 @@ function run_build_spell() {
run_transfer &&
devoke_installwatch &&
STAGED_INSTALL=off &&
- run_final || return 3
+ run_final | append_to_notice_log || return 3
) 2> >(tee -a $C_LOG 1>&2 >> $VOYEUR_STDERR) \
> >(tee -a $C_LOG >> $VOYEUR_STDOUT)
)
@@ -112,6 +112,7 @@ function run_build_spell() {

return 0
}
+
#---------------------------------------------------------------------
## This phase of casting involves unpacking the source into the
## source directories. If a PRE_BUILD file exists in SCRIPT_DIRECTORY
diff --git a/var/lib/sorcery/modules/build_api/common
b/var/lib/sorcery/modules/build_api/common
index b22fecb..4d181ba 100755
--- a/var/lib/sorcery/modules/build_api/common
+++ b/var/lib/sorcery/modules/build_api/common
@@ -445,3 +445,20 @@ function run_spell_failure() {
fi
CAST_EXIT_STATUS=1
}
+
+#---------------------------------------------------------------------
+## Appends the input to the notice log, prepending the spell name as a
+## title, appending a newline and teeing the input back unchanged.
+#---------------------------------------------------------------------
+function append_to_notice_log() {
+ local notice_log=$TMP_DIR/notice_log
+ local tmp_log=$TMP_DIR/tmp_notice_log
+
+ tee $tmp_log
+ if [[ -s $tmp_log ]]; then
+ message "$SPELL_COLOR$SPELL:$DEFAULT_COLOR" >> $notice_log
+ cat $tmp_log >> $notice_log
+ echo >> $notice_log
+ fi
+ rm -f $tmp_log
+}



  • [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (cfc8c2d9a36f9761519b6c762b173bfc7ed2408a), Jaka Kranjc, 08/30/2008

Archive powered by MHonArc 2.6.24.

Top of Page