openjdk: revert to a semi-manual installation

Unfortunately, using package-installs means there is no way to set the
proper openjdk package depending on the version of the distro, and so
far it is hardcoded to 7. On Fedora >= 21, the default openjdk is 8, and
due to bugs in yum [1] this has not caused build errors so far, but
leaving a java-less image.

The chosen solution is to not use package-installs anymore, still using
pkg-map (called manually) to give the right name for the built distro.
The default is still set to install openjdk v7 everywhere, as before;
as drawback, building images based on Fedora >= 21 (which is the default
in diskimage-builder since version 0.1.43) will fail hard now.

[1] like not exiting when asking to install non-existing packages if
specified together with existing ones

Change-Id: I53195daa8d29b15dcae548eb76c5c9efb6ad50ef
This commit is contained in:
Pino Toscano 2015-07-02 17:01:27 +02:00
parent 23f07512b6
commit 13adb9ad43
3 changed files with 17 additions and 2 deletions

View File

@ -1,2 +1,2 @@
java
package-installs
pkg-map

View File

@ -8,6 +8,22 @@ set -o pipefail
echo "Installing OpenJDK"
default_jdk_version_for_distro () {
case "$DISTRO_NAME" in
centos | fedora | rhel | ubuntu )
echo "7"
;;
*)
echo "Unknown OpenJDK distro: $DISTRO_NAME" >&2
exit 1
;;
esac
}
pkg=openjdk-$(default_jdk_version_for_distro)
pkg=$(pkg-map --element openjdk $pkg)
install-packages $pkg
case "$DISTRO_NAME" in
ubuntu )
JRE_PATH=$(update-alternatives --list java)

View File

@ -1 +0,0 @@
openjdk-7: