[
https://issues.apache.org/jira/browse/KARAF-5729?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16490712#comment-16490712
]
ASF GitHub Bot commented on KARAF-5729:
---------------------------------------
jbonofre closed pull request #505: [KARAF-5729] Improve usage of awk on Solaris
+ delete blank space in …
URL: https://github.com/apache/karaf/pull/505
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
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 7e90d480a5..bbdd495732 100644
--- a/assemblies/features/base/src/main/filtered-resources/resources/bin/inc
+++ b/assemblies/features/base/src/main/filtered-resources/resources/bin/inc
@@ -33,6 +33,7 @@ detectOS() {
aix=false;
os400=false;
hpux=false;
+ solaris=false;
case "$(uname)" in
CYGWIN*)
cygwin=true
@@ -58,6 +59,9 @@ detectOS() {
export PS_PREFIX="UNIX95= "
echo "${PS_PREFIX}"
;;
+ SunOS*)
+ solaris=true
+ ;;
esac
}
@@ -213,7 +217,19 @@ detectJVM() {
}
checkJvmVersion() {
- VERSION=$("${JAVA}" -version 2>&1 | awk -F '"' '/version/ {print $2}' |
sed -e 's/_.*//g; s/^1\.//g ; s/\..*//g; s/-.*//g;')
+ # Use in priority xpg4 awk or nawk on SunOS as standard awk is outdated
+ if ${solaris}; then
+ if [ -x /usr/xpg4/bin/awk ]; then
+ VERSION=$("${JAVA}" -version 2>&1 | /usr/xpg4/bin/awk -F '"'
'/version/ {print $2}' | sed -e 's/_.*//g; s/^1\.//g; s/\..*//g; s/-.*//g;')
+ elif [ -x /usr/bin/nawk ]; then
+ VERSION=$("${JAVA}" -version 2>&1 | /usr/bin/nawk -F '"'
'/version/ {print $2}' | sed -e 's/_.*//g; s/^1\.//g; s/\..*//g; s/-.*//g;')
+ else
+ VERSION=$("${JAVA}" -version 2>&1 | awk -F '"' '/version/ {print
$2}' | sed -e 's/_.*//g; s/^1\.//g; s/\..*//g; s/-.*//g;')
+ fi
+ else
+ VERSION=$("${JAVA}" -version 2>&1 | awk -F '"' '/version/ {print $2}'
| sed -e 's/_.*//g; s/^1\.//g; s/\..*//g; s/-.*//g;')
+ fi
+ # java must be at least version 8
if [ "${VERSION}" -lt "8" ]; then
die "JVM must be greater than 1.8"
fi
@@ -302,3 +318,4 @@ convertPaths() {
fi
fi
}
+
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Karaf won't start on Solaris 11 and AIX 7.2
> -------------------------------------------
>
> Key: KARAF-5729
> URL: https://issues.apache.org/jira/browse/KARAF-5729
> Project: Karaf
> Issue Type: Bug
> Components: karaf-shell
> Reporter: Andrea Cosentino
> Assignee: Andrea Cosentino
> Priority: Major
> Fix For: 4.2.1
>
>
> {code:java}
> sed: command garbled: s/_.*//g; s/^1\.//g ; s/\..*//g;
> awk: can't open /version/ {print $2}
> karaf: JVM must be greater than 1.8
> {code}
> We need to change the way we check major JDK version
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)