summaryrefslogtreecommitdiffstats
path: root/test/lib/common.inc
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2011-12-18 14:16:30 +0100
committerPierre Schmitz <pierre@archlinux.de>2011-12-18 14:16:30 +0100
commit2b7bb0c6b7aa4f7a43c82db1cf9a18d27600c62e (patch)
tree215c7aacc2d23b6b553f8b1f1d033273fea571cd /test/lib/common.inc
parenta8b219b325cd642a781a64d8e08a0e66d25c1b44 (diff)
downloaddbscripts-2b7bb0c6b7aa4f7a43c82db1cf9a18d27600c62e.tar.gz
dbscripts-2b7bb0c6b7aa4f7a43c82db1cf9a18d27600c62e.tar.xz
Validate package signatures on db-update
Diffstat (limited to 'test/lib/common.inc')
-rw-r--r--test/lib/common.inc29
1 files changed, 25 insertions, 4 deletions
diff --git a/test/lib/common.inc b/test/lib/common.inc
index a2dee10..e0e7048 100644
--- a/test/lib/common.inc
+++ b/test/lib/common.inc
@@ -3,6 +3,21 @@ set -E
. "$(dirname ${BASH_SOURCE[0]})/../../config"
. "$(dirname ${BASH_SOURCE[0]})/../../db-functions"
+signpkg() {
+ if [[ -r '/etc/makepkg.conf' ]]; then
+ source '/etc/makepkg.conf'
+ else
+ die '/etc/makepkg.conf not found!'
+ fi
+ if [[ -r ~/.makepkg.conf ]]; then
+ . ~/.makepkg.conf
+ fi
+ if [[ -n $GPGKEY ]]; then
+ SIGNWITHKEY="-u ${GPGKEY}"
+ fi
+ gpg --detach-sign --use-agent ${SIGNWITHKEY} ${@} || die
+}
+
oneTimeSetUp() {
local p
local d
@@ -110,18 +125,24 @@ releasePackage() {
local repo=$1
local pkgbase=$2
local arch=$3
+ local a
+ local p
+ local pkgver
+ local pkgname
pushd "${TMP}/svn-packages-copy"/${pkgbase}/trunk/ >/dev/null
archrelease ${repo}-${arch} >/dev/null 2&>1
pkgver=$(. PKGBUILD; echo $(get_full_version ${epoch:-0} ${pkgver} ${pkgrel}))
+ pkgname=($(. PKGBUILD; echo ${pkgname[@]}))
popd >/dev/null
cp "${pkgdir}/${pkgbase}"/*-${pkgver}-${arch}${PKGEXT} "${STAGING}"/${repo}/
if ${REQUIRE_SIGNATURE}; then
- # TODO: really sign the packages with a valid key
- find "${STAGING}"/${repo}/ -type f \
- -name "*-${pkgver}-${arch}${PKGEXT}" \
- -exec touch {}.sig \;
+ for a in ${arch[@]}; do
+ for p in ${pkgname[@]}; do
+ signpkg "${STAGING}"/${repo}/${p}-${pkgver}-${a}${PKGEXT}
+ done
+ done
fi
}