Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/scripts


Modified Files:
        e_cache_clean e_cache_query 


Log Message:
Make cache_clear/query all actually clear/query all caches (img was missing).

===================================================================
RCS file: /cvs/e/e16/e/scripts/e_cache_clean,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- e_cache_clean       13 Jan 2007 19:14:26 -0000      1.17
+++ e_cache_clean       7 Aug 2008 23:25:53 -0000       1.18
@@ -3,6 +3,7 @@
 # cleans up parts of your enlightenment cache                                #
 #
 # Copyright (C) 1999-2007 Carsten Haitzler, Geoff Harrison and various 
contributors
+# Copyright (C) 2008 Kim Woelders
 # 
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to
@@ -24,39 +25,36 @@
 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 ##############################################################################
 
-PATH=$PATH:$EBIN:$EROOT/scripts
+PATH=$PATH:$EBIN
 export PATH
 
-if [ $# -lt 1 ]; then
-  echo "usage:"
-  echo "    "$0" [ all | pager | bgsel | config ]"
-  exit
-fi
-
-if [ $1 = "all" ]; then
-  rm -rf $ECACHEDIR/cached/*/* >/dev/null 2>&1
-  rm -rf $ECACHEDIR/cached/*/.* >/dev/null 2>&1
-  eesh -e "dialog_ok All caches purged."
-  exit
-fi
+case "x$1" in
+xall)
+  dir="*"
+  txt="All caches"
+  ;;
+
+xbgsel)
+  dir=bgsel
+  txt="Background selector cache"
+  ;;
+
+xconfig)
+  dir=cfg
+  txt="Config file cache"
+  ;;
+
+xpager)
+  dir=pager
+  txt="Pager background cache"
+  ;;
 
-if [ $1 = "pager" ]; then
-  rm -rf $ECACHEDIR/cached/pager/* >/dev/null 2>&1
-  rm -rf $ECACHEDIR/cached/pager/.* >/dev/null 2>&1
-  eesh -e "dialog_ok Pager background cache purged."
-  exit
-fi
-
-if [ $1 = "config" ]; then
-  rm -rf $ECACHEDIR/cached/cfg/* >/dev/null 2>&1
-  rm -rf $ECACHEDIR/cached/cfg/.* >/dev/null 2>&1
-  eesh -e "dialog_ok Config file cache purged."
+*)
+  echo "usage:"
+  echo "    "$0" [ all | bgsel | config | pager ]"
   exit
-fi
+  ;;
+esac
 
-if [ $1 = "bgsel" ]; then
-  rm -rf $ECACHEDIR/cached/bgsel/* >/dev/null 2>&1
-  rm -rf $ECACHEDIR/cached/bgsel/.* >/dev/null 2>&1
-  eesh -e "dialog_ok Background selector cache purged."
-  exit
-fi
+rm -rf $ECACHEDIR/cached/$dir/* $ECACHEDIR/cached/$dir/.* >/dev/null 2>&1
+eesh -e "dialog_ok $txt purged."
===================================================================
RCS file: /cvs/e/e16/e/scripts/e_cache_query,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- e_cache_query       13 Jan 2007 19:14:26 -0000      1.13
+++ e_cache_query       7 Aug 2008 23:25:53 -0000       1.14
@@ -3,6 +3,7 @@
 # queries sizes of your enlightenment cache                                  #
 #
 # Copyright (C) 1999-2007 Carsten Haitzler, Geoff Harrison and various 
contributors
+# Copyright (C) 2008 Kim Woelders
 # 
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to
@@ -24,39 +25,36 @@
 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 ##############################################################################
 
-PATH=$PATH:$EBIN:$EROOT/scripts
+PATH=$PATH:$EBIN
 export PATH
 
-if [ $# -lt 1 ]; then
-  echo "usage:"
-  echo "    "$0" [ all | pager | bgsel | config ]"
-  exit
-fi
-
-if [ $1 = "all" ]; then
-  VAL=`du -s $ECACHEDIR/cached/pager $ECACHEDIR/cached/bgsel 
$ECACHEDIR/cached/cfg | awk '{printf("%s ", $1);}'`
-  TOT=0
-  for I in $VAL; do
-    let TOT=$(($TOT + $I));
-  done
-  eesh -e "dialog_ok Your caches are using $TOT Kb of disk space."
-  exit
-fi
+case "x$1" in
+xall)
+  dir=""
+  txt="Your caches are using"
+  ;;
+
+xbgsel)
+  dir=bgsel
+  txt="Your background selector cache is using"
+  ;;
+
+xconfig)
+  dir=cfg
+  txt="Your config file cache is using"
+  ;;
+
+xpager)
+  dir=pager
+  txt="Your pager background cache is using"
+  ;;
 
-if [ $1 = "pager" ]; then
-  VAL=`du -s $ECACHEDIR/cached/pager | awk '{printf("%s", $1);}'`
-  eesh -e "dialog_ok Your pager background cache is using $VAL Kb of disk 
space."
-  exit
-fi
-
-if [ $1 = "config" ]; then
-  VAL=`du -s $ECACHEDIR/cached/cfg | awk '{printf("%s", $1);}'`
-  eesh -e "dialog_ok Your config file cache is using $VAL Kb of disk space."
+*)
+  echo "usage:"
+  echo "    "$0" [ all | bgsel | config | pager ]"
   exit
-fi
+  ;;
+esac
 
-if [ $1 = "bgsel" ]; then
-  VAL=`du -s $ECACHEDIR/cached/bgsel | awk '{printf("%s", $1);}'`
-  eesh -e "dialog_ok Your background selector cache is using $VAL Kb of disk 
space."
-  exit
-fi
+val=`du -s $ECACHEDIR/cached/$dir | awk '{printf("%s", $1);}'`
+eesh -e "dialog_ok $txt $val Kb of disk space."



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to