Skip to Content.
Sympa Menu

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

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 (6d8dbb23a89f2212d651d1df30be0b6889f76791)
  • Date: Fri, 28 Mar 2008 13:58:13 -0500

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

ChangeLog | 1 +
var/lib/sorcery/modules/libcast | 20 +++++++++-----------
2 files changed, 10 insertions(+), 11 deletions(-)

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

libcast: reformatted show_download_progress and made it a bit less dumb

diff --git a/ChangeLog b/ChangeLog
index 8ecfcee..13fdefd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,7 @@
* libstate, libtriggers, libsorcery: use esc_str by reference
* liblock: save the escaped string in lock_kill_transaction
* libstate: converted two inline esc_str calls to the forkless version
+ * libcast: reformatted show_download_progress and made it a bit less
dumb

2008-03-27 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* changed uses of plain sort|uniq to the featurewise equivalent sort
-u
diff --git a/var/lib/sorcery/modules/libcast b/var/lib/sorcery/modules/libcast
index 728d1da..0a605af 100755
--- a/var/lib/sorcery/modules/libcast
+++ b/var/lib/sorcery/modules/libcast
@@ -674,28 +674,25 @@ function report_install() {
}

#---------------------------------------------------------------------
-## LC means "line count" why not just type line_count?
## @TODO This function is dumb. It should be fixed.
## @param download log file name
#---------------------------------------------------------------------
function show_download_progress() {
[[ $SCREEN_NAME ]] && return
local download_log=$1
- if [ -e "$download_log" ] &&
- [ -z "$SILENT" ]; then

- LC_OLD=${LC_OLD:-0}
+ if [[ -e $download_log ]] && [[ -z $SILENT ]]; then
+ local line_count
+ line_count_old=${line_count_old:-0}

- LC=`cat $download_log 2>/dev/null | wc -l | tr -d ' '`
+ line_count=$(wc -l < $download_log)

- if [ "$LC" != "$LC_OLD" ]; then
- let LC_OLD++
- sed -n ${LC_OLD},${LC}p $download_log
- LC_OLD=$LC
+ if [[ $line_count != $line_count_old ]]; then
+ let line_count_old++
+ sed -n ${line_count_old},${line_count}p $download_log
+ line_count_old=$line_count
fi
-
fi
-
}

#---------------------------------------------------------------------
@@ -709,6 +706,7 @@ function show_downloading() {

local SPELL=$1
local download_log=$(get_spell_dl_log $SPELL)
+ local line_count_old
debug "cast" "Started show_downloading() on $SPELL from $download_log"

# poke around waiting for downloading to start



  • [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (6d8dbb23a89f2212d651d1df30be0b6889f76791), Jaka Kranjc, 03/28/2008

Archive powered by MHonArc 2.6.24.

Top of Page