2015-04-20 11:41:47 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Helper for signing images
|
|
|
|
#
|
|
|
|
DIR=$1
|
|
|
|
ARCH=$2
|
|
|
|
|
|
|
|
KEYID=42468F4009EA8AC3
|
|
|
|
|
|
|
|
cd $DIR/$ARCH
|
|
|
|
|
2017-06-06 12:10:48 +00:00
|
|
|
# Sigh. GPG2 needs a different command line :-(
|
|
|
|
# Try to detect what we have
|
|
|
|
gpg --help | grep -q "server mode"
|
|
|
|
if [ $? -eq 0 ] ; then
|
|
|
|
GPG2_OPTS=" --pinentry-mode=loopback"
|
|
|
|
fi
|
|
|
|
|
2015-04-20 11:41:47 +00:00
|
|
|
for file in $(find . -name '*SUMS' \
|
|
|
|
-o -name *SUMS.small \
|
|
|
|
-o -name *SUMS.large); do
|
|
|
|
gpg -q -a --detach-sign \
|
2017-06-06 12:10:48 +00:00
|
|
|
$GPG2_OPTS \
|
2015-04-20 11:41:47 +00:00
|
|
|
--batch --no-tty \
|
|
|
|
--passphrase-file ~/.testing-pass \
|
|
|
|
-u $KEYID \
|
|
|
|
$file 2>&1 > gpg.log
|
|
|
|
error=$?
|
|
|
|
if [ $error -ne 0 ] ; then
|
|
|
|
echo " FAIL:"
|
|
|
|
cat gpg.log
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
mv $file.asc $file.sign > gpg.log 2>&1
|
|
|
|
if [ $error -ne 0 ] ; then
|
|
|
|
echo " FAIL:"
|
|
|
|
cat gpg.log
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
rm -f gpg.log
|