[pacman-dev] [PATCH] Changed 'signaturedir' to 'gpgdir' in symbols

Kerrick Staley mail at kerrickstaley.com
Sun Jun 12 06:38:52 EDT 2011


This is identical to the patch I submitted a while ago, except the
docstrings are changed per Dan's request. I just realized that I
referred to pacman in the libalpm source, though, so I'll fix that and
resend.

-Kerrick Staley

On Sun, Jun 12, 2011 at 5:36 AM, Kerrick Staley <mail at kerrickstaley.com> wrote:
> 'gpgdir' is clearer than 'signaturedir'. Since this directory and the
> API based on it are specific to GPGME, 'gpg' is used in the name to
> separate it from library-independent functions.
>
> Signed-off-by: Kerrick Staley <mail at kerrickstaley.com>
> ---
>  lib/libalpm/alpm.h    |    8 ++++----
>  lib/libalpm/handle.c  |   18 +++++++++---------
>  lib/libalpm/handle.h  |    2 +-
>  lib/libalpm/signing.c |    4 ++--
>  src/pacman/conf.c     |    2 +-
>  src/pacman/pacman.c   |    2 +-
>  6 files changed, 18 insertions(+), 18 deletions(-)
>
> diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h
> index 5fdeac2..6a9f25e 100644
> --- a/lib/libalpm/alpm.h
> +++ b/lib/libalpm/alpm.h
> @@ -197,10 +197,10 @@ int alpm_option_set_logfile(const char *logfile);
>  */
>  const char *alpm_option_get_lockfile(void);
>
> -/** Returns the signature directory path. */
> -const char *alpm_option_get_signaturedir(void);
> -/** Sets the signature directory path. */
> -int alpm_option_set_signaturedir(const char *signaturedir);
> +/** Returns the path to pacman's GPG home directory. */
> +const char *alpm_option_get_gpgdir(void);
> +/** Sets the path to pacman's GPG home directory. */
> +int alpm_option_set_gpgdir(const char *gpgdir);
>
>  /** Returns whether to use syslog (0 is FALSE, TRUE otherwise). */
>  int alpm_option_get_usesyslog(void);
> diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c
> index 8d33caa..5942911 100644
> --- a/lib/libalpm/handle.c
> +++ b/lib/libalpm/handle.c
> @@ -82,7 +82,7 @@ void _alpm_handle_free(pmhandle_t *handle)
>        FREE(handle->logfile);
>        FREE(handle->lockfile);
>        FREE(handle->arch);
> -       FREE(handle->signaturedir);
> +       FREE(handle->gpgdir);
>        FREELIST(handle->dbs_sync);
>        FREELIST(handle->noupgrade);
>        FREELIST(handle->noextract);
> @@ -173,13 +173,13 @@ const char SYMEXPORT *alpm_option_get_lockfile()
>        return handle->lockfile;
>  }
>
> -const char SYMEXPORT *alpm_option_get_signaturedir()
> +const char SYMEXPORT *alpm_option_get_gpgdir()
>  {
>        if(handle == NULL) {
>                pm_errno = PM_ERR_HANDLE_NULL;
>                return NULL;
>        }
> -       return handle->signaturedir;
> +       return handle->gpgdir;
>  }
>
>  int SYMEXPORT alpm_option_get_usesyslog()
> @@ -468,21 +468,21 @@ int SYMEXPORT alpm_option_set_logfile(const char *logfile)
>        return 0;
>  }
>
> -int SYMEXPORT alpm_option_set_signaturedir(const char *signaturedir)
> +int SYMEXPORT alpm_option_set_gpgdir(const char *gpgdir)
>  {
>        ALPM_LOG_FUNC;
>
> -       if(!signaturedir) {
> +       if(!gpgdir) {
>                pm_errno = PM_ERR_WRONG_ARGS;
>                return -1;
>        }
>
> -       if(handle->signaturedir) {
> -               FREE(handle->signaturedir);
> +       if(handle->gpgdir) {
> +               FREE(handle->gpgdir);
>        }
> -       handle->signaturedir = strdup(signaturedir);
> +       handle->gpgdir = strdup(gpgdir);
>
> -       _alpm_log(PM_LOG_DEBUG, "option 'signaturedir' = %s\n", handle->signaturedir);
> +       _alpm_log(PM_LOG_DEBUG, "option 'gpgdir' = %s\n", handle->gpgdir);
>        return 0;
>  }
>
> diff --git a/lib/libalpm/handle.h b/lib/libalpm/handle.h
> index 672cab4..59375fd 100644
> --- a/lib/libalpm/handle.h
> +++ b/lib/libalpm/handle.h
> @@ -58,7 +58,7 @@ typedef struct _pmhandle_t {
>        char *dbpath;            /* Base path to pacman's DBs */
>        char *logfile;           /* Name of the log 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 */
>
>        /* package lists */
> diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c
> index a57d86a..0142058 100644
> --- a/lib/libalpm/signing.c
> +++ b/lib/libalpm/signing.c
> @@ -118,7 +118,7 @@ static int gpgme_init(void)
>                return 0;
>        }
>
> -       if(!alpm_option_get_signaturedir()) {
> +       if(!alpm_option_get_gpgdir()) {
>                RET_ERR(PM_ERR_SIG_MISSINGDIR, 1);
>        }
>
> @@ -144,7 +144,7 @@ static int gpgme_init(void)
>
>        /* set and check engine information */
>        err = gpgme_set_engine_info(GPGME_PROTOCOL_OpenPGP, NULL,
> -                       alpm_option_get_signaturedir());
> +                       alpm_option_get_gpgdir());
>        CHECK_ERR();
>        err = gpgme_get_engine_info(&enginfo);
>        CHECK_ERR();
> diff --git a/src/pacman/conf.c b/src/pacman/conf.c
> index d8f2ac3..ccb1291 100644
> --- a/src/pacman/conf.c
> +++ b/src/pacman/conf.c
> @@ -466,7 +466,7 @@ static int setlibpaths(void)
>        /* Set GnuPG's home directory.  This is not relative to rootdir, even if
>         * rootdir is defined. Reasoning: gpgdir contains configuration data. */
>        if(config->gpgdir) {
> -               ret = alpm_option_set_signaturedir(config->gpgdir);
> +               ret = alpm_option_set_gpgdir(config->gpgdir);
>                if(ret != 0) {
>                        pm_printf(PM_LOG_ERROR, _("problem setting gpgdir '%s' (%s)\n"),
>                                        config->gpgdir, alpm_strerrorlast());
> diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
> index 8458c97..810f335 100644
> --- a/src/pacman/pacman.c
> +++ b/src/pacman/pacman.c
> @@ -813,7 +813,7 @@ int main(int argc, char *argv[])
>        /* define paths to reasonable defaults */
>        alpm_option_set_root(ROOTDIR);
>        alpm_option_set_dbpath(DBPATH);
> -       alpm_option_set_signaturedir(GPGDIR);
> +       alpm_option_set_gpgdir(GPGDIR);
>        alpm_option_set_logfile(LOGFILE);
>
>        /* Priority of options:
> --
> 1.7.5.2
>
>


More information about the pacman-dev mailing list