From b9769d5af5e4be7a1c285ccf06df8a608d9d5825 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 31 May 2015 13:28:57 -0600 Subject: librefetch: Don't try to use makepkg to create .sig files. --- test/librefetch-test.sh | 28 ++++++++++++++++++++++++++++ test/librefetch.d/PKGBUILD | 2 +- test/librefetch.d/PKGBUILD-recurse | 18 ++++++++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 test/librefetch.d/PKGBUILD-recurse (limited to 'test') diff --git a/test/librefetch-test.sh b/test/librefetch-test.sh index 8dd957a..f10ee7f 100644 --- a/test/librefetch-test.sh +++ b/test/librefetch-test.sh @@ -4,6 +4,9 @@ describe librefetch . ./test-common.sh +KEYSERVER=hkp://pool.sks-keyservers.net +GPG="gpg --quiet --batch --no-tty --no-permission-warning --keyserver ${KEYSERVER}" + before() { _before @@ -28,6 +31,17 @@ EOF 'MIRRORS=("phony://example.com/dir/")' \ 'DOWNLOADER=/usr/bin/false' \ > "$XDG_CONFIG_HOME/libretools/librefetch.conf" + + printf '%s\n' \ + 'Key-Type: RSA' \ + 'Key-Length: 1024' \ + 'Key-Usage: sign' \ + 'Name-Real: Temporary LibreTools testsuite key' \ + 'Name-Email: libretools-test@localhost' \ + 'Expire-Date: 0' \ + '%no-protection' \ + '%commit' \ + | $GPG --gen-key 2>/dev/null } after() { @@ -68,4 +82,18 @@ it_runs() { # unfortunately). bsdtar tf "$tmpdir/srcdest/$srcball" > list-pkg.txt diff -u list.txt list-pkg.txt + # Verify that the signature was created and matches + gpg --quiet --verify "$tmpdir/srcdest/$srcball"{.sig,} 2>/dev/null +} + +it_recurses() { + local srcball=testpkg-1.0.tar.gz + cp librefetch.d/* "$tmpdir/" + cd "$tmpdir" + mv PKGBUILD{-recurse,} + + makepkg -g + bsdtar tf "$tmpdir/srcdest/$srcball" > list-pkg.txt + diff -u list.txt list-pkg.txt + gpg --quiet --verify "$tmpdir/srcdest/$srcball"{.sig,} 2>/dev/null } diff --git a/test/librefetch.d/PKGBUILD b/test/librefetch.d/PKGBUILD index db80db3..6547e25 100644 --- a/test/librefetch.d/PKGBUILD +++ b/test/librefetch.d/PKGBUILD @@ -3,7 +3,7 @@ pkgver=1.0 pkgrel=1 pkgdesc=foo arch=(any) -source=("libre://$pkgname-$pkgver.tar.gz") +source=("libre://$pkgname-$pkgver.tar.gz"{,.sig}) mksource() { mkdir "$srcdir/bar" diff --git a/test/librefetch.d/PKGBUILD-recurse b/test/librefetch.d/PKGBUILD-recurse new file mode 100644 index 0000000..fad5976 --- /dev/null +++ b/test/librefetch.d/PKGBUILD-recurse @@ -0,0 +1,18 @@ +pkgname=testpkg +pkgver=1.0 +pkgrel=1 +pkgdesc=foo +arch=(any) +source=("libre://$pkgname-$pkgver.tar.gz.sig") + +mksource() { + mkdir "$srcdir/bar" + local file + for file in '~foo' '~a' a A; do + touch "$srcdir/bar/$file" + done +} + +package() { + :; +} -- cgit v1.2.3-54-g00ecf