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