Skip to content

Commit 9cee4cf

Browse files
committed
singleton-jdk: adjustments for EPEL
Special-case handling of JAVA_VENDOR and JAVA_VERSION for the EPEL packages. This prevents singleton-jdk from removing all the java packages. Signed-off-by: Jonathan Dowland <jdowland@redhat.com>
1 parent 762dae9 commit 9cee4cf

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

modules/jdk/latest/module.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ envs:
1616
- name: "JAVA_HOME"
1717
value: "/usr/lib/jvm/java-25"
1818
- name: "JAVA_VENDOR"
19-
value: "openjdk"
19+
value: "epel"
2020
- name: "JAVA_VERSION"
2121
value: *jdkver
2222
- name: JBOSS_CONTAINER_OPENJDK_JDK_MODULE

modules/singleton-jdk/configure.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#!/bin/sh
2-
set -u
3-
set -e
1+
#!/bin/bash
2+
set -ueo pipefail
3+
set -x
44

55
if [ -z "$JAVA_VERSION" ]; then
66
echo "JAVA_VERSION needs to be defined to use this module" >&2
@@ -11,6 +11,15 @@ if [ -z "$JAVA_VENDOR" ]; then
1111
exit 1
1212
fi
1313

14+
# java-latest/EPEL does not follow the pattern expected
15+
if [ "$JAVA_VENDOR" = "epel" ]; then
16+
JAVA_VERSION=latest
17+
JAVA_VENDOR=openjdk
18+
fi
19+
1420
# Clean up any java-* packages that have been installed that do not match
1521
# our stated JAVA_VERSION-JAVA_VENDOR (e.g.: 11-openjdk; 1.8.0-openj9)
1622
rpm -e --nodeps $(rpm -qa java-* | grep -v "^java-${JAVA_VERSION}-${JAVA_VENDOR}")
23+
24+
# sanity check: there should still be a java installed
25+
command -v java

0 commit comments

Comments
 (0)