testpkg: set gpgdir

Without setting gpgdir, testpkg outputs:
warning: Public keyring not found; have you run 'pacman-key --init'?

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Allan McRae 2012-02-11 16:56:02 +10:00 committed by Dan McGee
parent 7a3f59cd66
commit e530993392
2 changed files with 5 additions and 0 deletions

View File

@ -1,6 +1,7 @@
# paths set at make time
conffile = ${sysconfdir}/pacman.conf
dbpath = ${localstatedir}/lib/pacman/
gpgdir = ${sysconfdir}/pacman.d/gnupg/
cachedir = ${localstatedir}/cache/pacman/pkg/
bin_PROGRAMS = vercmp testpkg testdb cleanupdelta pacsort pactree
@ -8,6 +9,7 @@ bin_PROGRAMS = vercmp testpkg testdb cleanupdelta pacsort pactree
DEFS = -DLOCALEDIR=\"@localedir@\" \
-DCONFFILE=\"$(conffile)\" \
-DDBPATH=\"$(dbpath)\" \
-DGPGDIR=\"$(gpgdir)\" \
-DCACHEDIR=\"$(cachedir)\" \
@DEFS@

View File

@ -59,6 +59,9 @@ int main(int argc, char *argv[])
/* let us get log messages from libalpm */
alpm_option_set_logcb(handle, output_cb);
/* set gpgdir to default */
alpm_option_set_gpgdir(handle, GPGDIR);
if(alpm_pkg_load(handle, argv[1], 1, level, &pkg) == -1
|| pkg == NULL) {
err = alpm_errno(handle);