Matthias Klose pushed to branch master at Debian Java Maintainers / 
ca-certificates-java


Commits:
d6bdcf12 by Matthias Klose at 2024-01-18T11:15:57+01:00
  * Do not try to run foreign architecture java. Closes: #1043247.

- - - - -


4 changed files:

- debian/ca-certificates-java.postinst
- debian/changelog
- + debian/tests/can-configure-cross-compilation
- debian/tests/control


Changes:

=====================================
debian/ca-certificates-java.postinst
=====================================
@@ -71,6 +71,11 @@ update_cacerts()
                exit 0
        fi
 
+       if ! java -version 2> /dev/null; then
+               echo "Unable to execute Java. Skipping Java certificates setup."
+               exit 0
+       fi
+
        if [ -f /var/lib/ca-certificates-java/convert_pkcs12_keystore_to_jks ]; 
then
                convert_pkcs12_keystore_to_jks
                rm /var/lib/ca-certificates-java/convert_pkcs12_keystore_to_jks


=====================================
debian/changelog
=====================================
@@ -4,6 +4,7 @@ ca-certificates-java (20240118) UNRELEASED; urgency=medium
   * d/rules: Use java_compat_level variable provided by java-common to
     adjust -source/-target level to the minimum required by the default
     Java. Closes: #1057495.
+  * Do not try to run foreign architecture java. Closes: #1043247.
 
   [ Matthias Klose ]
   * Build-depend on java-common.


=====================================
debian/tests/can-configure-cross-compilation
=====================================
@@ -0,0 +1,49 @@
+#!/bin/bash
+set -ex
+
+if [ $(dpkg --print-architecture) != 'amd64' ]; then
+    echo "The test is only valid for amd64"
+    exit 0
+fi
+
+gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9
+gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys 6ED0E7B82643E131
+gpg --output unstable.pgp --export 6ED0E7B82643E131 0E98404D386FA1D9
+
+echo "Host architecture ${host_arch}"
+echo "Foreign architecture ${foreign_arch}"
+
+echo deb http://deb.debian.org/debian unstable main > sources.list
+echo deb [ trusted=yes ] file:///tmp/binaries / >> sources.list
+
+where=/tmp/binaries
+mkdir -p ${where}
+
+pushd ${where}
+apt download ca-certificates-java
+apt-ftparchive sources . \
+    | tee "$where"/Sources \
+    | gzip -9 > "$where"/Sources.gz
+
+apt-ftparchive packages "$where" \
+    | sed "s@$where@@" \
+    | tee "$where"/Packages \
+    | gzip -9 > "$where"/Packages.gz
+
+# sponge comes from moreutils
+apt-ftparchive \
+    -o"APT::FTPArchive::Release::Origin=$origin" \
+    -o"APT::FTPArchive::Release::Label=$label" \
+    -o"APT::FTPArchive::Release::Codename=$where" release "$where" \
+    | sponge "$where"/Release
+popd
+
+mmdebstrap  --setup-hook='copy-in /tmp/binaries /tmp' \
+            --keyring unstable.pgp \
+            --mode=root \
+            --variant=essential \
+            --architectures=amd64,armhf \
+            --include=openjdk-21-jdk-headless:armhf \
+            unstable /tmp/test-root sources.list
+
+


=====================================
debian/tests/control
=====================================
@@ -7,3 +7,8 @@ Tests: can-install-jre, can-install-multiple-jdks, 
can-install-libreoffice
 Depends: apt-utils, bash
 Restrictions: needs-root
 
+Tests: can-configure-cross-compilation
+# No depends, this is a test for a clean install
+Depends: apt-utils, bash, mmdebstrap, gpg, moreutils
+Restrictions: needs-root, allow-stderr
+Architecture: amd64



View it on GitLab: 
https://salsa.debian.org/java-team/ca-certificates-java/-/commit/d6bdcf124418f89320a6732a62339d69af1967c4

-- 
View it on GitLab: 
https://salsa.debian.org/java-team/ca-certificates-java/-/commit/d6bdcf124418f89320a6732a62339d69af1967c4
You're receiving this email because of your account on salsa.debian.org.


_______________________________________________
pkg-java-commits mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-java-commits

Reply via email to