summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2009-01-20 20:24:24 +0100
committerWerner Koch <wk@gnupg.org>2009-01-20 20:24:24 +0100
commit7b33b9324abc05ccd221af475e1b08012abe354f (patch)
tree840c2f3ed39113b06e6f00d7cf1d692b1a55d387 /tools
parentAdd a few translations to the audit-log. (diff)
downloadgnupg2-7b33b9324abc05ccd221af475e1b08012abe354f.tar.xz
gnupg2-7b33b9324abc05ccd221af475e1b08012abe354f.zip
Print more directories with gpgconf --list-dirs.
Diffstat (limited to 'tools')
-rw-r--r--tools/ChangeLog4
-rw-r--r--tools/gpgconf.c41
2 files changed, 44 insertions, 1 deletions
diff --git a/tools/ChangeLog b/tools/ChangeLog
index c533085d5..8c3474168 100644
--- a/tools/ChangeLog
+++ b/tools/ChangeLog
@@ -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
diff --git a/tools/gpgconf.c b/tools/gpgconf.c
index 57ea08b3d..fdd77c461 100644
--- a/tools/gpgconf.c
+++ b/tools/gpgconf.c
@@ -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;
}