karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject [karaf] branch master updated: Fix bin/inc to work with any shell
Date Wed, 15 Nov 2017 14:30:25 GMT
This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/karaf.git


The following commit(s) were added to refs/heads/master by this push:
     new ef1595d  Fix bin/inc to work with any shell
ef1595d is described below

commit ef1595dd00d179ece94715ec3d3a2ccf33091f24
Author: Jean-Baptiste Onofré <jbonofre@apache.org>
AuthorDate: Wed Nov 15 15:30:11 2017 +0100

    Fix bin/inc to work with any shell
---
 .../features/base/src/main/filtered-resources/resources/bin/inc  | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/assemblies/features/base/src/main/filtered-resources/resources/bin/inc b/assemblies/features/base/src/main/filtered-resources/resources/bin/inc
index 6f2dc6c..14a42e6 100644
--- a/assemblies/features/base/src/main/filtered-resources/resources/bin/inc
+++ b/assemblies/features/base/src/main/filtered-resources/resources/bin/inc
@@ -214,8 +214,9 @@ checkJvmVersion() {
         | awk '{print substr($1, 3, 3)}' \
         | sed -e 's;\.;;g')
     MAJOR_VERSION=$("${JAVA}" -version 2>&1 \
-        |awk -F '"' '/version/ {print $2}')
-    if [ "${MAJOR_VERSION:0:1}" -ge "9" ]; then
+        |awk -F '"' '/version/ {print $2}' \
+        |cut -b 1)
+    if [ "${MAJOR_VERSION}" -ge "9" ]; then
        VERSION=90
     fi
     if [ "${VERSION}" -lt "80" ]; then
@@ -265,8 +266,8 @@ setupDefaults() {
         # permgen was removed in Java 8
         VERSION=$("${JAVA}" -version 2>&1 | egrep '"([0-9].[0-9]\..*[0-9]).*"' | awk
'{print substr($3,2,length($3)-2)}' | awk '{print substr($1, 3, 3)}' | sed -e 's;\.;;g')
         MAJOR_VERSION=$("${JAVA}" -version 2>&1 \
-            |awk -F '"' '/version/ {print $2}')
-        if [ "${MAJOR_VERSION:0:1}" -ge "9" ]; then
+            |awk -F '"' '/version/ {print $2}'|cut -b 1)
+        if [ "${MAJOR_VERSION}" -ge "9" ]; then
            VERSION=90
         fi
         if [ "${VERSION}" -lt "80" ]; then

-- 
To stop receiving notification emails like this one, please contact
['"commits@karaf.apache.org" <commits@karaf.apache.org>'].

Mime
View raw message