hgbook

annotate 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
rev   line source
dongsheng@634 1 #!/bin/sh
dongsheng@634 2
dongsheng@634 3 build_dir=`dirname "$0"`/../build
dongsheng@634 4 rev_id=`hg parents --template '{date|shortdate}' | sed 's/-//g'`
dongsheng@634 5
dongsheng@634 6 for l in en zh; do
dongsheng@634 7 (cd ${build_dir}/${l};
dongsheng@634 8
dongsheng@634 9 f='html'
dongsheng@634 10 if [ -f "${f}/index.html" ] ; then
dongsheng@634 11 d=hgbook-${l}-${f}
dongsheng@634 12 rm -fr ${d} && cp -r ${f} ${d} && tar czf ../${d}-${rev_id}.tar.gz ${d}
dongsheng@634 13 fi
dongsheng@634 14
dongsheng@634 15 f='html-single'
dongsheng@634 16 if [ -f "${f}/hgbook.html" ] ; then
dongsheng@634 17 d=hgbook-${l}-${f}
dongsheng@634 18 rm -fr ${d} && cp -r ${f} ${d} && tar czf ../${d}-${rev_id}.tar.gz ${d}
dongsheng@634 19 fi
dongsheng@634 20
dongsheng@634 21 if [ -f "pdf/hgbook.pdf" ] ; then
dongsheng@634 22 cp pdf/hgbook.pdf ../hgbook-${l}-${rev_id}.pdf
dongsheng@634 23 gzip -f9 ../hgbook-${l}-${rev_id}.pdf
dongsheng@634 24 fi
dongsheng@634 25 )
dongsheng@634 26 done
dongsheng@634 27
dongsheng@634 28 upload_pass=$1
dongsheng@634 29 upload_user=$2
dongsheng@634 30
dongsheng@634 31 if [ "${upload_user}x" == "x" ]; then
dongsheng@634 32 upload_user="dongsheng.song"
dongsheng@634 33 fi
dongsheng@634 34
dongsheng@634 35 if [ "${upload_pass}x" != "x" ]; then
dongsheng@634 36 (
dongsheng@634 37 cd ${build_dir}
dongsheng@634 38 curl -O http://support.googlecode.com/svn/trunk/scripts/googlecode_upload.py
dongsheng@634 39
dongsheng@634 40 for l in en zh; do
dongsheng@634 41 python googlecode_upload.py -u "dongsheng.song" -w "$1" \
dongsheng@634 42 -p "i18n-zh" -l "Type-Docs,hgbook" \
dongsheng@634 43 -s "Distributed revision control with Mercurial - ${l} - pdf" \
dongsheng@634 44 hgbook-${l}-${rev_id}.pdf.gz
dongsheng@634 45
dongsheng@634 46 for f in html html-single; do
dongsheng@634 47 python googlecode_upload.py -u "dongsheng.song" -w "$1" \
dongsheng@634 48 -p "i18n-zh" -l "Type-Docs,hgbook" \
dongsheng@634 49 -s "Distributed revision control with Mercurial - ${l} - ${f}" \
dongsheng@634 50 hgbook-${l}-${f}-${rev_id}.tar.gz
dongsheng@634 51 done
dongsheng@634 52 done
dongsheng@634 53 )
dongsheng@634 54 fi