commit 91813055280596c05d569a993cb35fa28e9c4bb1 Author: Sahil Takiar Date: Fri Apr 13 12:49:49 2018 -0700 HIVE-19212: Fix findbugs yetus pre-commit checks diff --git a/dev-support/yetus-wrapper.sh b/dev-support/yetus-wrapper.sh index 58da1d29df..3a814d5916 100755 --- a/dev-support/yetus-wrapper.sh +++ b/dev-support/yetus-wrapper.sh @@ -91,34 +91,6 @@ if [[ $? != 0 ]]; then fi HIVE_PATCHPROCESS=${mytmpdir} -CURLBIN=$(command -v curl) - -# Set FindBugs Home -FINDBUGS_VERSION="3.0.1" -if [[ ! -d "${HIVE_PATCHPROCESS}/findbugs-${FINDBUGS_VERSION}/" ]]; then - # Download FindBugs - FINDBUGS_BASEURL="http://prdownloads.sourceforge.net/findbugs/" - FINDBUGS_TARBALL="findbugs-${FINDBUGS_VERSION}.tar" - - pushd "${HIVE_PATCHPROCESS}" >/dev/null - if [[ -n "${CURLBIN}" ]]; then - "${CURLBIN}" -f -s -L -O "${FINDBUGS_BASEURL}/${FINDBUGS_TARBALL}.gz" - if [[ $? != 0 ]]; then - yetus_error "ERROR: yetus-dl: unable to download ${FINDBUGS_BASEURL}/${FINDBUGS_TARBALL}.gz" - exit 1 - fi - fi - - gunzip -c "${FINDBUGS_TARBALL}.gz" | tar xpf - - if [[ $? != 0 ]]; then - yetus_error "ERROR: ${FINDBUGS_TARBALL}.gz is corrupt. Investigate and then remove ${HIVE_PATCHPROCESS} to try again." - exit 1 - fi - popd >/dev/null -fi - -export FINDBUGS_HOME=${HIVE_PATCHPROCESS}/findbugs-${FINDBUGS_VERSION} - ## ## if we've already DL'd it, then short cut ## @@ -130,10 +102,11 @@ fi ## need to DL, etc ## -YETUS_BASEURL="https://archive.apache.org/dist/yetus/${HIVE_YETUS_VERSION}/" -YETUS_TARBALL="yetus-${HIVE_YETUS_VERSION}-bin.tar" +BASEURL="https://archive.apache.org/dist/yetus/${HIVE_YETUS_VERSION}/" +TARBALL="yetus-${HIVE_YETUS_VERSION}-bin.tar" GPGBIN=$(command -v gpg) +CURLBIN=$(command -v curl) pushd "${HIVE_PATCHPROCESS}" >/dev/null if [[ $? != 0 ]]; then @@ -142,9 +115,9 @@ if [[ $? != 0 ]]; then fi if [[ -n "${CURLBIN}" ]]; then - "${CURLBIN}" -f -s -L -O "${YETUS_BASEURL}/${YETUS_TARBALL}.gz" + "${CURLBIN}" -f -s -L -O "${BASEURL}/${TARBALL}.gz" if [[ $? != 0 ]]; then - yetus_error "ERROR: yetus-dl: unable to download ${YETUS_BASEURL}/${YETUS_TARBALL}.gz" + yetus_error "ERROR: yetus-dl: unable to download ${BASEURL}/${TARBALL}.gz" exit 1 fi else @@ -168,9 +141,9 @@ if [[ -n "${GPGBIN}" ]]; then yetus_error "ERROR: yetus-dl: unable to fetch https://dist.apache.org/repos/dist/release/yetus/KEYS" exit 1 fi - "${CURLBIN}" -s -L -O "${YETUS_BASEURL}/${YETUS_TARBALL}.gz.asc" + "${CURLBIN}" -s -L -O "${BASEURL}/${TARBALL}.gz.asc" if [[ $? != 0 ]]; then - yetus_error "ERROR: yetus-dl: unable to fetch ${YETUS_BASEURL}/${YETUS_TARBALL}.gz.asc" + yetus_error "ERROR: yetus-dl: unable to fetch ${BASEURL}/${TARBALL}.gz.asc" exit 1 fi "${GPGBIN}" --homedir "${HIVE_PATCHPROCESS}/.gpg" --import "${HIVE_PATCHPROCESS}/KEYS_YETUS" >/dev/null 2>&1 @@ -178,16 +151,16 @@ if [[ -n "${GPGBIN}" ]]; then yetus_error "ERROR: yetus-dl: gpg unable to import ${HIVE_PATCHPROCESS}/KEYS_YETUS" exit 1 fi - "${GPGBIN}" --homedir "${HIVE_PATCHPROCESS}/.gpg" --verify "${YETUS_TARBALL}.gz.asc" >/dev/null 2>&1 + "${GPGBIN}" --homedir "${HIVE_PATCHPROCESS}/.gpg" --verify "${TARBALL}.gz.asc" >/dev/null 2>&1 if [[ $? != 0 ]]; then yetus_error "ERROR: yetus-dl: gpg verify of tarball in ${HIVE_PATCHPROCESS} failed" exit 1 fi fi -gunzip -c "${YETUS_TARBALL}.gz" | tar xpf - +gunzip -c "${TARBALL}.gz" | tar xpf - if [[ $? != 0 ]]; then - yetus_error "ERROR: ${YETUS_TARBALL}.gz is corrupt. Investigate and then remove ${HIVE_PATCHPROCESS} to try again." + yetus_error "ERROR: ${TARBALL}.gz is corrupt. Investigate and then remove ${HIVE_PATCHPROCESS} to try again." exit 1 fi diff --git a/testutils/ptest2/src/main/resources/yetus-exec.vm b/testutils/ptest2/src/main/resources/yetus-exec.vm index 7465391f8a..b58383453b 100644 --- a/testutils/ptest2/src/main/resources/yetus-exec.vm +++ b/testutils/ptest2/src/main/resources/yetus-exec.vm @@ -19,6 +19,7 @@ set -x date +"%Y-%m-%d %T.%3N" pushd ${workingDir} +export FINDBUGS_HOME=/usr export JIRA_ISSUE=${jiraName} export JAVA_HOME=${javaHome} export PATH=$JAVA_HOME/bin/:$PATH