[java-policy] 75/198: * update-java-alternatives: Add --jre-headless option.
Emmanuel Bourg
ebourg-guest at moszumanska.debian.org
Wed Sep 23 07:49:32 UTC 2015
This is an automated email from the git hooks/post-receive script.
ebourg-guest pushed a commit to branch master
in repository java-policy.
commit 8f0e3ede3364ac8b5430c98e59aef7809d2d6593
Author: Matthias Klose <doko at debian.org>
Date: Wed Mar 5 17:41:52 2008 +0000
* update-java-alternatives: Add --jre-headless option.
---
debian/changelog | 1 +
scripts/update-java-alternatives | 28 ++++++++++++++++++----------
scripts/update-java-alternatives.8 | 5 ++++-
3 files changed, 23 insertions(+), 11 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 8f92c1f..17432c6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,7 @@ java-common (0.28) UNRELEASED; urgency=low
a dependency on java-gcj-compat-dev even if the default jdk is
another than java-gcj-compat-dev. Discussion thread starting at
http://lists.debian.org/debian-java/2008/03/msg00007.html.
+ * update-java-alternatives: Add --jre-headless option.
-- Matthias Klose <doko at debian.org> Wed, 05 Mar 2008 18:28:56 +0100
diff --git a/scripts/update-java-alternatives b/scripts/update-java-alternatives
index 3e232b7..71bc479 100755
--- a/scripts/update-java-alternatives
+++ b/scripts/update-java-alternatives
@@ -8,7 +8,7 @@ usage()
{
rv=$1
cat >&2 <<-EOF
- usage: $prog [--jre] [--plugin] [ -t|--test|-v|--verbose]
+ usage: $prog [--jre-headless] [--jre] [--plugin] [ -t|--test|-v|--verbose]
-l|--list [<jname>]
-s|--set <jname>
-a|--auto
@@ -25,6 +25,8 @@ while [ "$#" -gt 0 ]; do
-a|--auto)
[ -z "$action" ] || usage 1
action=auto;;
+ -hl|--jre-headless)
+ hlonly=yes;;
-j|--jre)
jreonly=yes;;
--plugin)
@@ -53,6 +55,7 @@ while [ "$#" -gt 0 ]; do
-h|-?|--help)
usage 0;;
-*)
+ echo "X: $1"
usage 1;;
*)
break;;
@@ -60,13 +63,18 @@ while [ "$#" -gt 0 ]; do
shift
done
-[ "$#" -eq 0 ] || usage 1
-[ -n "$action" ] || usage 1
-
-which='^(jre|jdk|plugin|DUMMY) '
-[ -n "$jreonly$pluginonly" ] && which=${which/jdk|/}
-[ -n "$pluginonly" ] && [ -z "$jreonly" ] && which=${which/jre|/}
-[ -z "$pluginonly" ] && [ -n "$jreonly" ] && which=${which/plugin|/}
+#[ "$#" -eq 0 ] || usage 1
+#[ -n "$action" ] || usage 1
+
+which='^(hl|jre|jdk|plugin|DUMMY) '
+if [ -n "$hlonly$jreonly$pluginonly" ]; then
+ which='^('
+ [ -n "$hlonly" ] && which="${which}hl|"
+ [ -n "$jreonly" ] && [ -n "$hlonly" ] && which="${which}jre|"
+ [ -n "$jreonly" ] && [ -z "$hlonly" ] && which="${which}hl|jre|"
+ [ -n "$pluginonly" ] && which="${which}plugin|"
+ which="${which}DUMMY) "
+fi
top=/usr/lib/jvm
@@ -125,11 +133,11 @@ do_set()
awk "/$which/ {print}" $jinfo | sort -u \
| \
while read type name location; do
- if [ $type = jdk -a -z "$jreonly$pluginonly" -a ! -f $location ]; then
+ if [ $type = jdk -a -z "$hlonly$jreonly$pluginonly" -a ! -f $location ]; then
echo >&2 "$prog: jdk alternative does not exist: $location"
continue
fi
- if [ $type = plugin -a -z "$jreonly" -a ! -f $location ]; then
+ if [ $type = plugin -a -z "$hlonly$jreonly" -a ! -f $location ]; then
echo >&2 "$prog: plugin alternative does not exist: $location"
continue
fi
diff --git a/scripts/update-java-alternatives.8 b/scripts/update-java-alternatives.8
index d6c0a99..ebac2ea 100644
--- a/scripts/update-java-alternatives.8
+++ b/scripts/update-java-alternatives.8
@@ -29,7 +29,10 @@ path provided by the <jname> installation.
Limit the actions to alternatives belong to a runtime environment,
not a development kit.
.TP
-\fB\-\-plugins\fR
+\fB\-\-jre\-headless\fR
+Limit the actions to alternatives belong to the headless part of a runtime environment.
+.TP
+\fB\-\-plugin\fR
Limit the actions to alternatives providing browser plugins.
.TP
\fB\-h|\-\-help\fR
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/java-policy.git
More information about the pkg-java-commits
mailing list