Skip to content

Commit 93705b7

Browse files
committed
- check java installation and display an error message if it's not available - use rsync instead of cp to avoid long waiting time without display (cherry picked from commit 0d3729a)
1 parent 70d391b commit 93705b7

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

tools/install.sh

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@
33
if [[ $(id -u) -ne 0 ]] ; then echo "Please run the installation script as root" ; exit 1 ; fi
44

55
SCRIPT_DIR="$( cd "$(dirname "$0")" ; pwd -P )"
6+
CURRENT_PADIR="$(dirname "$SCRIPT_DIR")"
7+
PA_FOLDER_NAME="$(basename "$CURRENT_PADIR")"
8+
9+
# checking java installation
10+
11+
if [[ "$JAVA_HOME" == "" ]]; then
12+
if which java 2&> /dev/null ; then
13+
if [ ! -f "$CURRENT_PADIR/jre/bin/java" ]; then
14+
echo "JAVA_HOME is not set, no 'java' command could be found in your PATH, and this ProActive distribution does not contain an embedded jre, please install a JRE or JDK." ; exit 1 ;
15+
fi
16+
fi
17+
fi
18+
619

720
# installation of the ProActive distribution
821

@@ -13,8 +26,6 @@ PA_ROOT=$(echo $PA_ROOT | xargs)
1326
mkdir -p $PA_ROOT
1427
rm -f $PA_ROOT/default
1528

16-
CURRENT_PADIR="$(dirname "$SCRIPT_DIR")"
17-
PA_FOLDER_NAME="$(basename "$CURRENT_PADIR")"
1829

1930
confirm() {
2031
# call with a prompt string or use a default
@@ -31,10 +42,10 @@ confirm() {
3142
if [ -d "$PA_ROOT/$PA_FOLDER_NAME" ]; then
3243
if confirm "A folder $PA_ROOT/$PA_FOLDER_NAME already exists, delete its content and replace by a fresh install? [Y/n] " ; then
3344
rm -rf $PA_ROOT/$PA_FOLDER_NAME
34-
cp -f -R $CURRENT_PADIR $PA_ROOT
45+
rsync --progress -a $CURRENT_PADIR $PA_ROOT
3546
fi
3647
else
37-
cp -f -R $CURRENT_PADIR $PA_ROOT
48+
rsync --progress -a $CURRENT_PADIR $PA_ROOT
3849
fi
3950

4051

0 commit comments

Comments
 (0)