comparison contrib/hg-package @ 736:1de6cbdcc619

Add some sanity checks
author Dongsheng Song <dongsheng.song@gmail.com>
date Mon, 16 Mar 2009 17:13:50 +0800
parents d1a6ed326f87
children 605af0a90e3e
comparison
equal deleted inserted replaced
735:17fe2fe38373 736:1de6cbdcc619
2 2
3 build_dir=`dirname "$0"`/../build 3 build_dir=`dirname "$0"`/../build
4 rev_id=`hg parents --template '{date|shortdate}' | sed 's/-//g'` 4 rev_id=`hg parents --template '{date|shortdate}' | sed 's/-//g'`
5 5
6 for l in en zh; do 6 for l in en zh; do
7 (cd ${build_dir}/${l}; 7 (
8 if [ ! -d "${build_dir}/${l}" ] ; then
9 continue
10 fi
11
12 cd ${build_dir}/${l};
8 13
9 f='html' 14 f='html'
10 if [ -f "${f}/index.html" ] ; then 15 if [ -f "${f}/index.html" ] ; then
11 d=hgbook-${l}-${f} 16 d=hgbook-${l}-${f}
12 rm -fr ${d} && cp -r ${f} ${d} && tar czf ../${d}-${rev_id}.tar.gz ${d} 17 rm -fr ${d} && cp -r ${f} ${d} && tar czf ../${d}-${rev_id}.tar.gz ${d}
33 fi 38 fi
34 39
35 if [ "${upload_pass}x" != "x" ]; then 40 if [ "${upload_pass}x" != "x" ]; then
36 ( 41 (
37 cd ${build_dir} 42 cd ${build_dir}
38 curl -O http://support.googlecode.com/svn/trunk/scripts/googlecode_upload.py 43 curl -s -O http://support.googlecode.com/svn/trunk/scripts/googlecode_upload.py
44 if [[ "0" != $? ]]; then
45 exit 1
46 fi
39 47
40 for l in en zh; do 48 for l in en zh; do
41 python googlecode_upload.py -u "dongsheng.song" -w "$1" \ 49 if [ -f "hgbook-${l}-${rev_id}.pdf.gz" ] ; then
42 -p "i18n-zh" -l "Type-Docs,hgbook" \ 50 python googlecode_upload.py -u "dongsheng.song" -w "$1" \
43 -s "Distributed revision control with Mercurial - ${l} - pdf" \ 51 -p "i18n-zh" -l "Type-Docs,hgbook" \
44 hgbook-${l}-${rev_id}.pdf.gz 52 -s "Distributed revision control with Mercurial - ${l} - pdf" \
53 hgbook-${l}-${rev_id}.pdf.gz
54 fi
45 55
46 for f in html html-single; do 56 for f in html html-single; do
47 python googlecode_upload.py -u "dongsheng.song" -w "$1" \ 57 if [ -f "hgbook-${l}-${rev_id}.pdf.gz" ] ; then
48 -p "i18n-zh" -l "Type-Docs,hgbook" \ 58 python googlecode_upload.py -u "dongsheng.song" -w "$1" \
49 -s "Distributed revision control with Mercurial - ${l} - ${f}" \ 59 -p "i18n-zh" -l "Type-Docs,hgbook" \
50 hgbook-${l}-${f}-${rev_id}.tar.gz 60 -s "Distributed revision control with Mercurial - ${l} - ${f}" \
61 hgbook-${l}-${f}-${rev_id}.tar.gz
62 fi
51 done 63 done
52 done 64 done
53 ) 65 )
54 fi 66 fi