Source

hgbook / contrib / hg-package

Full commit
Dongsheng Song d1a6ed3 

Dongsheng Song 9539172 



Dongsheng Song d1a6ed3 
Dongsheng Song 3a1bb81 
Dongsheng Song d1a6ed3 
Dongsheng Song bc14358 
Dongsheng Song 1de6cbd 





Dongsheng Song d1a6ed3 
















Dongsheng Song 605af0a 


Dongsheng Song 1ff952a 
Dongsheng Song 605af0a 
Dongsheng Song d1a6ed3 





Dongsheng Song 605af0a 


Dongsheng Song 1ff952a 
Dongsheng Song d1a6ed3 

Dongsheng Song 1de6cbd 



Dongsheng Song d1a6ed3 
Dongsheng Song 39297bc 
Dongsheng Song 1ff952a 
Dongsheng Song 605af0a 


Dongsheng Song 1ff952a 
Dongsheng Song 605af0a 

Dongsheng Song 1de6cbd 
Dongsheng Song 605af0a 

Dongsheng Song 1de6cbd 


Dongsheng Song d1a6ed3 

Dongsheng Song 605af0a 


Dongsheng Song 1de6cbd 


Dongsheng Song d1a6ed3 


#!/bin/sh

#
# Package build results & Upload to i18n-zh
#

build_dir=`dirname "$0"`/../build
rev_id=`hg parents --template '{date|shortdate}' | sed 's/-//g'`-`hg parents --template '{node|short}'`

for l in en fr it zh; do
  (
  if [ ! -d "${build_dir}/${l}" ] ; then
    continue
  fi

  cd ${build_dir}/${l};

  f='html'
  if [ -f "${f}/index.html" ] ; then
     d=hgbook-${l}-${f}
     rm -fr ${d} && cp -r ${f} ${d} && tar czf ../${d}-${rev_id}.tar.gz ${d}
  fi

  f='html-single'
  if [ -f "${f}/hgbook.html" ] ; then
     d=hgbook-${l}-${f}
     rm -fr ${d} && cp -r ${f} ${d} && tar czf ../${d}-${rev_id}.tar.gz ${d}
  fi

  if [ -f "pdf/hgbook.pdf" ] ; then
     cp pdf/hgbook.pdf ../hgbook-${l}-${rev_id}.pdf
     gzip -f9 ../hgbook-${l}-${rev_id}.pdf
  fi

  if [ -f "epub/hgbook.epub" ] ; then
     cp epub/hgbook.epub ../hgbook-${l}-${rev_id}.epub
     gzip -f9 ../hgbook-${l}-${rev_id}.epub
  fi
  )
done

upload_pass=$1
upload_user=$2

# echo "upload_pass: ${upload_pass}"
# echo "upload_user: ${upload_user}"

if [ "${upload_pass}x" != "x" ] && [ "${upload_user}x" != "x" ]; then
  (
  cd ${build_dir}
  curl -s -O http://support.googlecode.com/svn/trunk/scripts/googlecode_upload.py
  if [[ "0" != $? ]]; then
    exit 1
  fi

  for l in en fr it zh; do
    if [ -f "hgbook-${l}-${rev_id}.epub.gz" ] ; then
      python googlecode_upload.py --user="${upload_user}" --password="${upload_pass}" \
          -p "i18n-zh" -l "Type-Docs,book,hgbook,hg,mercurial,ebook" \
          -s "Distributed revision control with Mercurial - ${l} - ePub" \
          hgbook-${l}-${rev_id}.epub.gz
    fi

    if [ -f "hgbook-${l}-${rev_id}.pdf.gz" ] ; then
      python googlecode_upload.py --user="${upload_user}" --password="${upload_pass}" \
          -p "i18n-zh" -l "Type-Docs,book,hgbook,hg,mercurial" \
          -s "Distributed revision control with Mercurial - ${l} - pdf" \
          hgbook-${l}-${rev_id}.pdf.gz
    fi

    for f in html html-single; do
      if [ -f "hgbook-${l}-${f}-${rev_id}.tar.gz" ] ; then
        python googlecode_upload.py --user="${upload_user}" --password="${upload_pass}" \
            -p "i18n-zh" -l "Type-Docs,book,hgbook,hg,mercurial" \
            -s "Distributed revision control with Mercurial - ${l} - ${f}" \
            hgbook-${l}-${f}-${rev_id}.tar.gz
      fi
    done
  done
  )
fi