Update of /cvsroot/gtkpod/gtkpod/scripts
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv29695/scripts

Modified Files:
        sync-evocalendar.sh 
Log Message:
        * scripts/sync-evocalendar.sh: new option for adding a filter
          script. Thanks to Clarke Brunsdon for the patch.



Index: sync-evocalendar.sh
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/scripts/sync-evocalendar.sh,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- sync-evocalendar.sh 8 Mar 2006 13:15:34 -0000       1.3
+++ sync-evocalendar.sh 22 Oct 2006 05:24:52 -0000      1.4
@@ -6,11 +6,15 @@
 # 
 # sync-evocalendar.sh [-i <ipod mountpoint>] [-e <encoding>]
 #           ...       [-c <evolution calendar file>] [-t <evolution tasks 
file>]
+#           ...       [-f <ical filter script>]
 #
 # with the following defaults: 
 
 IPOD_MOUNT=/mnt/ipod                          # mountpoint of ipod
 
+#the path to a script that will be passed the ical information from STDIN and 
filter, if needed
+#FILTER_SCRIPT=
+
 #get all the local evolution calendars
 CALFILES=`find ~/.evolution/calendar/local/ -name "calendar.ics"`
 
@@ -78,7 +82,8 @@
         c) CALFILES=$OPTARG;;
         t) TASKFILES=$OPTARG;;
         e) ENCODING=$OPTARG;;
-        \?) echo "Usage: `basename $0` [-i <ipod mountpoint>] [-c <evolution 
calendar file>] [-t <evolution tasks file>] [-e <encoding>]"
+        f) FILTER=$OPTARG;;
+               \?) echo "Usage: `basename $0` [-i <ipod mountpoint>] [-c 
<evolution calendar file>] [-t <evolution tasks file>] [-f <filter script>] [-e 
<encoding>]"
            exit 1;;
     esac
 done
@@ -91,6 +96,11 @@
     RECODE="iconv -f UTF-8 -t $ENCODING"
 fi
 
+if [ $FILTER_SCRIPT ]; then
+       FILTER=$FILTER_SCRIPT
+else
+       FILTER="cat"
+fi
 
 # check if CALFILES exist
 for i in $CALFILES; do
@@ -110,8 +120,8 @@
 
 echo $CALFILES
 echo $TASKFILES
-sleep 30
+
 # remove all empty lines and recode if necessary
 echo -n "Syncing iPod ... [Calendar] "
-       cat $CALFILES $TASKFILES | grep -v '^[[:space:]]$\|^$' | $RECODE > 
$IPOD_MOUNT/Calendars/evolution
+       cat $CALFILES $TASKFILES | grep -v '^[[:space:]]$\|^$' | $FILTER |  
$RECODE > $IPOD_MOUNT/Calendars/evolution
 echo "done!"


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to