diff options
author | Andreas Maunz <andreas@maunz.de> | 2011-04-12 12:06:27 +0200 |
---|---|---|
committer | Andreas Maunz <andreas@maunz.de> | 2011-04-12 12:06:27 +0200 |
commit | af04398a95f2eb04dc01648921eb7e040bbe2b65 (patch) | |
tree | 94c6af7b8a551c53bc5842309917993bde83d0ed | |
parent | 2fe0ffa04440906b8b1d4062e24674b9d3f0b5ee (diff) |
Fixed switching to master
-rwxr-xr-x | opentox-webservices.sh | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/opentox-webservices.sh b/opentox-webservices.sh index df7a07d..1b71653 100755 --- a/opentox-webservices.sh +++ b/opentox-webservices.sh @@ -25,6 +25,12 @@ if [ ! -e "$RAKE" ]; then exit 1 fi +GIT="`which git`" +if [ ! -e "$GIT" ]; then + echo "'git' missing. Install 'git' first. Aborting..." + exit 1 +fi + LOG="/tmp/`basename $0`-log.txt" if ! id opentox >>$LOG 2>&1; then @@ -38,9 +44,9 @@ mkdir -p "$WWW_DEST/opentox" >>$LOG 2>&1 cd "$WWW_DEST/opentox" >>$LOG 2>&1 for s in compound dataset algorithm model toxcreate task; do rm -rf "$s" >>$LOG 2>&1 - git clone "git://github.com/opentox/$s.git" "$s" >>$LOG 2>&1 + $GIT clone "git://github.com/opentox/$s.git" "$s" >>$LOG 2>&1 cd "$s" >>$LOG 2>&1 - git checkout -t origin/$OT_BRANCH >>$LOG 2>&1 + $GIT checkout -t origin/$OT_BRANCH >>$LOG 2>&1 rm -rf public >>$LOG 2>&1 mkdir public >>$LOG 2>&1 mypath_from="$WWW_DEST/opentox/$s/public" @@ -60,16 +66,20 @@ done # fminer etc cmd="test -f $HOME/.opentox/config/production.yaml" && run_cmd "$cmd" "Config present" cd "$WWW_DEST/opentox/algorithm" >>$LOG 2>&1 -cmd="git submodule init" && run_cmd "$cmd" "Fminer Init" -cmd="git submodule update" && run_cmd "$cmd" "Fminer Update" +cmd="$GIT submodule init" && run_cmd "$cmd" "Fminer Init" +cmd="$GIT submodule update" && run_cmd "$cmd" "Fminer Update" for mylib in bbrc last; do cmd="sed -i 's,^INCLUDE_OB.*,INCLUDE_OB\ =\ -I$OB_DEST/include/openbabel-2.0,g' $WWW_DEST/opentox/algorithm/libfminer/lib$mylib/Makefile; sed -i 's,^LDFLAGS_OB.*,LDFLAGS_OB\ =\ -L$OB_DEST/lib,g' $WWW_DEST/opentox/algorithm/libfminer/lib$mylib/Makefile" && run_cmd "$cmd" "Makefile $mylib (OB)" cmd="sed -i 's,^INCLUDE_RB.*,INCLUDE_RB\ =\ -I$RUBY_DEST/lib/ruby/1.8/i686-linux,g' $WWW_DEST/opentox/algorithm/libfminer/lib$mylib/Makefile" && run_cmd "$cmd" "Makefile $mylib (RB)" done cd "libfminer/libbbrc">>$LOG 2>&1 +$GIT checkout master >>$LOG 2>&1 +$GIT pull >>$LOG 2>&1 cmd="make ruby" && run_cmd "$cmd" "Make BBRC" cd ->>$LOG 2>&1 cd "libfminer/liblast">>$LOG 2>&1 +$GIT checkout master >>$LOG 2>&1 +$GIT pull >>$LOG 2>&1 cmd="make ruby" && run_cmd "$cmd" "Make LAST" cd ->>$LOG 2>&1 |