From b430aca2a3289792804bdf99c2d16e5d62c99328 Mon Sep 17 00:00:00 2001 From: martinahansen Date: Wed, 9 Nov 2011 13:25:06 +0000 Subject: [PATCH] fixed bugs in installer git-svn-id: http://biopieces.googlecode.com/svn/trunk@1616 74ccb610-7750-0410-82ae-013aeee3265d --- ...er-0.41.sh => biopieces_installer-0.42.sh} | 71 +++++++++++++------ 1 file changed, 49 insertions(+), 22 deletions(-) rename bp_scripts/{biopieces_installer-0.41.sh => biopieces_installer-0.42.sh} (90%) diff --git a/bp_scripts/biopieces_installer-0.41.sh b/bp_scripts/biopieces_installer-0.42.sh similarity index 90% rename from bp_scripts/biopieces_installer-0.41.sh rename to bp_scripts/biopieces_installer-0.42.sh index 545380b..50c5f94 100755 --- a/bp_scripts/biopieces_installer-0.41.sh +++ b/bp_scripts/biopieces_installer-0.42.sh @@ -78,7 +78,25 @@ function dir_create echo_green "OK" else echo_red "FAIL" - echo $error + echo " $error" + exit_abort + fi +} + +# Function check if a directory is writable. +function dir_writable +{ + local dir=$1 + local file="$dir/bp_writable" + + echo -n "Writable? $dir: " + + if error=$( touch $file 2>&1 ); then + echo_green "OK" + rm $file + else + echo_red "FAIL" + echo " $error" exit_abort fi } @@ -94,23 +112,21 @@ function prompt_install echo "" echo " http://code.google.com/p/biopieces/wiki/Installation" echo "" - echo " If you experience problems, please report to the Google Group (see below)." - echo "" echo " The installer will now do the following:" echo "" - echo " - Check for existing Biopieces installation." - echo " - Check prerequisites:" - echo " * Subversion client" - echo " * Perl" - echo " * Perl modules" - echo " * Ruby" - echo " * Ruby gems" - echo " * Auxillary programs" + echo " * Check for existing Biopieces installation." + echo " * Check prerequisites:" + echo " - Subversion client" + echo " - Perl" + echo " - Perl modules" + echo " - Ruby" + echo " - Ruby gems" + echo " - Auxillary programs" echo "" - echo " - Create installation directories." - echo " - Download code from repository." - echo " - Set environment in .bashrc." - echo " - Run tests" + echo " * Create installation directories." + echo " * Download code from repository." + echo " * Set environment in .bashrc." + echo " * Run tests" echo "" echo " Problems? Check out the FAQ:" echo "" @@ -161,7 +177,10 @@ function prompt_install_existing if [ $found ]; then echo "" - echo " It appears that an old installation of Biopeices exists." + echo " An old installation of Biopeices appears to exists." + else + echo "" + echo " No installation of Biopeices found." fi while true; do @@ -237,6 +256,8 @@ function prompt_install_dir_code esac done fi + + dir_writable $bp_code } # Function to prompt the selection of the data directory. @@ -255,6 +276,8 @@ function prompt_install_dir_data esac done fi + + dir_writable $bp_data } # Function to prompt the selection of the log directory. @@ -273,6 +296,8 @@ function prompt_install_dir_log esac done fi + + dir_writable $bp_log } # Function to prompt the selection of the tmp directory. @@ -291,6 +316,8 @@ function prompt_install_dir_tmp esac done fi + + dir_writable $bp_tmp } # Function to prompt the appending of a section to bashrc. @@ -408,7 +435,7 @@ function test_perl echo_green "OK" else echo_red "FAIL" - echo $error | sed "s/, stopped.*//" + echo " $error" | sed "s/, stopped.*//" exit_abort fi } @@ -438,7 +465,6 @@ function test_ruby echo_green "OK" else echo_red "FAIL" - echo $error | sed "s/.*: //" exit_abort fi } @@ -476,13 +502,13 @@ function test_aux_program # Function to checkout the Biopieces code from subversion. function checkout_code { - echo -n "Downloading Biopieces code from repository: " + echo -n "Downloading Biopieces code from repository (please wait): " if error=$( svn checkout http://biopieces.googlecode.com/svn/trunk/ $bp_code ); then echo_green "OK" else echo_red "FAIL" - echo $error + echo " $error" exit_abort fi } @@ -490,13 +516,13 @@ function checkout_code # Function to checkout the Biopieces wiki from subversion. function checkout_wiki { - echo -n "Downloading Biopieces wiki from repository: " + echo -n "Downloading Biopieces wiki from repository (please wait): " if error=$( svn checkout http://biopieces.googlecode.com/svn/wiki/ "$bp_code/bp_usage" ); then echo_green "OK" else echo_red "FAIL" - echo $error + echo " $error" exit_abort fi } @@ -538,3 +564,4 @@ prompt_append_bashrc prompt_test_biopieces exit_success + -- 2.39.2