Skip to Content.
Sympa Menu

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

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 (bcdf0150deecbae4454fb6bedf188160921b8564)
  • Date: Sat, 21 Jun 2008 03:53:24 -0500

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

ChangeLog | 5 +++
usr/sbin/scribe | 1
var/lib/sorcery/modules/libqueue | 49
++++++++++++++++++-------------------
var/lib/sorcery/modules/libsorcery | 3 --
4 files changed, 31 insertions(+), 27 deletions(-)

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

libsorcery, scribe: moved a newline from get_new_changes to 2/3 callers

commit cabd963d00dba71276f16948abf76763c392c46c
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

formatting, coloring and spelling fixes in install_queue_history

commit 43e2ec9a08e0ecc4ba30d7ccb327a1ac0058429f
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

libqueue: reformatted push_queue and cleaned up pop_queue

diff --git a/ChangeLog b/ChangeLog
index 0d89676..97ab8de 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-06-21 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * libqueue: reformatted push_queue and cleaned up pop_queue
+ formatting, coloring and spelling fixes in install_queue_history
+ * libsorcery, scribe: moved a newline from get_new_changes to 2/3
callers
+
2008-06-20 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* libsorcery: refactored common code out of queueing functions and
made
does_spell_need_update use the cache method too (a big cast -Z
speedup)
diff --git a/usr/sbin/scribe b/usr/sbin/scribe
index 08a21ae..f5b383a 100755
--- a/usr/sbin/scribe
+++ b/usr/sbin/scribe
@@ -317,6 +317,7 @@ function scribe_add_update_worker() {
else
scribe_reindex $grimoire
message "$grim_name updated!"
+ echo
grimoire_history $grimoire
fi

diff --git a/var/lib/sorcery/modules/libqueue
b/var/lib/sorcery/modules/libqueue
index 9d4cd03..0be9a35 100644
--- a/var/lib/sorcery/modules/libqueue
+++ b/var/lib/sorcery/modules/libqueue
@@ -378,20 +378,21 @@ function list_install_queue() {
#---------------------------------------------------------------------
function install_queue_history() {
local spell
- for spell in `cat $INSTALL_QUEUE`; do
+ # we can't use read, since the loop needs a normal stdin
+ for spell in $(< $INSTALL_QUEUE); do
lock_file "$SPELL_STATUS"
- local date="`grep "^${spell}:" $SPELL_STATUS | cut -d':' -f2`"
+ local date=$(grep "^${spell}:" $SPELL_STATUS | cut -d':' -f2)
unlock_file "$SPELL_STATUS"
- local datedash="`echo "$date" | sed
's,^\(....\)\(..\)\(..\)$,\1-\2-\3,'`"
+ 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
+ if query "Would you like to ${RED}remove $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}"
+ message "${QUERY_COLOR}The spell $SPELL_COLOR$spell$QUERY_COLOR was
removed from $FILE_COLOR$INSTALL_QUEUE$DEFAULT_COLOR."
fi
done
}
@@ -406,33 +407,31 @@ function install_queue_history() {
## line of the queue is removed, and returned.
##
#---------------------------------------------------------------------
-function pop_queue() { (
-
- local ITEM
+function pop_queue() {
+ local item found
local exit_code=0

- esc_str "$2" ITEM
+ esc_str "$2" item
lock_start_transaction "$1" tQUEUE_FILE
- if ! [ -f "$1" ]; then
+ if ! [[ -f $1 ]]; then
exit_code=1
- elif [ -n "$ITEM" ]; then
- grep -v "^$ITEM\$" $1 > $tQUEUE_FILE
+ elif [[ -n $item ]]; then
+ grep -v "^$item\$" $1 > $tQUEUE_FILE
else
- FOUND=`sed -n 1p $1`
+ found=$(sed -n 1p $1)

- if [ -z "$FOUND" ]; then
+ if [[ -z $found ]]; then
exit_code=1
else
- esc_str "$FOUND" FOUND
- grep -v "^$FOUND$" $1 > $tQUEUE_FILE
- echo $FOUND
+ esc_str "$found" found
+ grep -v "^$found$" $1 > $tQUEUE_FILE
+ echo $found
fi
fi
- lock_commit_transaction $1
+ lock_commit_transaction "$1"

return $exit_code
-
-) }
+}

#---------------------------------------------------------------------
## @param queue filename
@@ -443,14 +442,14 @@ function pop_queue() { (
## queue before being added at the end.
##
#---------------------------------------------------------------------
-function push_queue() {
-
- pop_queue "$1" "$2"
+function push_queue() {
local t_file
+
+ pop_queue "$1" "$2"
+
lock_start_transaction "$1" t_file
- echo "$2" >> "$t_file";
+ echo "$2" >> "$t_file"
lock_commit_transaction "$1"
-
}

#---------------------------------------------------------------------
diff --git a/var/lib/sorcery/modules/libsorcery
b/var/lib/sorcery/modules/libsorcery
index 573c1d7..8fa561c 100755
--- a/var/lib/sorcery/modules/libsorcery
+++ b/var/lib/sorcery/modules/libsorcery
@@ -124,6 +124,7 @@ function update_sorcery_scripts() {
message "${MESSAGE_COLOR}Current${SPELL_COLOR}" \
"sorcery-$BRANCH${DEFAULT_COLOR} ${MESSAGE_COLOR}version" \
"${VERSION_COLOR}$SORCERY_VERSION${DEFAULT_COLOR}"
+ echo
sorcery_history
rm $FILENAME
}
@@ -762,7 +763,6 @@ function get_new_changes() {

if [[ "$changelog" ]] ; then
{
- echo
echo "$msg"
echo "$changelog"
echo
@@ -770,7 +770,6 @@ function get_new_changes() {
timeout_pager "$TMP_DIR/pagerdata"
rm $TMP_DIR/pagerdata
else
- echo
echo "$msg"
echo "Nothing new."
echo



  • [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (bcdf0150deecbae4454fb6bedf188160921b8564), Jaka Kranjc, 06/21/2008

Archive powered by MHonArc 2.6.24.

Top of Page