Ignore:
Timestamp:
03/23/12 17:21:06 (2 years ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Use setup.py to publish the sources and rotate latest versions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • install-scripts/mac/build-source.sh

    r10508 r10623  
    88# $4 work dir 
    99# $5 distribution name 
     10# $6 source and egg distribution dir ($4 by default) 
     11# $7 force 
    1012# 
    1113# Example ./build-source.sh http://bitbucket.org/biolab/orange orange tip /private/tmp/repos Orange 
     
    1618WORK_DIR=$4 
    1719DIST_NAME=$5 
     20DIST_DIR=${6:-$WORK_DIR} 
     21FORCE=$7 
     22 
     23# dist name with '-' replaced 
     24UDIST_NAME=`echo $DIST_NAME | sed s/-/_/g` 
    1825 
    1926LOCAL_REPO=$WORK_DIR/$REPO_DIRNAME 
    2027 
    21 if [ ! -e $LOCAL_REPO ]; then 
    22     hg clone $HG_REPO $LOCAL_REPO 
     28LATEST_REVISION=`hg id $HG_REPO` 
     29 
     30if [ -e $WORK_DIR/$UDIST_NAME.egg-info/PKG-INFO ]; then 
     31    CURRENT_REVISION=`grep "^Version: " $WORK_DIR/$UDIST_NAME.egg-info/PKG-INFO | cut -d "-" -f 3` 
     32else 
     33    CURRENT_REVISION="" 
    2334fi 
    2435 
    25 if hg incoming -R $LOCAL_REPO; then 
    26     hg pull -R $LOCAL_REPO 
     36if [[ $CURRENT_REVISION != $LATEST_REVISION  || $FORCE ]]; then 
     37    BUILD=1 
     38else 
     39    BUILD= 
    2740fi 
     41echo $BUILD 
    2842 
    29 hg update -r $HG_REV -R $LOCAL_REPO 
     43if [ $BUILD ]; then  
     44    if [ ! -e $LOCAL_REPO ]; then 
     45        hg clone $HG_REPO $LOCAL_REPO 
     46    fi 
    3047 
    31 cd $LOCAL_REPO 
     48    if hg incoming -R $LOCAL_REPO; then 
     49        hg pull -R $LOCAL_REPO 
     50    fi 
    3251 
    33 # Remove old sources 
    34 rm -rf dist/ 
     52    hg update -r $HG_REV -R $LOCAL_REPO 
    3553 
    36 # Build the source distribution 
    37 BUILD_TAG=`hg parent --template=".dev-r{rev}-{node|short}"` 
    38 python setup.py egg_info --tag-build=$BUILD_TAG sdist 
     54    cd $LOCAL_REPO 
    3955 
    40 # Copy the source an egg info to workdir 
    41 cp dist/${DIST_NAME}-*.tar.gz $WORK_DIR 
     56    # Remove old sources 
     57    rm -rf dist/ 
    4258 
    43 UDIST_NAME=`echo $DIST_NAME | sed s/-/_/g` 
    44 cp -r  $UDIST_NAME.egg-info $WORK_DIR 
     59    # Build the source distribution 
     60    BUILD_TAG=`hg parent --template=".dev-r{rev}-{node|short}"` 
    4561 
    46 true 
     62    python setup.py egg_info --tag-build=$BUILD_TAG --egg-base=$DIST_DIR sdist --dist-dir=$DIST_DIR 
     63    python setup.py rotate --match=.tar.gz --dist-dir=$DIST_DIR --keep=20 
     64fi 
Note: See TracChangeset for help on using the changeset viewer.