* [gentoo-commits] proj/eselect-java:master commit in: src/scripts/
@ 2016-11-28 22:19 Austin English
0 siblings, 0 replies; 6+ messages in thread
From: Austin English @ 2016-11-28 22:19 UTC (permalink / raw
To: gentoo-commits
commit: 4d7da7ac603f610fef687ea95357e7b727b19d03
Author: Austin English <wizardedit <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 28 19:23:43 2016 +0000
Commit: Austin English <wizardedit <AT> gentoo <DOT> org>
CommitDate: Mon Nov 28 19:27:13 2016 +0000
URL: https://gitweb.gentoo.org/proj/eselect-java.git/commit/?id=4d7da7ac
src/scripts/run-java-tool.bash.in: replace `which` with `command -v`
which is an external binary and may not be installed on all systems.
command is a shell builtin, and more likely to be available.
Based on a patch by Manuel Rüger <mrueg <AT> gentoo.org>
Gentoo-Bug: https://bugs.gentoo.org/599392
src/scripts/run-java-tool.bash.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/scripts/run-java-tool.bash.in b/src/scripts/run-java-tool.bash.in
index 2587fee..67e4dba 100644
--- a/src/scripts/run-java-tool.bash.in
+++ b/src/scripts/run-java-tool.bash.in
@@ -26,7 +26,7 @@ toolpath=$(
export PATH=
. "@GENTOO_PORTAGE_EPREFIX@/usr/share/java-config-2/vm/${vm_handle}" 2> /dev/null
: ${PATH:=${vmpath}/bin:${vmpath}/jre/bin}
- "@GENTOO_PORTAGE_EPREFIX@/usr/bin/which" "${tool}" 2> /dev/null
+ command -v "${tool}" 2> /dev/null
)
if [ -x "${toolpath}" ]; then
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/eselect-java:master commit in: src/scripts/
@ 2020-09-17 8:26 Georgy Yakovlev
0 siblings, 0 replies; 6+ messages in thread
From: Georgy Yakovlev @ 2020-09-17 8:26 UTC (permalink / raw
To: gentoo-commits
commit: 703b834feb6566aa9f11bc195fdfd255b0aa420b
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 17 08:22:57 2020 +0000
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Thu Sep 17 08:24:28 2020 +0000
URL: https://gitweb.gentoo.org/proj/eselect-java.git/commit/?id=703b834f
src/scripts/run-java-tool.bash.in: clarify tool availability
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
src/scripts/run-java-tool.bash.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/scripts/run-java-tool.bash.in b/src/scripts/run-java-tool.bash.in
index 9c57fe8..0494b6c 100644
--- a/src/scripts/run-java-tool.bash.in
+++ b/src/scripts/run-java-tool.bash.in
@@ -48,7 +48,7 @@ else
echo "* run-java-tool should only be used via symlinks to it" >&2
else
echo "* ${tool} is not available for ${vm_handle} on $(uname -m)" >&2
- echo "* IMPORTANT: some Java tools are not available on some VMs on some architectures" >&2
+ echo "* IMPORTANT: some Java tools are not available on some VMs or some architectures" >&2
if [ "$(id -u)" != 0 ] && [ -n "${DISPLAY}" ] && command -v notify-send > /dev/null; then
notify-send -i java-icon48 "Gentoo Java Launcher" "<b>${tool}</b> is not available for ${vm_handle}
<a href=\"https://wiki.gentoo.org/wiki/Java\">Gentoo Java User Guide</a>"
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/eselect-java:master commit in: src/scripts/
@ 2016-11-28 22:19 Austin English
0 siblings, 0 replies; 6+ messages in thread
From: Austin English @ 2016-11-28 22:19 UTC (permalink / raw
To: gentoo-commits
commit: 3c3ba13a37b10d693a622ff974223401df5698da
Author: Austin English <wizardedit <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 28 19:26:49 2016 +0000
Commit: Austin English <wizardedit <AT> gentoo <DOT> org>
CommitDate: Mon Nov 28 19:27:22 2016 +0000
URL: https://gitweb.gentoo.org/proj/eselect-java.git/commit/?id=3c3ba13a
src/scripts/run-java-tool.bash.in: fix shellcheck issues
src/scripts/run-java-tool.bash.in | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/scripts/run-java-tool.bash.in b/src/scripts/run-java-tool.bash.in
index 67e4dba..9c57fe8 100644
--- a/src/scripts/run-java-tool.bash.in
+++ b/src/scripts/run-java-tool.bash.in
@@ -24,6 +24,7 @@ vm_handle=${vmpath##*/}
toolpath=$(
export PATH=
+ # shellcheck disable=SC1090
. "@GENTOO_PORTAGE_EPREFIX@/usr/share/java-config-2/vm/${vm_handle}" 2> /dev/null
: ${PATH:=${vmpath}/bin:${vmpath}/jre/bin}
command -v "${tool}" 2> /dev/null
@@ -48,7 +49,7 @@ else
else
echo "* ${tool} is not available for ${vm_handle} on $(uname -m)" >&2
echo "* IMPORTANT: some Java tools are not available on some VMs on some architectures" >&2
- if [ "$(id -u)" != 0 ] && [ -n "${DISPLAY}" ] && type notify-send > /dev/null; then
+ if [ "$(id -u)" != 0 ] && [ -n "${DISPLAY}" ] && command -v notify-send > /dev/null; then
notify-send -i java-icon48 "Gentoo Java Launcher" "<b>${tool}</b> is not available for ${vm_handle}
<a href=\"https://wiki.gentoo.org/wiki/Java\">Gentoo Java User Guide</a>"
fi
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/eselect-java:master commit in: src/scripts/
@ 2016-01-01 0:03 James Le Cuirot
0 siblings, 0 replies; 6+ messages in thread
From: James Le Cuirot @ 2016-01-01 0:03 UTC (permalink / raw
To: gentoo-commits
commit: 9c9806ea10aa18db4d08e5e3ade73b0c7d9e21e4
Author: James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 30 13:36:21 2015 +0000
Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Thu Dec 31 23:55:53 2015 +0000
URL: https://gitweb.gentoo.org/proj/eselect-java.git/commit/?id=9c9806ea
Make run-java-tool.bash POSIX-compliant
But keep the .bash extension to avoid breaking existing systems.
src/scripts/run-java-tool.bash.in | 34 ++++++++++++++++------------------
1 file changed, 16 insertions(+), 18 deletions(-)
diff --git a/src/scripts/run-java-tool.bash.in b/src/scripts/run-java-tool.bash.in
index d6b41d4..49db910 100644
--- a/src/scripts/run-java-tool.bash.in
+++ b/src/scripts/run-java-tool.bash.in
@@ -1,44 +1,44 @@
-#!@GENTOO_PORTAGE_EPREFIX@/bin/bash
+#!@GENTOO_PORTAGE_EPREFIX@/bin/sh
user_vm="${HOME}/.gentoo@GENTOO_PORTAGE_EPREFIX@/java-config-2/current-user-vm"
system_vm="@GENTOO_PORTAGE_EPREFIX@/etc/java-config-2/current-system-vm"
# Try GENTOO_VM
-if [[ -n ${GENTOO_VM} ]]; then
+if [ -n "${GENTOO_VM}" ]; then
vmpath="@GENTOO_PORTAGE_EPREFIX@/usr/lib/jvm/${GENTOO_VM}/"
# Then user VM
-elif [[ -h ${user_vm} ]]; then
- vmpath=$(readlink ${user_vm})
+elif [ -h "${user_vm}" ]; then
+ vmpath=$(readlink "${user_vm}")
# And fall back to the system VM
else
- vmpath=$(readlink ${system_vm})
+ vmpath=$(readlink "${system_vm}")
fi
-tool=$(basename $0)
+tool=$(basename "$0")
bin=${vmpath}/bin/${tool}
jrebin=${vmpath}/jre/bin/${tool}
-vm_handle=$(basename ${vmpath})
-if [[ -x ${bin} ]]; then
- exec ${bin} "${@}"
-elif [[ -x ${jrebin} ]]; then
- exec ${jrebin} "${@}"
+vm_handle=$(basename "${vmpath}")
+if [ -x "${bin}" ]; then
+ exec "${bin}" "${@}"
+elif [ -x "${jrebin}" ]; then
+ exec "${jrebin}" "${@}"
else
- if [[ ! -d ${vmpath} ]]; then
+ if [ ! -d "${vmpath}" ]; then
echo "* Home for VM '${vm_handle}' does not exist: ${vmpath}" >&2
- if [[ -n ${GENTOO_VM} ]]; then
+ if [ -n "${GENTOO_VM}" ]; then
echo "* Invalid value for GENTOO_VM: ${GENTOO_VM}"
- elif [[ -h ${user_vm} ]]; then
+ elif [ -h "${user_vm}" ]; then
echo "* Invalid User VM: ${vm_handle}" >&2
else
echo "* Invalid System VM: ${vm_handle}" >&2
fi
else
- if [[ ${tool} = "run-java-tool.bash" ]]; then
+ if [ "${tool}" = "run-java-tool.bash" ]; then
echo "* run-java-tool was invoked directly" >&2
echo "* run-java-tool should only be used via symlinks to it" >&2
else
echo "* ${tool} is not available for ${vm_handle} on $(uname -m)" >&2
echo "* IMPORTANT: some Java tools are not available on some VMs on some architectures" >&2
- if (( ${EUID} != 0 )) && [[ "${DISPLAY}" ]] && type -p notify-send > /dev/null; then
+ if [ "$(id -u)" != 0 ] && [ -n "${DISPLAY}" ] && type notify-send > /dev/null; then
notify-send -i java-icon48 "Gentoo Java Launcher" "<b>${tool}</b> is not available for ${vm_handle}
<a href=\"http://www.gentoo.org/doc/en/java.xml\">Gentoo Java User Guide</a>"
fi
@@ -46,5 +46,3 @@ else
fi
exit 1
fi
-
-
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/eselect-java:master commit in: src/scripts/
@ 2016-01-01 0:03 James Le Cuirot
0 siblings, 0 replies; 6+ messages in thread
From: James Le Cuirot @ 2016-01-01 0:03 UTC (permalink / raw
To: gentoo-commits
commit: 52f8ec9e99886ae994eb1f5226d5657c29d9f8be
Author: James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 30 20:17:00 2015 +0000
Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Thu Dec 31 23:55:57 2015 +0000
URL: https://gitweb.gentoo.org/proj/eselect-java.git/commit/?id=52f8ec9e
Treat javaws as a special case in run-java-tool
We used to have to install dangling symlinks with icedtea(-bin)
pointing to a subsequent installation of icedtea-web. This was
convoluted and didn't make sense as Oracle's VM can also be used
against icedtea-web. Now we always run icedtea-web's javaws if it is
installed. Those wanting Oracle's javaws can simply uninstall
icedtea-web.
src/scripts/run-java-tool.bash.in | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/scripts/run-java-tool.bash.in b/src/scripts/run-java-tool.bash.in
index 6bccac0..bfd5130 100644
--- a/src/scripts/run-java-tool.bash.in
+++ b/src/scripts/run-java-tool.bash.in
@@ -1,5 +1,11 @@
#!@GENTOO_PORTAGE_EPREFIX@/bin/sh
+tool=${0##*/}
+
+if [ "${tool}" = "javaws" ] && [ -x "@GENTOO_PORTAGE_EPREFIX@/usr/bin/itweb-javaws" ]; then
+ exec "@GENTOO_PORTAGE_EPREFIX@/usr/bin/itweb-javaws" "${@}"
+fi
+
user_vm="${HOME}/.gentoo@GENTOO_PORTAGE_EPREFIX@/java-config-2/current-user-vm"
system_vm="@GENTOO_PORTAGE_EPREFIX@/etc/java-config-2/current-system-vm"
@@ -15,7 +21,6 @@ else
fi
vm_handle=${vmpath##*/}
-tool=${0##*/}
toolpath=$(
export PATH=
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/eselect-java:master commit in: src/scripts/
@ 2016-01-01 0:03 James Le Cuirot
0 siblings, 0 replies; 6+ messages in thread
From: James Le Cuirot @ 2016-01-01 0:03 UTC (permalink / raw
To: gentoo-commits
commit: 2b7d0f087f3fdec791a4667512ecfe71f64a9ffd
Author: James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 30 16:15:16 2015 +0000
Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Thu Dec 31 23:55:56 2015 +0000
URL: https://gitweb.gentoo.org/proj/eselect-java.git/commit/?id=2b7d0f08
Utilise the VM's PATH variable in run-java-tool
Continue to fall back to bin and jre/bin just in case.
src/scripts/run-java-tool.bash.in | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/src/scripts/run-java-tool.bash.in b/src/scripts/run-java-tool.bash.in
index 49db910..6bccac0 100644
--- a/src/scripts/run-java-tool.bash.in
+++ b/src/scripts/run-java-tool.bash.in
@@ -2,9 +2,10 @@
user_vm="${HOME}/.gentoo@GENTOO_PORTAGE_EPREFIX@/java-config-2/current-user-vm"
system_vm="@GENTOO_PORTAGE_EPREFIX@/etc/java-config-2/current-system-vm"
+
# Try GENTOO_VM
if [ -n "${GENTOO_VM}" ]; then
- vmpath="@GENTOO_PORTAGE_EPREFIX@/usr/lib/jvm/${GENTOO_VM}/"
+ vmpath="@GENTOO_PORTAGE_EPREFIX@/usr/lib/jvm/${GENTOO_VM}"
# Then user VM
elif [ -h "${user_vm}" ]; then
vmpath=$(readlink "${user_vm}")
@@ -12,15 +13,19 @@ elif [ -h "${user_vm}" ]; then
else
vmpath=$(readlink "${system_vm}")
fi
-tool=$(basename "$0")
-bin=${vmpath}/bin/${tool}
-jrebin=${vmpath}/jre/bin/${tool}
-vm_handle=$(basename "${vmpath}")
-if [ -x "${bin}" ]; then
- exec "${bin}" "${@}"
-elif [ -x "${jrebin}" ]; then
- exec "${jrebin}" "${@}"
+vm_handle=${vmpath##*/}
+tool=${0##*/}
+
+toolpath=$(
+ export PATH=
+ . "@GENTOO_PORTAGE_EPREFIX@/usr/share/java-config-2/vm/${vm_handle}" 2> /dev/null
+ : ${PATH:=${vmpath}/bin:${vmpath}/jre/bin}
+ "@GENTOO_PORTAGE_EPREFIX@/usr/bin/which" "${tool}" 2> /dev/null
+)
+
+if [ -x "${toolpath}" ]; then
+ exec "${toolpath}" "${@}"
else
if [ ! -d "${vmpath}" ]; then
echo "* Home for VM '${vm_handle}' does not exist: ${vmpath}" >&2
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-09-17 8:26 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-28 22:19 [gentoo-commits] proj/eselect-java:master commit in: src/scripts/ Austin English
-- strict thread matches above, loose matches on Subject: below --
2020-09-17 8:26 Georgy Yakovlev
2016-11-28 22:19 Austin English
2016-01-01 0:03 James Le Cuirot
2016-01-01 0:03 James Le Cuirot
2016-01-01 0:03 James Le Cuirot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox