1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/docs/tools/sign_releases.sh Tue Apr 11 21:41:22 2017 +0200
1.3 @@ -0,0 +1,39 @@
1.4 +#!/bin/sh
1.5 +
1.6 +DIRNAME=`dirname "$0"`
1.7 +PROGNAME=`basename "$0"`
1.8 +
1.9 +if [ ! "$1" ] || [ "$1" = '--help' ] ; then
1.10 + cat 1>&2 <<EOF
1.11 +Usage: $PROGNAME <archive directory> [ -f ]
1.12 +
1.13 +Sign archives in the given archive directory, invoking GPG to produce a
1.14 +detached signature. If a signature already exists for an archive, it is not
1.15 +regenerated unless the -f (force) option is given.
1.16 +
1.17 +All newly-created signature filenames are emitted on standard output.
1.18 +EOF
1.19 + exit 1
1.20 +fi
1.21 +
1.22 +OUTDIR=$1
1.23 +FORCE=$2
1.24 +
1.25 +if [ "$FORCE" != '-f' ]; then
1.26 + FORCE=
1.27 +fi
1.28 +
1.29 +if [ ! -e "$OUTDIR" ]; then
1.30 + cat 1>&2 <<EOF
1.31 +No archive directory to process.
1.32 +EOF
1.33 + exit 1
1.34 +fi
1.35 +
1.36 +for FILENAME in "$OUTDIR/"*".tar.bz2" ; do
1.37 + OUTFILE="$FILENAME.asc"
1.38 + if [ ! -e "$OUTFILE" ] || [ "$FORCE" ]; then
1.39 + gpg --sign -a -b "$FILENAME"
1.40 + echo "$OUTFILE"
1.41 + fi
1.42 +done