#!/bin/sh set -eu if test "$1" = "" ; then echo "I need a package as an argument." exit 1 fi PACKAGEFILE=$1 if test ! -f "$PACKAGEFILE" ; then echo "$PACKAGEFILE is not a file." exit 1 fi DIGESTNAME=sha256 DIGESTOUTPUT=`gpg --print-md $DIGESTNAME $PACKAGEFILE` RAWDIGEST=`gpg --print-md $DIGESTNAME $PACKAGEFILE | sed -e 's/^[^ ]*: //' ` # These regexes are a little fragile, but I think they work for us. VERSION=`echo $PACKAGEFILE | sed -e 's/^[a-z\-]*//' -e 's/\.[\.a-z]*$//' ` PACKAGE=`echo $PACKAGEFILE | sed -e 's/-[0-9].*//'` SIGFILE_UNSIGNED="$PACKAGE-$VERSION-signature" SIGNATUREFILE="$SIGFILE_UNSIGNED.asc" cat >$SIGFILE_UNSIGNED <