source: orange/install-scripts/mac/dailyrun.sh @ 10702:cb5132258dab

Revision 10702:cb5132258dab, 5.9 KB checked in by Ales Erjavec <ales.erjavec@…>, 2 years ago (diff)

Fixes for daily build scripts.

  • Property exe set to *
Line 
1#!/bin/bash
2#
3# Should be run as: sudo ./dailyrun.sh
4#
5# $1 workdir
6# $2 force
7# $3 local
8
9WORK_DIR=${1:-"/private/tmp"}
10FORCE=$2
11LOCAL=$3
12
13MAC_VERSION=`sw_vers -productVersion | cut -d '.' -f 2`
14
15test -r /sw/bin/init.sh && . /sw/bin/init.sh
16
17export PATH=$HOME/bin:$PATH
18
19if [ $LOCAL ]; then
20    PUBLISH_DIR=$WORK_DIR/download
21    LOG_DIR=$WORK_DIR/logs
22    mkdir -p $PUBLISH_DIR
23    mkdir -p $LOG_DIR
24else
25    PUBLISH_DIR=/Volumes/download
26    LOG_DIR=/Volumes/download/buildLogs/osx
27fi
28
29if [ ! -e $WORK_DIR ]; then
30    mkdir -p $WORK_DIR
31fi
32
33
34defaults write com.apple.desktopservices DSDontWriteNetworkStores true
35
36if [ ! $LOCAL ]; then
37    /Users/ailabc/mount-dirs.sh || { echo "Mounting failed." ; exit 1 ; }
38fi
39
40SOURCE_LOG=$WORK_DIR/sources-daily-build.log
41
42./dailyrun-sources.sh $WORK_DIR $FORCE $LOCAL &> $SOURCE_LOG
43EXIT_VALUE=$?
44
45echo "Orange (sources) [ $EXIT_VALUE ]" > "$LOG_DIR/source-daily-build-hg.log"
46date >> "$LOG_DIR/source-daily-build-hg.log"
47cat $SOURCE_LOG >> "$LOG_DIR/source-daily-build-hg.log"
48(($EXIT_VALUE)) && echo "Daily sources failed"
49
50
51SOURCES_DIR=$PUBLISH_DIR/sources
52
53# Get versions from PKG-INFO files (these are updated by dailyrun-sources)
54ORANGE_VERSION=`grep "^Version:" $SOURCES_DIR/Orange.egg-info/PKG-INFO | cut -d " " -f 2`
55BIOINFORMATICS_VERSION=`grep "^Version:" $SOURCES_DIR/Orange_Bioinformatics.egg-info/PKG-INFO | cut -d " " -f 2`
56TEXT_VERSION=`grep "^Version:" $SOURCES_DIR/Orange_Text_Mining.egg-info/PKG-INFO | cut -d " " -f 2`
57
58
59# Source filenames
60ORANGE_SOURCE="Orange-${ORANGE_VERSION}.tar.gz"
61BIOINFORMATICS_SOURCE="Orange-Bioinformatics-${BIOINFORMATICS_VERSION}.tar.gz"
62TEXT_SOURCE="Orange-Text-Mining-${TEXT_VERSION}.tar.gz"
63
64
65# Get source packages md5 checksum
66ORANGE_SOURCE_MD5=`md5 -q $SOURCES_DIR/$ORANGE_SOURCE`
67BIOINFORMATICS_SOURCE_MD5=`md5 -q $SOURCES_DIR/$BIOINFORMATICS_SOURCE`
68TEXT_SOURCE_MD5=`md5 -q $SOURCES_DIR/$TEXT_SOURCE`
69
70
71## Daily bundle build from hg (for now always until versioning is established).
72if [[ true || $NEW_ORANGE || $NEW_BIOINFORMATICS || $NEW_TEXT || $FORCE ]]; then
73    ./bundle-daily-build-hg.sh &> $WORK_DIR/bundle-daily-build.log
74    EXIT_VALUE=$?
75fi
76
77if [ ! $LOCAL ]; then
78    /Users/ailabc/mount-dirs.sh || { echo "Mounting failed." ; exit 1 ; }
79fi
80
81echo "Orange (bundle $MAC_VERSION from hg) [$EXIT_VALUE]" > "$LOG_DIR/bundle-$MAC_VERSION-daily-build-hg.log"
82date >> "$LOG_DIR/bundle-$MAC_VERSION-daily-build-hg.log"
83cat $WORK_DIR/bundle-daily-build.log >> "$LOG_DIR/bundle-$MAC_VERSION-daily-build-hg.log"
84(($EXIT_VALUE)) && echo "Running bundle-daily-build-hg.sh failed"
85
86
87MAC_VERSION=`sw_vers -productVersion | cut -d '.' -f 2`
88ARCH=`perl -MFink::FinkVersion -e 'print Fink::FinkVersion::get_arch'`
89
90FINK_ROOT=/sw
91
92if [ ! $LOCAL ]; then
93    # Compare with the published info files
94    BASE="http://orange.biolab.si/fink/dists/$ARCH/main/finkinfo"
95else
96    # Compare with the local info files
97    BASE="file://$FINK_ROOT/fink/dists/local/main/finkinfo"
98fi
99
100
101OLD_ORANGE_VERSION=`curl --silent $BASE/orange-gui-dev-py.info | grep "Version: " | cut -d" " -f 2`
102OLD_BIOINFORMATICS_VERSION=`curl --silent $BASE/orange-bioinformatics-gui-dev-py.info | grep "Version: " | cut -d" " -f 2`
103OLD_TEXT_VERSION=`curl --silent $BASE/orange-text-gui-dev-py.info | grep "Version: " | cut -d" " -f 2`
104
105if [[ $OLD_ORANGE_VERSION < ORANGE_VERSION ]]; then
106    NEW_ORANGE=1
107fi
108
109if [[ $OLD_BIOINFORMATICS_VERSION < BIOINFORMATICS_VERSION ]]; then
110    NEW_BIOINFORMATICS=1
111fi
112
113if [[ $OLD_TEXT_VERSION < TEXT_VERSION ]]; then
114    NEW_TEXT=1
115fi
116
117
118# Base url for sources in fink .info files
119if [ $LOCAL ]; then
120    BASE_URL="file://$PUBLISH_DIR/sources"
121else
122    BASE_URL="http://orange.biolab.si/download/sources"
123fi
124
125# Update the local finkinfo
126# Local info files will be moved to biolab/main/finkinfo in fink-daily-build-packages.sh
127FINK_INFO_DIR="$FINK_ROOT/fink/dists/local/main/finkinfo"
128
129if [ ! -e $FINK_INFO_DIR ]; then
130    mkdir -p $FINK_INFO_DIR
131fi
132
133# Remove any old remaining local .info files
134rm -f $FINK_INFO_DIR/orange-*.info
135
136# Directory where fink .info templates are
137FINK_TEMPLATES=$WORK_DIR/orange/install-scripts/mac/fink
138
139FINK_LOG=$WORK_DIR/fink-daily-build.log
140echo "" > $FINK_LOG
141
142if [[ $NEW_ORANGE || $FORCE ]]; then
143    FINK_ORANGE_SOURCE_TEMPLATE="Orange-%v.tar.gz"
144    ./fink-register-info.sh "$FINK_TEMPLATES/orange-gui-dev-py.info" $BASE_URL/$FINK_ORANGE_SOURCE_TEMPLATE $ORANGE_SOURCE_MD5 $ORANGE_VERSION $FINK_INFO_DIR/orange-gui-dev-py.info >> $FINK_LOG 2>&1
145    FINK_ORANGE_INFO_EXIT_VALUE=$?
146fi
147
148if [[ $NEW_BIOINFORMATICS || $FORCE ]]; then
149    FINK_BIOINFORMATICS_SOURCE_TEMPLATE="Orange-Bioinformatics-%v.tar.gz"
150    ./fink-register-info.sh "$FINK_TEMPLATES/orange-bioinformatics-gui-dev-py.info" $BASE_URL/$FINK_BIOINFORMATICS_SOURCE_TEMPLATE $BIOINFORMATICS_SOURCE_MD5 $BIOINFORMATICS_VERSION $FINK_INFO_DIR/orange-bioinformatics-gui-dev-py.info >> $FINK_LOG 2>&1
151    FINK_BIOINFORMATICS_INFO_EXIT_VALUE=$?
152fi
153
154if [[ $NEW_TEXT || $FORCE ]]; then
155    FINK_TEXT_SOURCE_TEMPLATE="Orange-Text-Mining-%v.tar.gz"
156    ./fink-register-info.sh "$FINK_TEMPLATES/orange-text-gui-dev-py.info" $BASE_URL/$FINK_TEXT_SOURCE_TEMPLATE $TEXT_SOURCE_MD5 $TEXT_VERSION $FINK_INFO_DIR/orange-text-gui-dev-py.info >> $FINK_LOG 2>&1
157    FINK_TEXT_INFO_EXIT_VALUE=$?
158fi
159
160if [ ! $LOCAL ]; then
161    /Users/ailabc/mount-dirs.sh || { echo "Mounting failed." ; exit 1 ; }
162fi
163
164EXIT_VALUE=$(($FINK_ORANGE_INFO_EXIT_VALUE + $FINK_BIOINFORMATICS_INFO_EXIT_VALUE + $FINK_TEXT_INFO_EXIT_VALUE))
165if (($EXIT_VALUE)); then
166    echo "Running fink-register-info.sh failed"
167    rm -f $FINK_INFO_DIR/orange-*.info
168fi
169
170## daily fink build
171
172./fink-daily-build-packages.sh &> $WORK_DIR/fink-daily-build-packages.log
173EXIT_VALUE=$?
174
175if [ ! $LOCAL ]; then
176    /Users/ailabc/mount-dirs.sh || { echo "Mounting failed." ; exit 1 ; }
177fi
178
179echo "Orange (fink $MAC_VERSION $ARCH) [$EXIT_VALUE]" > "$LOG_DIR/fink-$MAC_VERSION-$ARCH-daily-build.log"
180date >> "$LOG_DIR/fink-$MAC_VERSION-$ARCH-daily-build.log"
181cat $WORK_DIR/fink-daily-build-packages.log >> "$LOG_DIR/fink-$MAC_VERSION-$ARCH-daily-build.log"
182(($EXIT_VALUE)) && echo "Running fink-daily-build.sh failed"
183
184# Zero exit value
185true
Note: See TracBrowser for help on using the repository browser.