nix-tools/bin/signpkg

38 lines
987 B
Text
Raw Normal View History

2014-10-04 00:46:40 +02:00
#!/bin/bash
2014-10-04 15:41:22 +02:00
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
2014-10-04 00:46:40 +02:00
err() {
ALL_OFF="\e[1;0m"
BOLD="\e[1;1m"
RED="${BOLD}\e[1;31m"
local mesg=$1; shift
printf "${RED}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
}
msg() {
ALL_OFF="\e[1;0m"
BOLD="\e[1;1m"
GREEN="${BOLD}\e[1;32m"
local mesg=$1; shift
printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
}
. /etc/makepkg.conf
if [ ! -e "$1" ]; then
err "Package '$1' does not exists!"
exit 1
fi
msg "Signing package '$1' with key ${GPGKEY}..."
gpg --detach-sign --use-agent -u "${GPGKEY}" "$1"