Apache DataFusion SQL Query Engine
ARROW-2935: [Packaging] Add verify_binary_artifacts function to verify-release-candidate.sh
Phillip Cloud7a3481a88752
diff --git a/dev/release/02-source.sh b/dev/release/02-source.shindex fa1c3e3cad..a7347f88dd 100755--- a/dev/release/02-source.sh+++ b/dev/release/02-source.sh@@ -28,12 +28,28 @@ fiversion=$1rc=$2+artifact_dir=$3if [ -d tmp/ ]; thenecho "Cannot run: tmp/ exists"exitfi+if [ -z "$artifact_dir" ]; then+ echo "artifact_dir is empty"+ exit 1+fi++if [ ! -e "$artifact_dir" ]; then+ echo "$artifact_dir does not exist"+ exit 1+fi++if [ ! -d "$artifact_dir" ]; then+ echo "$artifact_dir is not a directory"+ exit 1+fi+tag=apache-arrow-${version}tagrc=${tag}-rc${rc}@@ -97,16 +113,22 @@ ${SOURCE_DIR}/run-rat.sh ${tarball}# sign the archivegpg --armor --output ${tarball}.asc --detach-sig ${tarball}-sha1sum $tarball > ${tarball}.sha1-sha256sum $tarball > ${tarball}.sha256-sha512sum $tarball > ${tarball}.sha512+shasum -a 1 $tarball > ${tarball}.sha1+shasum -a 256 $tarball > ${tarball}.sha256# check out the arrow RC foldersvn co --depth=empty https://dist.apache.org/repos/dist/dev/arrow tmp# add the release candidate for the tag-mkdir -p tmp/${tagrc}+mkdir -p tmp/${tagrc}/binaries++# copy the rc tarball into the tmp dircp ${tarball}* tmp/${tagrc}++# copy binary artifacts into a subdirectory of the rc dir+cp -rf "$artifact_dir"/* tmp/${tagrc}/binaries/++# commit to svnsvn add tmp/${tagrc}svn ci -m 'Apache Arrow ${version} RC${rc}' tmp/${tagrc}diff --git a/dev/release/verify-release-candidate.sh b/dev/release/verify-release-candidate.shindex ef058d172c..9a18bcefae 100755--- a/dev/release/verify-release-candidate.sh+++ b/dev/release/verify-release-candidate.sh@@ -63,15 +63,28 @@ fetch_archive() {download_rc_file ${dist_name}.tar.gzdownload_rc_file ${dist_name}.tar.gz.ascdownload_rc_file ${dist_name}.tar.gz.sha1- download_rc_file ${dist_name}.tar.gz.sha512+ download_rc_file ${dist_name}.tar.gz.sha256gpg --verify ${dist_name}.tar.gz.asc ${dist_name}.tar.gz- if [ "$(uname)" == "Darwin" ]; then- shasum -a 1 ${dist_name}.tar.gz | diff - ${dist_name}.tar.gz.sha1- shasum -a 512 ${dist_name}.tar.gz | diff - ${dist_name}.tar.gz.sha512- else- sha1sum ${dist_name}.tar.gz | diff - ${dist_name}.tar.gz.sha1- sha512sum ${dist_name}.tar.gz | diff - ${dist_name}.tar.gz.sha512- fi+ shasum -a 1 -c ${dist_name}.tar.gz.sha1+ shasum -a 256 -c ${dist_name}.tar.gz.sha256+}++verify_binary_artifacts() {+ # download the binaries folder for the current RC+ download_rc_file binaries++ # verify the signature and the checksums of each artifact+ find binaries -name '*.asc' | while read sigfile; do+ artifact=${sigfile/.asc/}+ gpg --verify $sigfile $artifact++ # go into the directory because the checksum files contain only the+ # basename of the artifact+ pushd $(dirname $artifact)+ shasum -a 1 -c $artifact.sha1+ shasum -a 256 -c $artifact.sha256+ popd+ done}setup_tempdir() {@@ -243,6 +256,7 @@ RC_NUMBER=$2TARBALL=apache-arrow-$1.tar.gzimport_gpg_keys+verify_binary_artifactsDIST_NAME="apache-arrow-${VERSION}"fetch_archive $DIST_NAME