Ignore:
Timestamp:
03/16/12 15:10:00 (2 years ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
rebase_source:
dd2bda2c032bede440d9ef9642276bb76a021049
Message:

Updated dailyrun scripts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • install-scripts/mac/dailyrun-finkonly.sh

    r8096 r10556  
    1 #!/bin/bash 
     1#!/bin/bash -e 
    22# 
    3 # Should be run as: sudo ./dailyrun-finkonly.sh 
    4 # 
     3# $1 workdir 
     4# $2 force 
     5# $3 local 
     6 
     7WORK_DIR=${1:-"/private/tmp"} 
     8FORCE=$2 
     9LOCAL=$3 
    510 
    611test -r /sw/bin/init.sh && . /sw/bin/init.sh 
     12 
     13export PATH=$HOME/bin:$PATH 
     14 
     15if [ $LOCAL ]; then 
     16    PUBLISH_DIR=$WORK_DIR/download 
     17    LOG_DIR=$WORK_DIR/logs 
     18    mkdir -p $PUBLISH_DIR 
     19    mkdir -p $LOG_DIR 
     20else 
     21    PUBLISH_DIR=/Volumes/download 
     22    LOG_DIR=/Volumes/download/buildLogs/osx 
     23fi 
     24 
     25if [ ! -e $WORK_DIR ]; then 
     26    mkdir -p $WORK_DIR 
     27fi 
     28 
     29SOURCES_DIR=$PUBLISH_DIR/sources 
     30 
     31# Get versions from PKG-INFO files (these are updated by dailyrun-sources.sh) 
     32ORANGE_VERSION=`grep "^Version:" $SOURCES_DIR/Orange.egg-info/PKG-INFO | cut -d " " -f 2` 
     33BIOINFORMATICS_VERSION=`grep "^Version:" $SOURCES_DIR/Orange_Bioinformatics.egg-info/PKG-INFO | cut -d " " -f 2` 
     34TEXT_VERSION=`grep "^Version:" $SOURCES_DIR/Orange_Text_Mining.egg-info/PKG-INFO | cut -d " " -f 2` 
     35 
     36 
     37# Source filenames 
     38ORANGE_SOURCE="Orange-${ORANGE_VERSION}.tar.gz" 
     39BIOINFORMATICS_SOURCE="Orange-Bioinformatics-${BIOINFORMATICS_VERSION}.tar.gz" 
     40TEXT_SOURCE="Orange-Text-Mining-${TEXT_VERSION}.tar.gz" 
     41 
     42 
     43# Get source packages md5 checksum 
     44ORANGE_SOURCE_MD5=`md5 -q $SOURCES_DIR/$ORANGE_SOURCE` 
     45BIOINFORMATICS_SOURCE_MD5=`md5 -q $SOURCES_DIR/$BIOINFORMATICS_SOURCE` 
     46TEXT_SOURCE_MD5=`md5 -q $SOURCES_DIR/$TEXT_SOURCE` 
    747 
    848MAC_VERSION=`sw_vers -productVersion | cut -d '.' -f 2` 
    949ARCH=`perl -MFink::FinkVersion -e 'print Fink::FinkVersion::get_arch'` 
    1050 
    11 defaults write com.apple.desktopservices DSDontWriteNetworkStores true 
    1251 
    13 /Users/ailabc/mount-dirs.sh || { echo "Mounting failed." ; exit 1 ; } 
     52FINK_ROOT=/sw 
    1453 
    15 /Users/ailabc/fink-daily-build.sh &> /private/tmp/fink-daily-build.log 
    16 EXIT_VALUE=$? 
     54if [ ! $LOCAL ]; then 
     55    # Compare with the published info files 
     56    BASE="http://orange.biolab.si/fink/dists/$ARCH/main/finkinfo" 
     57else 
     58    # Compare with the local info files 
     59    BASE="file://$FINK_ROOT/fink/dists/local/main/finkinfo" 
     60fi 
    1761 
    18 /Users/ailabc/mount-dirs.sh || { echo "Mounting failed." ; exit 1 ; } 
     62OLD_ORANGE_VERSION=`curl --silent $BASE/orange-gui-hg-py.info | grep "Version: " | cut -d" " -f 2` 
     63OLD_BIOINFORMATICS_VERSION=`curl --silent $BASE/orange-bioinformatics-gui-hg-py.info | grep "Version: " | cut -d" " -f 2` 
     64OLD_TEXT_VERSION=`curl --silent $BASE/orange-text-gui-hg-py.info | grep "Version: " | cut -d" " -f 2` 
    1965 
    20 echo "Orange (fink $MAC_VERSION $ARCH) [$EXIT_VALUE]" > "/Volumes/download/buildLogs/osx/fink-$MAC_VERSION-$ARCH-daily-build.log" 
    21 date >> "/Volumes/download/buildLogs/osx/fink-$MAC_VERSION-$ARCH-daily-build.log" 
    22 cat /private/tmp/fink-daily-build.log >> "/Volumes/download/buildLogs/osx/fink-$MAC_VERSION-$ARCH-daily-build.log" 
    23 (($EXIT_VALUE)) && echo "Running fink-daily-build.sh failed" 
     66if [[ $OLD_ORANGE_VERSION < ORANGE_VERSION ]]; then 
     67    NEW_ORANGE=1 
     68fi 
     69 
     70if [[ $OLD_BIOINFORMATICS_VERSION < BIOINFORMATICS_VERSION ]]; then 
     71    NEW_BIOINFORMATICS=1 
     72fi 
     73 
     74if [[ $OLD_TEXT_VERSION < TEXT_VERSION ]]; then 
     75    NEW_TEXT=1 
     76fi 
     77 
     78# Base url for sources in fink .info files 
     79if [ $LOCAL ]; then 
     80    BASE_URL="file://$PUBLISH_DIR/sources" 
     81else 
     82    BASE_URL="http://orange.biolab.si/download/sources" 
     83fi 
     84 
     85# Update the local finkinfo  
     86# Local info files will be moved to biolab/main/finkinfo in fink-daily-build-packages.sh 
     87FINK_INFO_DIR="$FINK_ROOT/fink/dists/local/main/finkinfo" 
     88 
     89if [ ! -e $FINK_INFO_DIR ]; then 
     90    mkdir -p $FINK_INFO_DIR 
     91fi 
     92 
     93# Directory where fink .info templates are 
     94FINK_TEMPLATES=$WORK_DIR/repos/orange/install-scripts/mac/fink 
     95 
     96FINK_LOG=$WORK_DIR/fink-daily-build.log 
     97 
     98echo "" > $FINK_LOG 
     99 
     100if [[ $NEW_ORANGE || $FORCE ]]; then 
     101    FINK_ORANGE_SOURCE_TEMPLATE="Orange-%v.tar.gz" 
     102    ./fink-register-info.sh "$FINK_TEMPLATES/orange-gui-hg-py.info" $BASE_URL/$FINK_ORANGE_SOURCE_TEMPLATE $ORANGE_SOURCE_MD5 $ORANGE_VERSION $FINK_INFO_DIR/orange-gui-hg-py.info >> $FINK_LOG 2>&1 
     103fi 
     104 
     105if [[ $NEW_BIOINFORMATICS || $FORCE ]]; then 
     106    FINK_BIOINFORMATICS_SOURCE_TEMPLATE="Orange-Bioinformatics-%v.tar.gz" 
     107    ./fink-register-info.sh "$FINK_TEMPLATES/orange-bioinformatics-gui-hg-py.info" $BASE_URL/$FINK_BIOINFORMATICS_SOURCE_TEMPLATE $BIOINFORMATICS_SOURCE_MD5 $BIOINFORMATICS_VERSION $FINK_INFO_DIR/orange-bioinformatics-gui-hg-py.info >> $FINK_LOG 2>&1 
     108fi 
     109 
     110if [[ $NEW_TEXT || $FORCE ]]; then 
     111    FINK_TEXT_SOURCE_TEMPLATE="Orange-Text-Mining-%v.tar.gz" 
     112    ./fink-register-info.sh "$FINK_TEMPLATES/orange-text-gui-hg-py.info" $BASE_URL/$FINK_TEXT_SOURCE_TEMPLATE $TEXT_SOURCE_MD5 $TEXT_VERSION $FINK_INFO_DIR/orange-text-gui-hg-py.info >> $FINK_LOG 2>&1 
     113fi 
     114 
     115if [ ! $LOCAL ]; then 
     116    /Users/ailabc/mount-dirs.sh || { echo "Mounting failed." ; exit 1 ; } 
     117fi 
     118 
     119 
     120## daily fink build 
     121if [ ! $LOCAL ]; then 
     122    ./fink-daily-build-packages.sh &> $WORK_DIR/fink-daily-build-packages.log 
     123    EXIT_VALUE=$? 
     124fi 
     125 
     126if [ ! $LOCAL ]; then 
     127    /Users/ailabc/mount-dirs.sh || { echo "Mounting failed." ; exit 1 ; } 
     128fi 
     129 
     130echo "Orange (fink $MAC_VERSION $ARCH) [$EXIT_VALUE]" > "$LOG_DIR/fink-$MAC_VERSION-$ARCH-daily-build.log" 
     131date >> "$LOG_DIR/fink-$MAC_VERSION-$ARCH-daily-build.log" 
     132cat $WORK_DIR/fink-daily-build-packages.log >> "$LOG_DIR/fink-$MAC_VERSION-$ARCH-daily-build.log" 
     133(($EXIT_VALUE)) && echo "Running fink-daily-build-packages.sh failed" 
    24134 
    25135# Zero exit value 
Note: See TracChangeset for help on using the changeset viewer.