File: can-install-jre

package info (click to toggle)
ca-certificates-java 20240118
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 184 kB
  • sloc: java: 309; sh: 255; xml: 30; makefile: 24
file content (28 lines) | stat: -rw-r--r-- 823 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash

set -e

versions=$(apt-cache -n search jre-headless | awk '{print $1}')
for version in ${versions}
do
# WHEN openjdk-jre-headless package is installed from scratch

    # Java 18 is EOL 09.2022 but is present in Lunar so that we could do clean
    # builds. Ignore it in certificate tests
    if [[ ${version} == "openjdk-18-jre-headless" ]];
    then
        continue
    fi
    output=`mktemp`
    echo "installing ${version}"
    apt-get install -y ${version} | tee ${output}
# THEN installation is successfull
# AND certificates are updated
    if [[ $(grep -L "Adding debian:Amazon_Root_CA_1.pem" ${output}) ]]; then
        echo "Certificates were not imported !!!"
        exit 255
    fi
    rm $output
    # purge in order to remove keytstore
    apt-get purge -y ca-certificates-java ${version}
done