update.sh doesn't work in 0.9. update.sh is used to synchronise an SVN
version of the book with the DocBookWiki version. The problem seems to
be with a change to explode.sh, which used to explode the SVN version of
the book into books/$book_id, but now it only explodes it into
explode/tmp/$book_id and just leaves it there. update.sh doesn't look
in explode/tmp/$book_id.
To revert the behaviour of explode.sh would break import.sh, so I am
patching update.sh instead. Here is a patch to explode.sh to do two things:
(a) To fix the bug described above.
(b) To enable update.sh to work where there are new sections added to
the SVN version that weren't previously in the DocBookWiki version.
--
Jeremy Malcolm LLB (Hons) B Com
Internet and Open Source lawyer, IT consultant, actor
host -t NAPTR 1.0.8.0.3.1.2.9.8.1.6.e164.org|awk -F! '{print $3}'
--- update.sh.dist 2007-05-09 15:18:32.000000000 +0800
+++ update.sh 2007-05-11 16:55:40.000000000 +0800
@@ -23,6 +23,7 @@
media=$svn_dir/media/$book_id/$lng/
book_dir=../books/xml/$book_id/$lng/
ws_book_dir=../workspace/xml/$book_id/$lng/
+tmp_dir=../explode/tmp/$book_id
### update xml_file
echo "Updating '$xml_file'"
@@ -31,6 +32,28 @@
### explode in the public space
../explode/explode.sh SVN/$xml_file
+### copy index.xml and the xml chunks from $tmp_dir to $book_dir
+if [ -d $book_dir ]
+then
+ find $book_dir -name content.xml -exec rm {} \;
+else
+ mkdir -p $book_dir
+fi
+cp -f $tmp_dir/index.xml $book_dir
+files=$(cd $tmp_dir; find . -name content.xml)
+tar -C $tmp_dir/ -c $files | tar -C $book_dir -xf -
+
+### check for the addition of new sections
+TMP=/tmp/docbookwiki_$$
+mkdir $TMP
+find $ws_book_dir -printf %P\\n | sort > $TMP/workspacedir.txt
+find $book_dir -printf %P\\n | sort > $TMP/svndir.txt
+diff -u $TMP/workspacedir.txt $TMP/svndir.txt | grep ^+ | sed 's/.//' | grep
chapter > $TMP/svnadd.txt
+while read i
+ do svn add $book_dir/$i
+done < $TMP/svnadd.txt
+rm -rf $TMP
+
### update media files
echo "Updating '$media'"
svn update $media
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Doc-book-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/doc-book-users