hgbook

view contrib/hg-package @ 664:4dd63ae7ba87

Remove background images for note/tip/warn
author Dongsheng Song <songdongsheng@live.cn>
date Tue Mar 31 14:53:07 2009 +0800 (2009-03-31)
parents 1de6cbdcc619
children 95391727a7c7
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
31 if [ -f "epub/hgbook.epub" ] ; then
32 cp epub/hgbook.epub ../hgbook-${l}-${rev_id}.epub
33 fi
34 )
35 done
37 upload_pass=$1
38 upload_user=$2
40 # echo "upload_pass: ${upload_pass}"
41 # echo "upload_user: ${upload_user}"
43 if [ "${upload_user}x" == "x" ]; then
44 upload_user="dongsheng.song"
45 fi
47 if [ "${upload_pass}x" != "x" ]; then
48 (
49 cd ${build_dir}
50 curl -s -O http://support.googlecode.com/svn/trunk/scripts/googlecode_upload.py
51 if [[ "0" != $? ]]; then
52 exit 1
53 fi
55 for l in en zh; do
56 if [ -f "hgbook-${l}-${rev_id}.epub" ] ; then
57 python googlecode_upload.py --user="${upload_user}" --password="${upload_pass}" \
58 -p "i18n-zh" -l "Type-Docs,book,hgbook,hg,mercurial,ebook" \
59 -s "Distributed revision control with Mercurial - ${l} - ePub" \
60 hgbook-${l}-${rev_id}.epub
61 fi
63 if [ -f "hgbook-${l}-${rev_id}.pdf.gz" ] ; then
64 python googlecode_upload.py --user="${upload_user}" --password="${upload_pass}" \
65 -p "i18n-zh" -l "Type-Docs,book,hgbook,hg,mercurial" \
66 -s "Distributed revision control with Mercurial - ${l} - pdf" \
67 hgbook-${l}-${rev_id}.pdf.gz
68 fi
70 for f in html html-single; do
71 if [ -f "hgbook-${l}-${f}-${rev_id}.tar.gz" ] ; then
72 python googlecode_upload.py --user="${upload_user}" --password="${upload_pass}" \
73 -p "i18n-zh" -l "Type-Docs,book,hgbook,hg,mercurial" \
74 -s "Distributed revision control with Mercurial - ${l} - ${f}" \
75 hgbook-${l}-${f}-${rev_id}.tar.gz
76 fi
77 done
78 done
79 )
80 fi