diff options
author | Colin Walters <walters@verbum.org> | 2014-01-30 17:17:36 -0500 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2014-01-30 17:17:36 -0500 |
commit | f36cc6a44ce8c495ff79aa2a9a11213bd9d413c8 (patch) | |
tree | 092e54f9e0f78e244d75e2df5a36f66519290b9d /src | |
parent | ffb19aef9afe7ad496ce947ca6787b0d92a8f422 (diff) | |
download | ostree-f36cc6a44ce8c495ff79aa2a9a11213bd9d413c8.tar.gz |
repo: Improve GPG error messages
The signing test is failing here on EL7 beta for me - it seems like
gnupg isn't honoring the homedir.
Diffstat (limited to 'src')
-rw-r--r-- | src/libostree/ostree-repo.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c index 2309a862..d9938d92 100644 --- a/src/libostree/ostree-repo.c +++ b/src/libostree/ostree-repo.c @@ -1549,14 +1549,23 @@ ostree_repo_sign_commit (OstreeRepo *self, } info = gpgme_ctx_get_engine_info (context); + + if ((err = gpgme_set_protocol (context, GPGME_PROTOCOL_OpenPGP)) != + GPG_ERR_NO_ERROR) + { + g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, + "Unable to set gpg protocol"); + goto out; + } if (homedir != NULL) { - if ((err = gpgme_ctx_set_engine_info (context, info->protocol, info->file_name, homedir)) + if ((err = gpgme_ctx_set_engine_info (context, info->protocol, "ostree", homedir)) != GPG_ERR_NO_ERROR) { g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, - "Unable to set gpg homedir"); + "Unable to set gpg homedir to '%s'", + homedir); goto out; } } @@ -1565,7 +1574,8 @@ ostree_repo_sign_commit (OstreeRepo *self, if ((err = gpgme_get_key (context, key_id, &key, 1)) != GPG_ERR_NO_ERROR) { g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, - "No gpg key found with the given key-id"); + "No gpg key found with ID %s (homedir: %s)", key_id, + homedir ? homedir : "<default>"); goto out; } |