mirror of
https://github.com/moparisthebest/pacman
synced 2024-11-11 11:55:12 -05:00
API: change 'signaturedir' to 'gpgdir'
This is more in line with reality and what we have our makepkg, etc. options named anyway. Original-patch-by: Kerrick Staley <mail@kerrickstaley.com> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
d21f6ca4aa
commit
1cd6515af0
@ -181,10 +181,10 @@ const char *alpm_option_get_logfile(pmhandle_t *handle);
|
|||||||
/** Sets the logfile name. */
|
/** Sets the logfile name. */
|
||||||
int alpm_option_set_logfile(pmhandle_t *handle, const char *logfile);
|
int alpm_option_set_logfile(pmhandle_t *handle, const char *logfile);
|
||||||
|
|
||||||
/** Returns the signature directory path. */
|
/** Returns the path to libalpm's GnuPG home directory. */
|
||||||
const char *alpm_option_get_signaturedir(pmhandle_t *handle);
|
const char *alpm_option_get_gpgdir(pmhandle_t *handle);
|
||||||
/** Sets the signature directory path. */
|
/** Sets the path to libalpm's GnuPG home directory. */
|
||||||
int alpm_option_set_signaturedir(pmhandle_t *handle, const char *signaturedir);
|
int alpm_option_set_gpgdir(pmhandle_t *handle, const char *gpgdir);
|
||||||
|
|
||||||
/** Returns whether to use syslog (0 is FALSE, TRUE otherwise). */
|
/** Returns whether to use syslog (0 is FALSE, TRUE otherwise). */
|
||||||
int alpm_option_get_usesyslog(pmhandle_t *handle);
|
int alpm_option_get_usesyslog(pmhandle_t *handle);
|
||||||
|
@ -77,7 +77,7 @@ void _alpm_handle_free(pmhandle_t *handle)
|
|||||||
FREE(handle->logfile);
|
FREE(handle->logfile);
|
||||||
FREE(handle->lockfile);
|
FREE(handle->lockfile);
|
||||||
FREE(handle->arch);
|
FREE(handle->arch);
|
||||||
FREE(handle->signaturedir);
|
FREE(handle->gpgdir);
|
||||||
FREELIST(handle->dbs_sync);
|
FREELIST(handle->dbs_sync);
|
||||||
FREELIST(handle->noupgrade);
|
FREELIST(handle->noupgrade);
|
||||||
FREELIST(handle->noextract);
|
FREELIST(handle->noextract);
|
||||||
@ -140,10 +140,10 @@ const char SYMEXPORT *alpm_option_get_lockfile(pmhandle_t *handle)
|
|||||||
return handle->lockfile;
|
return handle->lockfile;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char SYMEXPORT *alpm_option_get_signaturedir(pmhandle_t *handle)
|
const char SYMEXPORT *alpm_option_get_gpgdir(pmhandle_t *handle)
|
||||||
{
|
{
|
||||||
CHECK_HANDLE(handle, return NULL);
|
CHECK_HANDLE(handle, return NULL);
|
||||||
return handle->signaturedir;
|
return handle->gpgdir;
|
||||||
}
|
}
|
||||||
|
|
||||||
int SYMEXPORT alpm_option_get_usesyslog(pmhandle_t *handle)
|
int SYMEXPORT alpm_option_get_usesyslog(pmhandle_t *handle)
|
||||||
@ -362,20 +362,20 @@ int SYMEXPORT alpm_option_set_logfile(pmhandle_t *handle, const char *logfile)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int SYMEXPORT alpm_option_set_signaturedir(pmhandle_t *handle, const char *signaturedir)
|
int SYMEXPORT alpm_option_set_gpgdir(pmhandle_t *handle, const char *gpgdir)
|
||||||
{
|
{
|
||||||
CHECK_HANDLE(handle, return -1);
|
CHECK_HANDLE(handle, return -1);
|
||||||
if(!signaturedir) {
|
if(!gpgdir) {
|
||||||
handle->pm_errno = PM_ERR_WRONG_ARGS;
|
handle->pm_errno = PM_ERR_WRONG_ARGS;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(handle->signaturedir) {
|
if(handle->gpgdir) {
|
||||||
FREE(handle->signaturedir);
|
FREE(handle->gpgdir);
|
||||||
}
|
}
|
||||||
handle->signaturedir = strdup(signaturedir);
|
handle->gpgdir = strdup(gpgdir);
|
||||||
|
|
||||||
_alpm_log(handle, PM_LOG_DEBUG, "option 'signaturedir' = %s\n", handle->signaturedir);
|
_alpm_log(handle, PM_LOG_DEBUG, "option 'gpgdir' = %s\n", handle->gpgdir);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ struct __pmhandle_t {
|
|||||||
char *dbpath; /* Base path to pacman's DBs */
|
char *dbpath; /* Base path to pacman's DBs */
|
||||||
char *logfile; /* Name of the log file */
|
char *logfile; /* Name of the log file */
|
||||||
char *lockfile; /* Name of the lock file */
|
char *lockfile; /* Name of the lock file */
|
||||||
char *signaturedir; /* Directory where GnuPG files are stored */
|
char *gpgdir; /* Directory where GnuPG files are stored */
|
||||||
alpm_list_t *cachedirs; /* Paths to pacman cache directories */
|
alpm_list_t *cachedirs; /* Paths to pacman cache directories */
|
||||||
|
|
||||||
/* package lists */
|
/* package lists */
|
||||||
|
@ -116,7 +116,7 @@ static int init_gpgme(pmhandle_t *handle)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
sigdir = alpm_option_get_signaturedir(handle);
|
sigdir = alpm_option_get_gpgdir(handle);
|
||||||
if(!sigdir) {
|
if(!sigdir) {
|
||||||
RET_ERR(handle, PM_ERR_SIG_MISSINGDIR, 1);
|
RET_ERR(handle, PM_ERR_SIG_MISSINGDIR, 1);
|
||||||
}
|
}
|
||||||
|
@ -467,7 +467,7 @@ static int setup_libalpm(void)
|
|||||||
/* Set GnuPG's home directory. This is not relative to rootdir, even if
|
/* Set GnuPG's home directory. This is not relative to rootdir, even if
|
||||||
* rootdir is defined. Reasoning: gpgdir contains configuration data. */
|
* rootdir is defined. Reasoning: gpgdir contains configuration data. */
|
||||||
config->gpgdir = config->gpgdir ? config->gpgdir : strdup(GPGDIR);
|
config->gpgdir = config->gpgdir ? config->gpgdir : strdup(GPGDIR);
|
||||||
ret = alpm_option_set_signaturedir(handle, config->gpgdir);
|
ret = alpm_option_set_gpgdir(handle, config->gpgdir);
|
||||||
if(ret != 0) {
|
if(ret != 0) {
|
||||||
pm_printf(PM_LOG_ERROR, _("problem setting gpgdir '%s' (%s)\n"),
|
pm_printf(PM_LOG_ERROR, _("problem setting gpgdir '%s' (%s)\n"),
|
||||||
config->gpgdir, alpm_strerror(alpm_errno(config->handle)));
|
config->gpgdir, alpm_strerror(alpm_errno(config->handle)));
|
||||||
|
@ -885,7 +885,7 @@ int main(int argc, char *argv[])
|
|||||||
printf("\n");
|
printf("\n");
|
||||||
printf("Lock File : %s\n", alpm_option_get_lockfile(config->handle));
|
printf("Lock File : %s\n", alpm_option_get_lockfile(config->handle));
|
||||||
printf("Log File : %s\n", alpm_option_get_logfile(config->handle));
|
printf("Log File : %s\n", alpm_option_get_logfile(config->handle));
|
||||||
printf("GPG Dir : %s\n", alpm_option_get_signaturedir(config->handle));
|
printf("GPG Dir : %s\n", alpm_option_get_gpgdir(config->handle));
|
||||||
list_display("Targets :", pm_targets);
|
list_display("Targets :", pm_targets);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user