Skip to Content.
Sympa Menu

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

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 (f34a7301742ee11126f817d2b8f5371251a9c5b4)
  • Date: Fri, 11 Apr 2008 07:29:33 -0500

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

ChangeLog | 3 +-
var/lib/sorcery/modules/libsorcery | 43
+++++++++++++------------------------
2 files changed, 18 insertions(+), 28 deletions(-)

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

libsorcery:
made log_list also echo castfs logs
rewrote clean_logs to be more slick and as a result a lot faster
(12x here)

diff --git a/ChangeLog b/ChangeLog
index 0984880..1fddd44 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,8 @@
2008-04-11 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* libressurect: always use the saved version after setting the spell
* libsorcery: rewrote log_list to conform with sorcery standards and
be 50
- times faster
+ times faster; made it also echo castfs logs and echo absolute paths
+ rewrote clean_logs to be more slick and as a result a lot faster

2008-04-10 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* libressurect, libgpg: fixed some comments and error messages
diff --git a/var/lib/sorcery/modules/libsorcery
b/var/lib/sorcery/modules/libsorcery
index 03acf36..3bc3622 100755
--- a/var/lib/sorcery/modules/libsorcery
+++ b/var/lib/sorcery/modules/libsorcery
@@ -1149,10 +1149,12 @@ function log_list() {
local spell version
while read spell version; do
# the install and md5sum logs are not compressed
- echo "$spell-$version"
- # the compile log usually is compressed
+ echo "$INSTALL_LOGS/$spell-$version"
+ echo "$MD5SUM_LOGS/$spell-$version"
+ # the compile and castfs log usually are compressed
# FIXME $EXTENSION may be the wrong one if the user changed it
- echo "$spell-$version$EXTENSION"
+ echo "$COMPILE_LOGS/$spell-$version$EXTENSION"
+ echo "$COMPILE_LOGS/$spell-$version.castfs.dbglog$EXTENSION"
done < <(all_spell_status | cut -d: -f1,4 --output-delimiter=" ")
}

@@ -1163,36 +1165,23 @@ function log_list() {
##
#---------------------------------------------------------------------
function clean_logs() {
-
- message "${CHECK_COLOR}Cleaning log files... ${DEFAULT_COLOR} "
-
debug "libsorcery" "Running clean_logs()"
+ local file

- LOGS=`log_list`
-
- for FILE in `ls $INSTALL_LOGS`; do
- if ! echo -e "$LOGS" | grep -q "^$FILE$"; then
- message "Removing stale log : $INSTALL_LOGS/$FILE "
- rm $INSTALL_LOGS/$FILE
- fi
- done
+ message "${CHECK_COLOR}Cleaning log files...$DEFAULT_COLOR"

- for FILE in `ls $COMPILE_LOGS`; do
- if ! echo -e "$LOGS" | grep -q "^$FILE$"; then
- message "Removing stale log : $COMPILE_LOGS/$FILE "
- rm $COMPILE_LOGS/$FILE
- fi
- done
-
- for FILE in `ls $MD5SUM_LOGS`; do
- if ! echo -e "$LOGS" | grep -q "^$FILE$"; then
- message "Removing stale log : $MD5SUM_LOGS/$FILE "
- rm $MD5SUM_LOGS/$FILE
- fi
+ {
+ # don't try to delete logs of installed spells, as they may not exist
+ # tee duplicates the output, so uniq will filter them out
+ log_list | tee /dev/stdout
+ find $INSTALL_LOGS $MD5SUM_LOGS $COMPILE_LOGS -type f
+ } | sort | uniq -u |
+ while read file; do
+ message "Removing stale log: $file"
+ rm "$file"
done
}

-
#---------------------------------------------------------------------
##
## Updates the activity log.



  • [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (f34a7301742ee11126f817d2b8f5371251a9c5b4), Jaka Kranjc, 04/11/2008

Archive powered by MHonArc 2.6.24.

Top of Page