hgbook

view contrib/hg-package @ 1086:8ce6c7a3ebd2

2.4.3 zh translated finished
author Zhaoping Sun <zhaopingsun@gmail.com>
date Fri Nov 20 08:03:26 2009 -0500 (2009-11-20)
parents 605af0a90e3e
children
line source
1 #!/bin/sh
3 #
4 # Package build results & Upload to i18n-zh
5 #
7 build_dir=`dirname "$0"`/../build
8 rev_id=`hg parents --template '{date|shortdate}' | sed 's/-//g'`
10 for l in en zh it; do
11 (
12 if [ ! -d "${build_dir}/${l}" ] ; then
13 continue
14 fi
16 cd ${build_dir}/${l};
18 f='html'
19 if [ -f "${f}/index.html" ] ; then
20 d=hgbook-${l}-${f}
21 rm -fr ${d} && cp -r ${f} ${d} && tar czf ../${d}-${rev_id}.tar.gz ${d}
22 fi
24 f='html-single'
25 if [ -f "${f}/hgbook.html" ] ; then
26 d=hgbook-${l}-${f}
27 rm -fr ${d} && cp -r ${f} ${d} && tar czf ../${d}-${rev_id}.tar.gz ${d}
28 fi
30 if [ -f "pdf/hgbook.pdf" ] ; then
31 cp pdf/hgbook.pdf ../hgbook-${l}-${rev_id}.pdf
32 gzip -f9 ../hgbook-${l}-${rev_id}.pdf
33 fi
35 if [ -f "epub/hgbook.epub" ] ; then
36 cp epub/hgbook.epub ../hgbook-${l}-${rev_id}.epub
37 fi
38 )
39 done
41 upload_pass=$1
42 upload_user=$2
44 # echo "upload_pass: ${upload_pass}"
45 # echo "upload_user: ${upload_user}"
47 if [ "${upload_user}x" == "x" ]; then
48 upload_user="dongsheng.song"
49 fi
51 if [ "${upload_pass}x" != "x" ]; then
52 (
53 cd ${build_dir}
54 curl -s -O http://support.googlecode.com/svn/trunk/scripts/googlecode_upload.py
55 if [[ "0" != $? ]]; then
56 exit 1
57 fi
59 for l in en zh; do
60 if [ -f "hgbook-${l}-${rev_id}.epub" ] ; then
61 python googlecode_upload.py --user="${upload_user}" --password="${upload_pass}" \
62 -p "i18n-zh" -l "Type-Docs,book,hgbook,hg,mercurial,ebook" \
63 -s "Distributed revision control with Mercurial - ${l} - ePub" \
64 hgbook-${l}-${rev_id}.epub
65 fi
67 if [ -f "hgbook-${l}-${rev_id}.pdf.gz" ] ; then
68 python googlecode_upload.py --user="${upload_user}" --password="${upload_pass}" \
69 -p "i18n-zh" -l "Type-Docs,book,hgbook,hg,mercurial" \
70 -s "Distributed revision control with Mercurial - ${l} - pdf" \
71 hgbook-${l}-${rev_id}.pdf.gz
72 fi
74 for f in html html-single; do
75 if [ -f "hgbook-${l}-${f}-${rev_id}.tar.gz" ] ; then
76 python googlecode_upload.py --user="${upload_user}" --password="${upload_pass}" \
77 -p "i18n-zh" -l "Type-Docs,book,hgbook,hg,mercurial" \
78 -s "Distributed revision control with Mercurial - ${l} - ${f}" \
79 hgbook-${l}-${f}-${rev_id}.tar.gz
80 fi
81 done
82 done
83 )
84 fi