Mercurial > hgbook
comparison contrib/hg-package @ 733:d1a6ed326f87
Add package and upload script
| author | Dongsheng Song <dongsheng.song@gmail.com> |
|---|---|
| date | Fri, 13 Mar 2009 16:01:21 +0800 |
| parents | |
| children | 1de6cbdcc619 |
comparison
equal
deleted
inserted
replaced
| 732:74da9b315396 | 733:d1a6ed326f87 |
|---|---|
| 1 #!/bin/sh | |
| 2 | |
| 3 build_dir=`dirname "$0"`/../build | |
| 4 rev_id=`hg parents --template '{date|shortdate}' | sed 's/-//g'` | |
| 5 | |
| 6 for l in en zh; do | |
| 7 (cd ${build_dir}/${l}; | |
| 8 | |
| 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 | |
| 14 | |
| 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 | |
| 20 | |
| 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 | |
| 27 | |
| 28 upload_pass=$1 | |
| 29 upload_user=$2 | |
| 30 | |
| 31 if [ "${upload_user}x" == "x" ]; then | |
| 32 upload_user="dongsheng.song" | |
| 33 fi | |
| 34 | |
| 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 | |
| 39 | |
| 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 | |
| 45 | |
| 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 |
