Your message dated Sat, 29 Jul 2023 05:33:55 +0000
with message-id <[email protected]>
and subject line Bug#1040512: fixed in javatools 0.79
has caused the Debian Bug report #1040512,
regarding javatools: Please support Java 21
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1040512: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1040512
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: javatools
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: origin-ubuntu mantic ubuntu-patch
X-Debbugs-Cc: [email protected]

Dear Maintainer,

Java 21 retires release level 7 and requires release level 8. This patch allows
to set release level to 8 if Java is 21 or later.

Changes:
  * jh_build: check Java version to set the minimum release level.
  * d/control: javahelper now depends on jarwrapper to check Java version.
  * d/rules: use release level 8.


Thanks for considering the patch.


-- System Information:
Debian Release: bookworm/sid
  APT prefers lunar-updates
  APT policy: (500, 'lunar-updates'), (500, 'lunar-security'), (500, 'lunar'), 
(100, 'lunar-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.2.0-24-generic (SMP w/32 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
diff -Nru javatools-0.78/debian/control javatools-0.78ubuntu1/debian/control
--- javatools-0.78/debian/control       2021-02-05 00:05:53.000000000 +1300
+++ javatools-0.78ubuntu1/debian/control        2023-05-04 19:27:54.000000000 
+1200
@@ -36,6 +36,7 @@
 Package: javahelper
 Architecture: all
 Depends:
+ jarwrapper,
  bsdextrautils | bsdmainutils,
  dctrl-tools,
  debhelper-compat (= 13),
diff -Nru javatools-0.78/debian/rules javatools-0.78ubuntu1/debian/rules
--- javatools-0.78/debian/rules 2021-02-05 00:05:53.000000000 +1300
+++ javatools-0.78ubuntu1/debian/rules  2023-05-04 19:27:54.000000000 +1200
@@ -14,7 +14,7 @@
 
 override_dh_auto_build: jh_lib.sh
        mkdir -p target/classes
-       javac -d target/classes -source 7 -target 7 
src/main/java/org/debian/javatools/CheckProperty.java
+       javac -d target/classes -source 8 -target 8 
src/main/java/org/debian/javatools/*.java
        jar -cvf target/javatools.jar -C target/classes/ .
 
        mkdir tmp tmp.jarwrapper
diff -Nru javatools-0.78/jh_build javatools-0.78ubuntu1/jh_build
--- javatools-0.78/jh_build     2021-02-05 00:07:26.000000000 +1300
+++ javatools-0.78ubuntu1/jh_build      2023-05-04 19:27:54.000000000 +1200
@@ -10,9 +10,7 @@
 use warnings;
 use Cwd qw(realpath);
 use List::Util qw(any);
-
-# Value to pass to -source/-target by default
-use constant DEFAULT_JAVA_RELEASE => '1.7';
+use File::Temp qw(tempfile);
 
 use Debian::Debhelper::Dh_Lib;
 use Debian::Javahelper::Java qw(write_manifest_fd);
@@ -115,7 +113,7 @@
 my @JH_JAR_EXTRA;
 my $build_javadoc = 1;
 my (@javac_opts, @javadoc_opts, $main_class, $do_clean);
-my (@JAVAC, @JAVADOC, @JAR, @builds);
+my (@JAVAC, @JAVA, @JAVADOC, @JAR, @builds);
 
 $CLASSPATH =~ tr/:/ /;
 @JH_JAR_EXTRA = split(' ', $ENV{'JH_JAR_EXTRA'}) if defined 
$ENV{'JH_JAR_EXTRA'};
@@ -150,6 +148,17 @@
        exit(0);
 }
 
+# Value to pass to -source/-target by default
+sub get_min_release {
+       if (doit_noerror(@JAVA, "-cp", "/usr/share/java/javatools.jar", 
"org.debian.javatools.CheckIntProperty", "java.specification.version", "gte", 
"21")) {
+               warning('Java machine does not support --release 7, using 
--release 8');
+               return "8";
+       }
+       # when the specification version is less than 21 or an error occured
+       # default to 7
+       return "7";
+}
+
 sub _has_java_option {
        my ($opt_ref, $option_name) = @_;
        for my $arg (@{$opt_ref}) {
@@ -171,27 +180,6 @@
        return;
 }
 
-# Use ISO8859-1 as the default encoding to avoid unmappable character errors
-_default_java_option(\@javac_opts, '-encoding', 'ISO8859-1');
-_default_java_option(\@javadoc_opts, '-encoding', 'ISO8859-1');
-
-if (not _has_java_option(\@javac_opts, '--release') and not 
_has_java_option(\@javac_opts, '-source')) {
-       # If neither --release nor -source is set, then set -source (and 
-target if also absent)
-       if (not _has_java_option(\@javac_opts, '-target')) {
-               push(@javac_opts, '-source', DEFAULT_JAVA_RELEASE, '-target', 
DEFAULT_JAVA_RELEASE);
-       } else {
-               push(@javac_opts, '-source', DEFAULT_JAVA_RELEASE);
-       }
-}
-
-if (not _has_java_option(\@javadoc_opts, '--release')) {
-       _default_java_option(\@javadoc_opts, '-source', DEFAULT_JAVA_RELEASE);
-}
-
-_default_java_option(\@javadoc_opts, '-notimestamp');
-_default_java_option(\@javadoc_opts, '-Xdoclint:none');
-
-
 sub do_build {
        my ($jarfile, @sources) = @_;
        my (@srcdirs, @srcfiles);
@@ -275,8 +263,33 @@
                error('Cannot find any JAVA_HOME: aborting');
        }
        @JAVAC = ("${JAVA_HOME}/bin/javac");
+       @JAVA = ("${JAVA_HOME}/bin/java");
+
        @JAVADOC = ("${JAVA_HOME}/bin/javadoc", '-locale', 'en_US');
        @JAR = ("${JAVA_HOME}/bin/jar");
+
+       my $default_java_release = get_min_release();
+
+       # Use ISO8859-1 as the default encoding to avoid unmappable character 
errors
+       _default_java_option(\@javac_opts, '-encoding', 'ISO8859-1');
+       _default_java_option(\@javadoc_opts, '-encoding', 'ISO8859-1');
+
+       if (not _has_java_option(\@javac_opts, '--release') and not 
_has_java_option(\@javac_opts, '-source')) {
+               # If neither --release nor -source is set, then set -source 
(and -target if also absent)
+               if (not _has_java_option(\@javac_opts, '-target')) {
+                       push(@javac_opts, '-source', $default_java_release, 
'-target', $default_java_release);
+               } else {
+                       push(@javac_opts, '-source', $default_java_release);
+               }
+       }
+
+       if (not _has_java_option(\@javadoc_opts, '--release')) {
+               _default_java_option(\@javadoc_opts, '-source', 
$default_java_release);
+       }
+
+       _default_java_option(\@javadoc_opts, '-notimestamp');
+       _default_java_option(\@javadoc_opts, '-Xdoclint:none');
+
        for my $build (@builds) {
                do_build(@{$build});
        }
diff -Nru 
javatools-0.78/src/main/java/org/debian/javatools/CheckIntProperty.java 
javatools-0.78ubuntu1/src/main/java/org/debian/javatools/CheckIntProperty.java
--- javatools-0.78/src/main/java/org/debian/javatools/CheckIntProperty.java     
1970-01-01 12:00:00.000000000 +1200
+++ 
javatools-0.78ubuntu1/src/main/java/org/debian/javatools/CheckIntProperty.java  
    2023-05-04 19:27:54.000000000 +1200
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2023 Canonical Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.debian.javatools;
+
+/**
+ * Check the value of a system property from the command line.
+ *
+ * Syntax:
+ *
+ *   java org.debian.javatools.CheckIntProperty <propertyName> <condition> 
<expectedValue>
+ *
+ *   <condition>:
+ *          - gte - greater or equal 
+ *          - lte - less than or equal
+ *          - gt  - greater than
+ *          - lt  - less than
+ *
+ * The program exits with the status code 0 if the condition is true, and 1 
otherwise.
+ */
+public class CheckIntProperty {
+
+    private static boolean check(String operation, int actualValue, int 
expectedValue){
+        switch (operation) {
+            case "gt": return actualValue > expectedValue;
+            case "gte": return actualValue >= expectedValue;
+            case "lte": return actualValue <= expectedValue;
+            case "lt": return actualValue < expectedValue;
+            default: return false;
+        }
+    }
+
+    private static boolean IsVerbose() {
+        try 
+        {
+            return Integer.parseInt(System.getenv("DH_VERBOSE")) != 0;
+        } 
+        catch (NumberFormatException ex)
+        {
+        }
+        return false;
+    }
+
+    public static void main(String[] args) {
+        boolean verbose = IsVerbose();
+        String propertyName = args[0];
+        String operation = args[1];
+        try {
+            int expectedValue = Integer.parseInt(args[2]);
+            int actualValue = 
Integer.parseInt(System.getProperty(propertyName));
+            if (check(operation, actualValue, expectedValue)) {
+                if (IsVerbose())
+                    System.out.println("OK: " + propertyName + " " + 
actualValue + " " + operation + " " + expectedValue);
+                System.exit(0);
+            }
+        }
+        catch (Exception e) {
+            e.printStackTrace();
+        }
+        if (IsVerbose())
+            System.out.println("FAILED: " + propertyName + " " + 
System.getProperty(propertyName) + " " + operation + " " + args[2]);
+        System.exit(1);
+    }
+}

--- End Message ---
--- Begin Message ---
Source: javatools
Source-Version: 0.79
Done: tony mancill <[email protected]>

We believe that the bug you reported is fixed in the latest version of
javatools, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
tony mancill <[email protected]> (supplier of updated javatools package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Fri, 28 Jul 2023 22:15:46 -0700
Source: javatools
Architecture: source
Version: 0.79
Distribution: unstable
Urgency: medium
Maintainer: Debian Java Maintainers 
<[email protected]>
Changed-By: tony mancill <[email protected]>
Closes: 1040512
Changes:
 javatools (0.79) unstable; urgency=medium
 .
   [ Vladimir Petko ]
   * Support Java 21 (Closes: #1040512)
 .
   [ tony mancill ]
   * Update string literals in jh_build for Test::Perl::Critic
   * Rename variable in jh_manifest due to Perl::Critic warning about magic var
   * Adjust formatting of CheckIntProperty
   * Remove Fedora-License from debian/copyright (no longer applicable)
   * Rework debian/copyright into machine-readable format
   * Drop dependency on obsolete bsdmainutils
   * Bump Standards-Version to 4.6.2 (no changes)
Checksums-Sha1:
 1ee20b26b0eabd56b0482855c160d3905ded9706 1932 javatools_0.79.dsc
 32e27d9bec4937ffd826d6a946a75bc9d37ad076 53548 javatools_0.79.tar.xz
 cbff97d29714d40378304174d6297ec03c1d3946 11465 javatools_0.79_amd64.buildinfo
Checksums-Sha256:
 ea6a3cd90b0d3c8981a03bae86eb622eb81ef8ce60ba1fccfa36614c6d9fa4d1 1932 
javatools_0.79.dsc
 7f3ec90bfac7904a37cac890cd0816b3a2fc42a895def341215640ffebfda3c4 53548 
javatools_0.79.tar.xz
 eb9c632e3c42e0c7b0e5ae476447bb41a6d72d797263bf01a44297ba6fb4d604 11465 
javatools_0.79_amd64.buildinfo
Files:
 883079ba0f5b39485c740fbb16e54ed7 1932 java optional javatools_0.79.dsc
 3889999e4e39029fc46cbedd950f7c1c 53548 java optional javatools_0.79.tar.xz
 ecf5a5ac227e46e68a11cb48d3f7eb7e 11465 java optional 
javatools_0.79_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQJIBAEBCgAyFiEE5Qr9Va3SequXFjqLIdIFiZdLPpYFAmTEoesUHHRtYW5jaWxs
QGRlYmlhbi5vcmcACgkQIdIFiZdLPpafCBAA2K0kZAQLejYupk/M+GASx7gpGQ23
HCRkEpphrrf5HJIrz26SBBxWTg8nJy43kmsfBVVko6B7TJyho1DkdsSmtKdvX4Io
ubkYGdqeRaFFgazAHXUX4UScpYtMmBBQ+o0m8RCXtOxWd0c2OJNNQ68na2AdEVNn
uyZq6QIaqNef00Q0YUbSER8P+P9QCaKkKPIwsuiPtrj3rUmKAqzFUVDZ1lNPsxbr
OIJFHafTpfDRbrZpbVg366yR0GPNIIvdrA2gUDkT3x111SokQw3j2zceMj0j4tvG
SIJw6r3Q3x1KPaUi+cPx9gPY0ueCenp05np7t9N3R8ymPj+JQ/YsyoQM7N2TXf9t
L/vP/B1beuTy/f2OyaZq1DC07lxcFZvbM3GZI423bugzE4DNNatNM1JXQ48mYQDq
w3yECj+WmsNeFMjZNpt7pHE68BM8kaJ9j4VMn+gyUbE2h3j2//3nfrcd+076gC8W
Pr9f37l3NLHzaOejqqcAaECDPFkqzow5jrUZB9c79k0VKQcmVdqYsTjtfO+RnklW
d9/lDcmSzCqf5HbjGixQ0bzioPin6ITG/gWkFljMt/fgd65Xojr4Fr4uDUmG5zQ1
MQ8CaGf0oyv4cByAzJzIgtoybmONqgc/fWWaReHA3Q838ZENgZys9qJ8uzNqD+/l
qiTX8CrPeLfKVw8=
=j8c/
-----END PGP SIGNATURE-----

--- End Message ---
__
This is the maintainer address of Debian's Java team
<https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-java-maintainers>.
 Please use
[email protected] for discussions and questions.

Reply via email to