hgbook

view contrib/hg-package @ 634:d1a6ed326f87

Add package and upload script
author Dongsheng Song <dongsheng.song@gmail.com>
date Fri Mar 13 16:01:21 2009 +0800 (2009-03-13)
parents
children 1de6cbdcc619
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 (cd ${build_dir}/${l};
9 f='html'
10 if [ -f "${f}/index.html" ] ; then
11 d=hgbook-${l}-${f}
12 rm -fr ${d} && cp -r ${f} ${d} && tar czf ../${d}-${rev_id}.tar.gz ${d}
13 fi
15 f='html-single'
16 if [ -f "${f}/hgbook.html" ] ; then
17 d=hgbook-${l}-${f}
18 rm -fr ${d} && cp -r ${f} ${d} && tar czf ../${d}-${rev_id}.tar.gz ${d}
19 fi
21 if [ -f "pdf/hgbook.pdf" ] ; then
22 cp pdf/hgbook.pdf ../hgbook-${l}-${rev_id}.pdf
23 gzip -f9 ../hgbook-${l}-${rev_id}.pdf
24 fi
25 )
26 done
28 upload_pass=$1
29 upload_user=$2
31 if [ "${upload_user}x" == "x" ]; then
32 upload_user="dongsheng.song"
33 fi
35 if [ "${upload_pass}x" != "x" ]; then
36 (
37 cd ${build_dir}
38 curl -O http://support.googlecode.com/svn/trunk/scripts/googlecode_upload.py
40 for l in en zh; do
41 python googlecode_upload.py -u "dongsheng.song" -w "$1" \
42 -p "i18n-zh" -l "Type-Docs,hgbook" \
43 -s "Distributed revision control with Mercurial - ${l} - pdf" \
44 hgbook-${l}-${rev_id}.pdf.gz
46 for f in html html-single; do
47 python googlecode_upload.py -u "dongsheng.song" -w "$1" \
48 -p "i18n-zh" -l "Type-Docs,hgbook" \
49 -s "Distributed revision control with Mercurial - ${l} - ${f}" \
50 hgbook-${l}-${f}-${rev_id}.tar.gz
51 done
52 done
53 )
54 fi