Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLING-8029 Retrieve gpg key automatically if it is missing in keyring #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions check_staged_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,24 @@ echo "##########################################################################
echo " CHECK SIGNATURES AND DIGESTS "
echo "################################################################################"

for i in `find "${DOWNLOAD}/${STAGING}" -type f | grep -v '\.\(asc\|sha1\|md5\)$'`
KEYSERVER="pool.sks-keyservers.net"

for f in `find "${DOWNLOAD}/${STAGING}" -type f | grep -v '\.\(asc\|sha1\|md5\|log\)$'`
do
f=`echo $i | sed 's/\.asc$//'`
echo "$f"
gpg --verify $f.asc 2>/dev/null
if [ "$?" = "0" ]; then CHKSUM="GOOD"; else CHKSUM="BAD!!!!!!!!"; fi
if [ ! -f "$f.asc" ]; then CHKSUM="----"; fi
echo "gpg: ${CHKSUM}"
if [[ ! "$f" =~ 'maven-metadata.xml' ]]; then

VERIFY_RESULT_FILE="$f.asc.verify-result.log"
gpg --auto-key-retrieve --keyserver $KEYSERVER --verify $f.asc 2> $VERIFY_RESULT_FILE
if [ "$?" = "0" ]; then CHKSUM="GOOD"; else
CHKSUM="BAD!!!!!!!!";
echo "gpg error:"
cat $VERIFY_RESULT_FILE
fi
if [ ! -f "$f.asc" ]; then CHKSUM="BAD - file $f.asc missing"; fi
echo " gpg: ${CHKSUM}"

fi

for tp in md5 sha1
do
Expand All @@ -50,7 +60,7 @@ do
B="`openssl $tp < $f 2>/dev/null | sed 's/.*= *//' `"
if [ "$A" = "$B" ]; then CHKSUM="GOOD (`cat $f.$tp`)"; else CHKSUM="BAD!! : $A not equal to $B"; fi
fi
echo "$tp : ${CHKSUM}"
echo " $tp : ${CHKSUM}"
done

done
Expand Down