nix-tools/bin/signpkg.in
2014-10-04 21:50:00 +02:00

40 lines
1.1 KiB
Bash

#!/bin/bash
# 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.
# 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
# }
if [[ -r @libdir@/functions.sh ]];then
source @libdir@/functions.sh
fi
. /etc/makepkg.conf
if [ ! -e "$1" ]; then
error "Package '$1' does not exists!"
exit 1
fi
msg "Signing package '$1' with key ${GPGKEY}..."
gpg --detach-sign --use-agent -u "${GPGKEY}" "$1"