archrelease: copy trunk to staging-x86_64
[arch-packages.git] / java-openjdk / repos / extra-x86_64 / install_jdk-openjdk.sh
blob434c51b96055947edf7ba5d918a2dac264293f35
1 THIS_JDK='java-20-openjdk'
3 fix_default() {
4 if [ ! -x /usr/bin/java ]; then
5 /usr/bin/archlinux-java unset
6 echo ""
7 else
8 /usr/bin/archlinux-java get
9 fi
12 post_install() {
13 default=$(fix_default)
14 case ${default} in
15 "")
16 /usr/bin/archlinux-java set ${THIS_JDK}
18 ${THIS_JDK})
19 # Nothing
22 echo "Default Java environment is already set to '${default}'"
23 echo "See 'archlinux-java help' to change it"
25 esac
27 if [ ! -f /etc/ssl/certs/java/cacerts ]; then
28 /usr/bin/update-ca-trust
32 post_upgrade() {
33 default=$(fix_default)
34 if [ -z "${default}" ]; then
35 /usr/bin/archlinux-java set ${THIS_JDK}
38 if [ ! -f /etc/ssl/certs/java/cacerts ]; then
39 /usr/bin/update-ca-trust
43 pre_remove() {
44 if [ "x$(fix_default)" = "x${THIS_JDK}" ]; then
45 # Check JRE is still available
46 if [ -x /usr/lib/jvm/${THIS_JDK}/bin/java ]; then
47 /usr/bin/archlinux-java unset