summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/handle.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2008-12-07 20:12:33 +0100
committerDan McGee <dan@archlinux.org>2011-03-23 09:16:29 +0100
commit4ae902ec5fb286a7826214f73f718a41cdf82ddb (patch)
tree93dde96133c67e8b849aef8999d798bf1295c5e1 /lib/libalpm/handle.c
parent39ce9b3afc6a544c2a5137bb58012d32723096e3 (diff)
downloadpacman-4ae902ec5fb286a7826214f73f718a41cdf82ddb.tar.gz
pacman-4ae902ec5fb286a7826214f73f718a41cdf82ddb.tar.xz
Add signature directory as option on libalpm handle
This will serve as the home directory we pass to GPGME when making calls so we can have a libalpm-utilized keyring. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/handle.c')
-rw-r--r--lib/libalpm/handle.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c
index 442e99df..42c0cd1f 100644
--- a/lib/libalpm/handle.c
+++ b/lib/libalpm/handle.c
@@ -84,6 +84,7 @@ void _alpm_handle_free(pmhandle_t *handle)
FREE(handle->logfile);
FREE(handle->lockfile);
FREE(handle->arch);
+ FREE(handle->signaturedir);
FREELIST(handle->dbs_sync);
FREELIST(handle->noupgrade);
FREELIST(handle->noextract);
@@ -174,6 +175,15 @@ const char SYMEXPORT *alpm_option_get_lockfile()
return handle->lockfile;
}
+const char SYMEXPORT *alpm_option_get_signaturedir()
+{
+ if (handle == NULL) {
+ pm_errno = PM_ERR_HANDLE_NULL;
+ return NULL;
+ }
+ return handle->signaturedir;
+}
+
int SYMEXPORT alpm_option_get_usesyslog()
{
if (handle == NULL) {
@@ -460,6 +470,24 @@ int SYMEXPORT alpm_option_set_logfile(const char *logfile)
return 0;
}
+int SYMEXPORT alpm_option_set_signaturedir(const char *signaturedir)
+{
+ ALPM_LOG_FUNC;
+
+ if(!signaturedir) {
+ pm_errno = PM_ERR_WRONG_ARGS;
+ return -1;
+ }
+
+ if(handle->signaturedir) {
+ FREE(handle->signaturedir);
+ }
+ handle->signaturedir = strdup(signaturedir);
+
+ _alpm_log(PM_LOG_DEBUG, "option 'signaturedir' = %s\n", handle->signaturedir);
+ return 0;
+}
+
void SYMEXPORT alpm_option_set_usesyslog(int usesyslog)
{
handle->usesyslog = usesyslog;