diff options
| author | Matthias Klose <doko@debian.org> | 2008-03-05 17:41:52 +0000 |
|---|---|---|
| committer | Matthias Klose <doko@debian.org> | 2008-03-05 17:41:52 +0000 |
| commit | 8f0e3ede3364ac8b5430c98e59aef7809d2d6593 (patch) | |
| tree | 788f4eb2144297c83d006dec45f9d5259ea2f198 /scripts | |
| parent | 2aef73048c415cee1d0f388c6946f97e9caa8897 (diff) | |
| download | java-common-8f0e3ede3364ac8b5430c98e59aef7809d2d6593.tar.gz | |
* update-java-alternatives: Add --jre-headless option.
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/update-java-alternatives | 28 | ||||
| -rw-r--r-- | scripts/update-java-alternatives.8 | 5 |
2 files changed, 22 insertions, 11 deletions
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 |
