From 76dc892491948adae5e5e62cf94448967e8d865b Mon Sep 17 00:00:00 2001 From: Ashlee Young Date: Sun, 6 Dec 2015 07:15:03 -0800 Subject: Fixes bad POM file with ONOS commit 8c68536972f63069c263635c9d9f4f31d7f3e9a2 Change-Id: I7adb5a2d3738d53dbc41db7577768b0e7ced5450 Signed-off-by: Ashlee Young --- build.sh | 58 +++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 21 deletions(-) (limited to 'build.sh') diff --git a/build.sh b/build.sh index 5b398433..f6dd0b16 100755 --- a/build.sh +++ b/build.sh @@ -18,9 +18,9 @@ # limitations under the License. ##### Settings ##### -VERSION=1.0.7 +VERSION=1.0.8 AUTHOR="Ashlee Young" -MODIFIED="December 5, 2015" +MODIFIED="December 6, 2015" GERRITURL="git clone ssh://im2bz2pee@gerrit.opnfv.org:29418/onosfw" ONOSURL="https://github.com/opennetworkinglab/onos" SURICATAURL="https://github.com/inliniac/suricata" @@ -155,32 +155,48 @@ updateONOS() ##### Check Java ##### checkJRE() { - INSTALLED_JAVA=`java -version 2>&1 | head -n 1 | cut -d\" -f 2` # | awk -F "." '{print $1"."$2}'` - JAVA_NUM=`echo $INSTALLED_JAVA | awk -F "." '{print $1"."$2}'` - if [ "$JAVA_NUM" '<' "$JAVA_VERSION" ]; then - echo -e "Java version $INSTALLED_JAVA is lower than the required version of $JAVA_VERSION. \n" - if [ "$OS" = "centos" ]; then - printf "It is recommended that you run \"sudo yum -y install java-$JAVA_VERSION.0-openjdk-devel\".\n" - if ask "May we perform this task for you?"; then - sudo yum -y install java-$JAVA_VERSION.0-openjdk-devel + if [ -d "$JRE_HOME" ]; then + INSTALLED_JAVA=`$JRE_HOME/java -version 2>&1 | head -n 1 | cut -d\" -f 2` + JAVA_NUM=`echo $INSTALLED_JAVA | awk -F "." '{print $1"."$2}'` + if [ "$JAVA_NUM" '<' "$JAVA_VERSION" ]; then + echo -e "Java version $INSTALLED_JAVA is lower than the required version of $JAVA_VERSION. \n" + if [ "$OS" = "centos" ]; then + printf "It is recommended that you run \"sudo yum -y install java-$JAVA_VERSION.0-openjdk-devel\".\n" + if ask "May we perform this task for you?"; then + sudo yum -y install java-$JAVA_VERSION.0-openjdk-devel + fi + elif [[ "$OS" = "ubuntu" ]]; then + printf "It is recommended that you run \"sudo apt-get -y install openjdk-8-jdk\".\n" + if ask "May we perform this task for you?"; then + sudo add-apt-repository -y ppa:openjdk-r/ppa + sudo apt-get -y update + sudo apt-get -y install openjdk-8-jdk + fi + + elif [[ "$OS" = "suse" ]]; then + printf "It is recommended that you run \"sudo zypper --non-interactive install java-1_8_0-openjdk-devel\".\n" + if ask "May we perform this task for you?"; then + sudo zypper --non-interactive install java-1_8_0-openjdk-devel + fi fi - elif [[ "$OS" = "ubuntu" ]]; then - printf "It is recommended that you run \"sudo apt-get -y install openjdk-8-jdk\".\n" - if ask "May we perform this task for you?"; then + else + printf "Installed Java version meets the requirements. \n\n" + fi + else + printf "We are looking for Java in a specific location and not finding it. This won't change \n" + printf "any other Java settings you might have. \n\n" + if ask "May we install it where we need it?"; then + if [ "$OS" = "centos" ]; then + sudo yum -y install java-$JAVA_VERSION.0-openjdk-devel + elif [[ "$OS" = "ubuntu" ]]; then sudo add-apt-repository -y ppa:openjdk-r/ppa sudo apt-get -y update sudo apt-get -y install openjdk-8-jdk - fi - - elif [[ "$OS" = "suse" ]]; then - printf "It is recommended that you run \"sudo zypper --non-interactive install java-1_8_0-openjdk-devel\".\n" - if ask "May we perform this task for you?"; then + elif [[ "$OS" = "suse" ]]; then sudo zypper --non-interactive install java-1_8_0-openjdk-devel fi fi - else - printf "Installed Java version meets the requirements. \n\n" - fi + fi } checkJDK() -- cgit 1.2.3-korg