From 103bee98b792d9a0356dc4738541918d398edef8 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sat, 4 Oct 2008 19:53:41 +0000 Subject: [PATCH] Remotely sync and publish bookmarks in Mozilla format. git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@221 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23 --- bkmk-publish | 21 +++++---------------- bkmk-publish.old | 27 +++++++++++++++++++++++++++ bkmk-rsync | 9 ++++++--- bkmk-rsync.ns | 8 ++++++++ mz2ns | 3 ++- 5 files changed, 48 insertions(+), 20 deletions(-) create mode 100755 bkmk-publish.old create mode 100755 bkmk-rsync.ns diff --git a/bkmk-publish b/bkmk-publish index f64ea3c..4086628 100755 --- a/bkmk-publish +++ b/bkmk-publish @@ -4,24 +4,13 @@ umask 077 PATH=$HOME/lib/bookmarks_db:$PATH STARTDIR="`pwd`" -bkmk-koi -c && \ -mv public-koi.tmp bkmk-koi.html && chmod a+r bkmk-koi.html || exit 1 +db2bkmk.py -p "Private links" -o bookmarks.html || exit 1 echo "Splitting bookmarks..." cd $HOME/Internet/WWW/htdocs/phd.pp.ru/Bookmarks && \ rm -rf split || exit 1 -$HOME/lib/bookmarks_db/hotexplode.pl -o split $STARTDIR/bookmarks.html && \ -cp -p ../../../misc/nopasswd-index.html split/privatelinks/index.html || exit 1 - -cp -p $STARTDIR/bkmk-koi.html bookmarks.html && chmod -R a+rX . || exit 1 - -#/usr/local/htdig/bkmk.sh - -cd $STARTDIR && \ -exec rm -f header bookmarks.err bookmarks_db.pickle bookmarks_db.flad \ - private-win.tmp public-win.tmp bookmarks.html bookmark.ht0 bookmark.ht1 bkmk-koi.html - -#zip -9 bkmk bkmk-koi.html bkmk-win.html && \ -#rm -f bkmk-win.html && \ -#cp -p bookmark.ht1 bkmk-win.html || exit 1 +mv $STARTDIR/bookmarks.html . && \ +hotexplode.pl -o split bookmarks.html && \ +chmod -R a+rX . && \ +exec rm -f bookmarks_db.pickle diff --git a/bkmk-publish.old b/bkmk-publish.old new file mode 100755 index 0000000..f64ea3c --- /dev/null +++ b/bkmk-publish.old @@ -0,0 +1,27 @@ +#! /bin/sh + +umask 077 +PATH=$HOME/lib/bookmarks_db:$PATH + +STARTDIR="`pwd`" +bkmk-koi -c && \ +mv public-koi.tmp bkmk-koi.html && chmod a+r bkmk-koi.html || exit 1 + +echo "Splitting bookmarks..." +cd $HOME/Internet/WWW/htdocs/phd.pp.ru/Bookmarks && \ +rm -rf split || exit 1 + +$HOME/lib/bookmarks_db/hotexplode.pl -o split $STARTDIR/bookmarks.html && \ +cp -p ../../../misc/nopasswd-index.html split/privatelinks/index.html || exit 1 + +cp -p $STARTDIR/bkmk-koi.html bookmarks.html && chmod -R a+rX . || exit 1 + +#/usr/local/htdig/bkmk.sh + +cd $STARTDIR && \ +exec rm -f header bookmarks.err bookmarks_db.pickle bookmarks_db.flad \ + private-win.tmp public-win.tmp bookmarks.html bookmark.ht0 bookmark.ht1 bkmk-koi.html + +#zip -9 bkmk bkmk-koi.html bkmk-win.html && \ +#rm -f bkmk-win.html && \ +#cp -p bookmark.ht1 bkmk-win.html || exit 1 diff --git a/bkmk-rsync b/bkmk-rsync index 2de2b30..cc7034d 100755 --- a/bkmk-rsync +++ b/bkmk-rsync @@ -1,8 +1,11 @@ #! /bin/sh PATH=$HOME/lib/bookmarks_db:$PATH +umask 077 -mz2ns -mv bookmarks.html "$HOME/.netscape/bookmarks.html" +bkmk2db || exit 1 +db2bkmk.py || exit 2 +diff $HOME/.mozilla/bookmarks.html bookmarks.html > diff.out -exec distribute -r .netscape "$HOME/.netscape/bookmarks.html" +distribute -r .mozilla bookmarks.html +exec mv bookmarks.html "$HOME/.mozilla/bookmarks.html" diff --git a/bkmk-rsync.ns b/bkmk-rsync.ns new file mode 100755 index 0000000..2de2b30 --- /dev/null +++ b/bkmk-rsync.ns @@ -0,0 +1,8 @@ +#! /bin/sh + +PATH=$HOME/lib/bookmarks_db:$PATH + +mz2ns +mv bookmarks.html "$HOME/.netscape/bookmarks.html" + +exec distribute -r .netscape "$HOME/.netscape/bookmarks.html" diff --git a/mz2ns b/mz2ns index 451c96e..31a39d4 100755 --- a/mz2ns +++ b/mz2ns @@ -1,12 +1,13 @@ #! /bin/sh PATH=$HOME/lib/bookmarks_db:$PATH +umask 077 bkmk2db || exit 1 -umask 077 BKMK_FORMAT=NETSCAPE db2bkmk.py || exit 2 sed -e 's/<//g' -e 's/"/"/g' -e 's/&/\&/g' \ bookmarks.html >_tmp.$$ && \ mv _tmp.$$ bookmarks.html + exec diff $HOME/.netscape/bookmarks.html bookmarks.html > diff.out -- 2.39.5