OCaml 4.14.0 rebuild
[arch-packages.git] / java8-openjdk / trunk / install_jre8-openjdk-headless.sh
blob7a16809748f0fec502999e7b00ea33e8af4defcc
1 THIS_JRE='java-8-openjdk/jre'
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_JRE}
18 ${THIS_JRE} | ${THIS_JRE/\/jre})
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 if [ -z $(fix_default) ]; then
34 /usr/bin/archlinux-java set ${THIS_JRE}
37 if [ ! -f /etc/ssl/certs/java/cacerts ]; then
38 /usr/bin/update-ca-trust
42 pre_remove() {
43 default=$(fix_default)
44 if [ "x${default/\/jre}" = "x${THIS_JRE/\/jre}" ]; then
45 /usr/bin/archlinux-java unset
46 echo "No Java environment is set as default anymore"