hgbook

view contrib/hg-package @ 661:65b82a891cf7

Add epub format
author Dongsheng Song <dongsheng.song@gmail.com>
date Tue Mar 31 11:04:18 2009 +0800 (2009-03-31)
parents d1a6ed326f87
children 605af0a90e3e
line source
1 #!/bin/sh
3 build_dir=`dirname "$0"`/../build
4 rev_id=`hg parents --template '{date|shortdate}' | sed 's/-//g'`
6 for l in en zh; do
7 (
8 if [ ! -d "${build_dir}/${l}" ] ; then
9 continue
10 fi
12 cd ${build_dir}/${l};
14 f='html'
15 if [ -f "${f}/index.html" ] ; then
16 d=hgbook-${l}-${f}
17 rm -fr ${d} && cp -r ${f} ${d} && tar czf ../${d}-${rev_id}.tar.gz ${d}
18 fi
20 f='html-single'
21 if [ -f "${f}/hgbook.html" ] ; then
22 d=hgbook-${l}-${f}
23 rm -fr ${d} && cp -r ${f} ${d} && tar czf ../${d}-${rev_id}.tar.gz ${d}
24 fi
26 if [ -f "pdf/hgbook.pdf" ] ; then
27 cp pdf/hgbook.pdf ../hgbook-${l}-${rev_id}.pdf
28 gzip -f9 ../hgbook-${l}-${rev_id}.pdf
29 fi
30 )
31 done
33 upload_pass=$1
34 upload_user=$2
36 if [ "${upload_user}x" == "x" ]; then
37 upload_user="dongsheng.song"
38 fi
40 if [ "${upload_pass}x" != "x" ]; then
41 (
42 cd ${build_dir}
43 curl -s -O http://support.googlecode.com/svn/trunk/scripts/googlecode_upload.py
44 if [[ "0" != $? ]]; then
45 exit 1
46 fi
48 for l in en zh; do
49 if [ -f "hgbook-${l}-${rev_id}.pdf.gz" ] ; then
50 python googlecode_upload.py -u "dongsheng.song" -w "$1" \
51 -p "i18n-zh" -l "Type-Docs,hgbook" \
52 -s "Distributed revision control with Mercurial - ${l} - pdf" \
53 hgbook-${l}-${rev_id}.pdf.gz
54 fi
56 for f in html html-single; do
57 if [ -f "hgbook-${l}-${rev_id}.pdf.gz" ] ; then
58 python googlecode_upload.py -u "dongsheng.song" -w "$1" \
59 -p "i18n-zh" -l "Type-Docs,hgbook" \
60 -s "Distributed revision control with Mercurial - ${l} - ${f}" \
61 hgbook-${l}-${f}-${rev_id}.tar.gz
62 fi
63 done
64 done
65 )
66 fi