diff --git a/sbin/prepareWorkspace.sh b/sbin/prepareWorkspace.sh index 228c6be60..59c95f96f 100644 --- a/sbin/prepareWorkspace.sh +++ b/sbin/prepareWorkspace.sh @@ -103,6 +103,8 @@ checkoutAndCloneOpenJDKGitRepo() { updateOpenj9Sources + createSourceTagFile + cd "${BUILD_CONFIG[WORKSPACE_DIR]}" } @@ -628,6 +630,25 @@ applyPatches() { fi } +# jdk8u requires a .hgtip file to populate the "SOURCE" tag in the release file. +# Creates .hgtip and populates it with the git sha of the last commit(s). +createSourceTagFile(){ + if [ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK8_CORE_VERSION}" ]; then + local OpenJDK_TopDir="${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}" + local OpenJDK_SHA=$(git -C $OpenJDK_TopDir rev-parse --short HEAD) + if [ "${BUILD_CONFIG[BUILD_VARIANT]}" == "${BUILD_VARIANT_OPENJ9}" ]; then + # OpenJ9 list 3 SHA's in their release file: OpenJDK, OpenJ9, and OMR. + local OpenJ9_TopDir="$OpenJDK_TopDir/openj9" + local OMR_TopDir="$OpenJDK_TopDir/omr" + local OpenJ9_SHA=$(git -C $OpenJ9_TopDir rev-parse --short HEAD) + local OMR_SHA=$(git -C $OMR_TopDir rev-parse --short HEAD) + (printf "OpenJDK: %s OpenJ9: %s OMR: %s" $OpenJDK_SHA $OpenJ9_SHA $OMR_SHA) > $OpenJDK_TopDir/.hgtip + else # Other variants only list the main repo SHA. + (printf "OpenJDK: %s" $OpenJDK_SHA) > $OpenJDK_TopDir/.hgtip + fi + fi +} + ################################################################## function configureWorkspace() {