1919DEFAULT_PACKAGE_GIT_URL=none
2020PACKAGE_DEPENDENCIES=" make-jpkg"
2121
22- if [[ " $UPSTREAM_PRODUCT_BRANCH " == " master" ]]; then
22+ case $( dpkg-architecture -q DEB_HOST_ARCH 2> /dev/null || echo " none" ) in
23+ amd64)
2324 _tarfile=" OpenJDK8U-jdk_x64_linux_hotspot_8u345b01.tar.gz"
2425 _tarfile_sha256=" ed6c9db3719895584fb1fd69fc79c29240977675f26631911c5a1dbce07b7d58"
2526 _jdk_path=" /usr/lib/jvm/adoptopenjdk-java8-jdk-amd64"
26- else
27- _tarfile=" OpenJDK8U-jdk_x64_linux_hotspot_8u345b01.tar.gz"
28- _tarfile_sha256=" ed6c9db3719895584fb1fd69fc79c29240977675f26631911c5a1dbce07b7d58"
29- _jdk_path=" /usr/lib/jvm/adoptopenjdk-java8-jdk-amd64"
30- fi
27+ ;;
28+ arm64)
29+ _tarfile=" OpenJDK8U-jdk_aarch64_linux_hotspot_8u345b01.tar.gz"
30+ _tarfile_sha256=" c1965fb24dded7d7944e2da36cd902adf3b7b1d327aaa21ea507cff00a5a0090"
31+ _jdk_path=" /usr/lib/jvm/adoptopenjdk-java8-jdk-arm64"
32+ ;;
33+ * ) ;;
34+
35+ esac
3136
3237function prepare() {
3338 logmust install_pkgs " $DEPDIR " /make-jpkg/* .deb
3439}
3540
3641function fetch() {
42+ # We exit here rather than above in the architecture detection logic
43+ # to deal with the fact that this file can, during test runs, be
44+ # sourced on platforms where builds are not happening. list-packages
45+ # sources the file to gather information about the package, and this
46+ # is performed on jenkins and macos during test runs. Having the exit
47+ # occur above causes those runs to fail.
48+ if [[ -z " $_tarfile " ]]; then
49+ echo " Invalid architecture detected" >&2
50+ exit 1
51+ fi
3752 logmust cd " $WORKDIR /"
3853
3954 local url=" http://artifactory.delphix.com/artifactory/java-binaries/linux/jdk/8/$_tarfile "
@@ -42,6 +57,10 @@ function fetch() {
4257}
4358
4459function build() {
60+ if [[ -z " $_tarfile " ]]; then
61+ echo " Invalid architecture detected" >&2
62+ exit 1
63+ fi
4564 logmust cd " $WORKDIR /"
4665
4766 logmust env DEB_BUILD_OPTIONS=nostrip fakeroot make-jpkg " $_tarfile " <<< y
0 commit comments