Bug#825987: /usr/sbin/update-java-alternatives: Re: /usr/sbin/update-java-alternatives: doesn't detect openjdk-8 xjc

2017-01-06 Thread Emmanuel Bourg
Le 4/01/2017 à 18:12, Dominic Hargreaves a écrit :

> Ping? Is there any chance of getting this included into stretch?
> It would be nice to to have to manually patch this ourselves through
> its life.

Hi Dominic,

Thank you for the patch, I'm going to apply it.

Emmanuel Bourg



Bug#825987: /usr/sbin/update-java-alternatives: Re: /usr/sbin/update-java-alternatives: doesn't detect openjdk-8 xjc

2017-01-04 Thread Dominic Hargreaves
On Thu, Jun 23, 2016 at 03:07:50PM +0100, Dominic Hargreaves wrote:
> Control: retitle -1 update-java-alternatives: doesn't recognise new jdkhl 
> label in jinfo files
> Control: tags -1 + patch confirmed
> Control: severity -1 normal
> 
> On Fri, Jun 03, 2016 at 11:42:27AM +1000, Jayen Ashar wrote:
> > Package: java-common
> > Version: 0.57
> > Followup-For: Bug #825987
> > 
> > Dear Maintainer,
> > 
> > javac seems to have the same issue:
> > 
> > $ sudo update-java-alternatives -v -l | grep javac
> > listing java alternatives:
> > jdk javac /usr/lib/jvm/java-6-openjdk-i386/bin/javac
> > jdk javac /usr/lib/jvm/java-7-openjdk-i386/bin/javac
> > jdk javac /usr/lib/jvm/java-6-sun/bin/javac
> > jdk javac /usr/lib/jvm/jdk-7-oracle-i586/bin/javac
> 
> This is because, as of openjdk-8 8u72-b15-3[1] a new 'jdkhl' label
> was added to the jinfo files, but update-java-alternatives was not
> updated to take account of this.
> 
> This affects the following commands:
> 
> extcheck, idlj, jar, jarsigner, javac, javadoc, javah, javap, jcmd, jdb,
> jdeps, jhat, jinfo, jmap, jps, jrunscript, jsadebugd, jstack, jstat,
> jstatd, native2ascii, rmic, schemagen, serialver, wsgen, wsimport, xjc
> 
> I've attached a patch which restores the expected behaviour.

Ping? Is there any chance of getting this included into stretch?
It would be nice to to have to manually patch this ourselves through
its life.

Best,
Dominic.



Bug#825987: /usr/sbin/update-java-alternatives: Re: /usr/sbin/update-java-alternatives: doesn't detect openjdk-8 xjc

2016-06-23 Thread Dominic Hargreaves
Control: retitle -1 update-java-alternatives: doesn't recognise new jdkhl label 
in jinfo files
Control: tags -1 + patch confirmed
Control: severity -1 normal

On Fri, Jun 03, 2016 at 11:42:27AM +1000, Jayen Ashar wrote:
> Package: java-common
> Version: 0.57
> Followup-For: Bug #825987
> 
> Dear Maintainer,
> 
> javac seems to have the same issue:
> 
> $ sudo update-java-alternatives -v -l | grep javac
> listing java alternatives:
> jdk javac /usr/lib/jvm/java-6-openjdk-i386/bin/javac
> jdk javac /usr/lib/jvm/java-7-openjdk-i386/bin/javac
> jdk javac /usr/lib/jvm/java-6-sun/bin/javac
> jdk javac /usr/lib/jvm/jdk-7-oracle-i586/bin/javac

This is because, as of openjdk-8 8u72-b15-3[1] a new 'jdkhl' label
was added to the jinfo files, but update-java-alternatives was not
updated to take account of this.

This affects the following commands:

extcheck, idlj, jar, jarsigner, javac, javadoc, javah, javap, jcmd, jdb,
jdeps, jhat, jinfo, jmap, jps, jrunscript, jsadebugd, jstack, jstat,
jstatd, native2ascii, rmic, schemagen, serialver, wsgen, wsimport, xjc

I've attached a patch which restores the expected behaviour.

Since openjdk-8 has been backported into stable, a fixed java-common
should also be backported with this fix.

Cheers,
Dominic.

[1] 
>From 31e435b842b10fceb6e3bcc07f5f49f344cec050 Mon Sep 17 00:00:00 2001
From: Dominic Hargreaves 
Date: Thu, 23 Jun 2016 15:02:37 +0100
Subject: [PATCH] Support the jdkhl alternatives type

Since 8u72-b15-3 a new jdkhl label was introduced into the jinfo files
used by update-java-alternatives. Without this change, some alternatives
will not be updated correctly.

Bug-Debian: https://bugs.debian.org/825987
---
 scripts/update-java-alternatives | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/scripts/update-java-alternatives b/scripts/update-java-alternatives
index 9eea19c..6684bad 100755
--- a/scripts/update-java-alternatives
+++ b/scripts/update-java-alternatives
@@ -8,7 +8,7 @@ usage()
 {
 rv=$1
 cat >&2 <<-EOF
-	usage: $prog [--jre-headless] [--jre] [--plugin] [-v|--verbose]
+	usage: $prog [--jre-headless] [--jre] [--jdk-headless] [--plugin] [-v|--verbose]
 	   -l|--list []
 	   -s|--set 
 	   -a|--auto
@@ -27,6 +27,8 @@ while [ "$#" -gt 0 ]; do
 	action=auto;;
   -hl|--jre-headless)
 	hlonly=yes;;
+  -jdkhl|--jdk-headless)
+	jdkhlonly=yes;;
   -j|--jre)
 	jreonly=yes;;
   --plugin)
@@ -63,10 +65,11 @@ done
 [ "$#" -eq 0 ] || usage 1
 [ -n "$action" ] || usage 1
 
-which='^(hl|jre|jdk|plugin|DUMMY) '
+which='^(hl|jre|jdk|jdkhl|plugin|DUMMY) '
 if [ -n "$hlonly$jreonly$pluginonly" ]; then
 which='^('
 [ -n "$hlonly" ] && which="${which}hl|"
+[ -n "$jdkhlonly" ] && which="${which}jdkhl|"
 [ -n "$jreonly" ] && [ -n "$hlonly" ] && which="${which}jre|"
 [ -n "$jreonly" ] && [ -z "$hlonly" ] && which="${which}hl|jre|"
 [ -n "$pluginonly" ] && which="${which}plugin|"
-- 
2.1.4