Revision: 1957
http://gtkpod.svn.sourceforge.net/gtkpod/?rev=1957&view=rev
Author: jcsjcs
Date: 2008-04-10 07:08:43 -0700 (Thu, 10 Apr 2008)
Log Message:
-----------
* scripts/sync-tomboy.sh
(Olivier Crete <tester at tester dot ca>):
Strip all tomboy tags with the power of sed
Modified Paths:
--------------
gtkpod/trunk/ChangeLog
gtkpod/trunk/scripts/sync-tomboy.sh
Modified: gtkpod/trunk/ChangeLog
===================================================================
--- gtkpod/trunk/ChangeLog 2008-04-09 23:58:16 UTC (rev 1956)
+++ gtkpod/trunk/ChangeLog 2008-04-10 14:08:43 UTC (rev 1957)
@@ -1,5 +1,11 @@
2008-04-09 Jorg Schuler <jcsjcs at users.sourceforge.net>
+ * scripts/sync-tomboy.sh
+ (Olivier Crete <tester at tester dot ca>):
+ Strip all tomboy tags with the power of sed
+
+2008-04-09 Jorg Schuler <jcsjcs at users.sourceforge.net>
+
* src/file_convert.c (transfer_transfer_track): removed
unnecessary g_mutex_unlock(). Thanks to Klaus Heinz.
Modified: gtkpod/trunk/scripts/sync-tomboy.sh
===================================================================
--- gtkpod/trunk/scripts/sync-tomboy.sh 2008-04-09 23:58:16 UTC (rev 1956)
+++ gtkpod/trunk/scripts/sync-tomboy.sh 2008-04-10 14:08:43 UTC (rev 1957)
@@ -77,6 +77,9 @@
# Corrections By Oliver Sherouse <oliver.sherouse AT gmail DOT com>
# (replaced some arithmetic expressions, improved conversion, correctly
# indicate "-d" in 'usage' instead of "-p")
+#
+# 2008/04/06 (Olivier Crete <tester at tester dot ca>):
+# Strip all tomboy tags with the power of sed
# overwrite default settings with optional command line arguments
while getopts i:d:e: option; do
@@ -137,23 +140,14 @@
START=`echo $LIMITS | cut -d " " -f 1`
END=`echo $LIMITS | cut -d " " -f 2`
- DATA=`cat "$FILE"`
-
- # Strip the tomboy stuff :(
- for i in "<\/note-content>" "<\/text>" "<link:broken>"
"<\/link:broken>" "<link:internal>" "<\/link:internal>" "<link:external>"
"<\/link:external>" "<\/list>" "<list>" "<\/list-item>" "<list-item
dir=\"ltr\">"; do
- DATA=`printf "$DATA" | sed "s/$i//g"`
- done
-
# Get the notes titles, we can use this as the filename
- TITLE=`echo "$DATA" | cut -d "
-" -f $START | cut -d ">" -f 3 | tr : -`
+ TITLE=`cat "$FILE" | grep '<title>.*</title>' | sed -e
's:.*<title>\(.*\)</title>.*:\1:' | sed -e 's/<[^>]*>//g' -e 's/:/-/g'`
- # Get the Lines with the useful data
- DATA=`echo "$DATA" | cut -d "
-" -f $(( $START + 2 ))-$END`
+ cat "$FILE" | tail -n +2 | sed -e '/<\/note-content>/ Q' \
+ -e '/^[[:space:]]*<title>.*<\/title>[[:space:]]*$/ d' \
+ -e '/^[[:space:]]*<[^>]*>[[:space:]]*$/ d' \
+ -e 's/<[^>]*>//g' | $RECODE > "$IPOD_MOUNT/Notes/$TITLE"
- printf "$DATA" | $RECODE > "$IPOD_MOUNT/Notes/$TITLE"
-
read FILE
done
echo
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2