Print more directories with gpgconf --list-dirs.

This commit is contained in:
Werner Koch 2009-01-20 19:24:24 +00:00
parent 68fd14b144
commit 7b33b9324a
5 changed files with 55 additions and 9 deletions

View File

@ -239,10 +239,13 @@ configuration file (usually @file{/etc/gnupg/gpgconf.conf}).
@item --list-dirs
Lists the directories used by @command{gpgconf}. One directory is
listed per line, and each line consists of a colon-separated list
where the first field names the directory type (for example
@code{sysconfdir}) and the second field contains the percent-escaped
directory.
listed per line, and each line consists of a colon-separated list where
the first field names the directory type (for example @code{sysconfdir})
and the second field contains the percent-escaped directory. Although
they are not directories, the socket file names used by
@command{gpg-agent} and @command{dirmngr} are printed as well. Note
that the socket file names and the @code{homedir} lines are the default
names and they may be overridden by command line switches.
@item --list-config [@var{filename}]
List the global configuration file in a colon separated format. If

View File

@ -314,8 +314,8 @@ make_dirname(const char *filepath)
/* Implementation of make_filename and make_filename_try. We need to
use macros here toa void the use of the soemtimes problematic
va_copy fucntion which is not available on all systems. */
use macros here to avoid the use of the sometimes problematic
va_copy function which is not available on all systems. */
#define MAKE_FILENAME_PART1 \
va_list arg_ptr; \
size_t n; \

View File

@ -10,7 +10,7 @@ msgstr ""
"Project-Id-Version: gnupg-2.0.10\n"
"Report-Msgid-Bugs-To: translations@gnupg.org\n"
"POT-Creation-Date: 2009-01-19 16:21+0100\n"
"PO-Revision-Date: 2009-01-19 16:22+0100\n"
"PO-Revision-Date: 2009-01-19 16:43+0100\n"
"Last-Translator: Walter Koch <koch@u32.de>\n"
"Language-Team: German <de@li.org>\n"
"MIME-Version: 1.0\n"
@ -893,7 +893,7 @@ msgstr "Verbindung zum gpg-agent nicht möglich - Ersatzmethode wird versucht\n"
#. verbatim. It will not be printed.
#: common/audit.c:474
msgid "|audit-log-result|Good"
msgstr "Korrekt"
msgstr "|audit-log-result|Korrekt"
#: common/audit.c:477
msgid "|audit-log-result|Bad"

View File

@ -1,3 +1,7 @@
2009-01-20 Werner Koch <wk@g10code.com>
* gpgconf.c (main): Print more directories.
2008-12-09 Werner Koch <wk@g10code.com>
* gpg-check-pattern.c (main): Call i18n_init before

View File

@ -258,12 +258,51 @@ main (int argc, char **argv)
break;
case aListDirs:
/* Show the system configuration directory for gpgconf. */
/* Show the system configuration directories for gpgconf. */
get_outfp (&outfp);
fprintf (outfp, "sysconfdir:%s\n",
gc_percent_escape (gnupg_sysconfdir ()));
fprintf (outfp, "bindir:%s\n",
gc_percent_escape (gnupg_bindir ()));
fprintf (outfp, "libexecdir:%s\n",
gc_percent_escape (gnupg_libexecdir ()));
fprintf (outfp, "libdir:%s\n",
gc_percent_escape (gnupg_libdir ()));
fprintf (outfp, "datadir:%s\n",
gc_percent_escape (gnupg_datadir ()));
fprintf (outfp, "localedir:%s\n",
gc_percent_escape (gnupg_localedir ()));
fprintf (outfp, "dirmngr-socket:%s\n",
gc_percent_escape (dirmngr_socket_name ()));
{
char *infostr = getenv ("GPG_AGENT_INFO");
if (!infostr || !*infostr)
infostr = make_filename (default_homedir (), "S.gpg-agent", NULL);
else
{
char *tmp;
infostr = xstrdup (infostr);
tmp = strchr (infostr, PATHSEP_C);
if (!tmp || tmp == infostr)
{
xfree (infostr);
infostr = NULL;
}
else
*tmp = 0;
}
fprintf (outfp, "agent-socket:%s\n",
infostr? gc_percent_escape (infostr) : "");
xfree (infostr);
}
{
/* We need to use make_filename to expand a possible "~/". */
char *tmp = make_filename (default_homedir (), NULL);
fprintf (outfp, "homedir:%s\n", gc_percent_escape (tmp));
xfree (tmp);
}
break;
}