HADOOP-18734. Create qbt.sh symlink on Windows (#5626)

This commit is contained in:
Gautham B A 2023-05-08 22:25:15 +05:30 committed by GitHub
parent 4ee92efb73
commit a80e3dba3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 1 deletions

View File

@ -171,7 +171,17 @@ if [[ -n "${GPGBIN}" && ! "${HADOOP_SKIP_YETUS_VERIFICATION}" = true ]]; then
fi
fi
if ! (gunzip -c "${TARBALL}.gz" | tar xpf -); then
if [[ "$IS_WINDOWS" && "$IS_WINDOWS" == 1 ]]; then
gunzip -c "${TARBALL}.gz" | tar xpf -
# One of the entries in the Yetus tarball unzips a symlink qbt.sh.
# The symlink creation fails on Windows, unless this CI is run as Admin or Developer mode is
# enabled.
# Thus, we create the qbt.sh symlink ourselves and move it to the target.
YETUS_PRECOMMIT_DIR="${YETUS_PREFIX}-${HADOOP_YETUS_VERSION}/lib/precommit"
ln -s "${YETUS_PRECOMMIT_DIR}/test-patch.sh" qbt.sh
mv qbt.sh "${YETUS_PRECOMMIT_DIR}"
elif ! (gunzip -c "${TARBALL}.gz" | tar xpf -); then
yetus_error "ERROR: ${TARBALL}.gz is corrupt. Investigate and then remove ${HADOOP_PATCHPROCESS} to try again."
exit 1
fi