HBASE-24572 release scripts should try to use a keyid when refering to GPG keys. (#2001)

Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
This commit is contained in:
Sean Busbey 2020-08-01 22:28:23 -05:00 committed by GitHub
parent e22a2d2700
commit fe5571bfe6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -236,6 +236,14 @@ function get_release_info {
GIT_EMAIL="$ASF_USERNAME@apache.org"
GPG_KEY="$(read_config "GPG_KEY" "$GIT_EMAIL")"
if ! GPG_KEY_ID=$("${GPG}" "${GPG_ARGS[@]}" --keyid-format 0xshort --list-public-key "${GPG_KEY}" | grep "\[S\]" | grep -o "0x[0-9A-F]*") ||
[ -z "${GPG_KEY_ID}" ] ; then
GPG_KEY_ID=$("${GPG}" "${GPG_ARGS[@]}" --keyid-format 0xshort --list-public-key "${GPG_KEY}" | head -n 1 | grep -o "0x[0-9A-F]*" || true)
fi
read -r -p "We think the key '${GPG_KEY}' corresponds to the key id '${GPG_KEY_ID}'. Is this correct [y/n]? " ANSWER
if [ "$ANSWER" = "y" ]; then
GPG_KEY="${GPG_KEY_ID}"
fi
export API_DIFF_TAG ASF_USERNAME GIT_NAME GIT_EMAIL GPG_KEY
cat <<EOF