[svn] GnuPG - r4583 - in trunk: . agent common g10 sm
svn author wk
cvs at cvs.gnupg.org
Fri Sep 14 15:38:40 CEST 2007
Author: wk
Date: 2007-09-14 15:38:36 +0200 (Fri, 14 Sep 2007)
New Revision: 4583
Modified:
trunk/ChangeLog
trunk/agent/agent.h
trunk/common/ChangeLog
trunk/configure.ac
trunk/g10/ChangeLog
trunk/g10/gpg.c
trunk/sm/ChangeLog
trunk/sm/gpgsm.c
Log:
Print used library version with --version.
Typo fixes
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2007-09-14 11:41:14 UTC (rev 4582)
+++ trunk/ChangeLog 2007-09-14 13:38:36 UTC (rev 4583)
@@ -1,3 +1,7 @@
+2007-09-14 Werner Koch <wk at g10code.com>
+
+ * configure.ac (GNUPG_LIBASSUAN_VERSION): New.
+
2007-09-10 Werner Koch <wk at g10code.com>
Released 2.0.7.
Modified: trunk/agent/agent.h
===================================================================
--- trunk/agent/agent.h 2007-09-14 11:41:14 UTC (rev 4582)
+++ trunk/agent/agent.h 2007-09-14 13:38:36 UTC (rev 4583)
@@ -80,7 +80,7 @@
unsigned long max_cache_ttl; /* Default. */
unsigned long max_cache_ttl_ssh; /* for SSH. */
- /* Flag disallowin bypassing of the warning. */
+ /* Flag disallowing bypassing of the warning. */
int enforce_passphrase_constraints;
/* The require minmum length of a passphrase. */
unsigned int min_passphrase_len;
Modified: trunk/common/ChangeLog
===================================================================
--- trunk/common/ChangeLog 2007-09-14 11:41:14 UTC (rev 4582)
+++ trunk/common/ChangeLog 2007-09-14 13:38:36 UTC (rev 4583)
@@ -8,7 +8,7 @@
2007-08-28 Werner Koch <wk at g10code.com>
- * gettime.c (check_isotime, add_isotime): New. Orginally written
+ * gettime.c (check_isotime, add_isotime): New. Originally written
for DirMngr by me.
(add_days_to_isotime): New.
(date2jd, jd2date, days_per_month, days_per_year): New. Taken from
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2007-09-14 11:41:14 UTC (rev 4582)
+++ trunk/configure.ac 2007-09-14 13:38:36 UTC (rev 4583)
@@ -608,6 +608,8 @@
AM_CHECK_LIBASSUAN("$NEED_LIBASSUAN_API:1.0.1",
[AC_DEFINE(HAVE_ASSUAN_SET_IO_MONITOR, 1,
[Define to 1 if you have the `assuan_set_io_monitor' function.])],)
+ AC_DEFINE_UNQUOTED(GNUPG_LIBASSUAN_VERSION, "$libassuan_version",
+ [version of the libbassuan library])
fi
Modified: trunk/g10/ChangeLog
===================================================================
--- trunk/g10/ChangeLog 2007-09-14 11:41:14 UTC (rev 4582)
+++ trunk/g10/ChangeLog 2007-09-14 13:38:36 UTC (rev 4583)
@@ -1,3 +1,8 @@
+2007-09-14 Werner Koch <wk at g10code.com>
+
+ * gpg.c (build_lib_list): New.
+ (my_strusage): Print lib info.
+
2007-08-27 Werner Koch <wk at g10code.com>
* trustdb.c (USE_INTERNAL_REGEX): Remove support.
Modified: trunk/g10/gpg.c
===================================================================
--- trunk/g10/gpg.c 2007-09-14 11:41:14 UTC (rev 4582)
+++ trunk/g10/gpg.c 2007-09-14 13:38:36 UTC (rev 4583)
@@ -727,6 +727,7 @@
static char *build_list( const char *text, char letter,
const char *(*mapf)(int), int (*chkf)(int) );
+static char *build_lib_list (const char *text);
static void set_cmd( enum cmd_and_opt_values *ret_cmd,
enum cmd_and_opt_values new_cmd );
static void print_mds( const char *fname, int algo );
@@ -739,7 +740,7 @@
static const char *
my_strusage( int level )
{
- static char *digests, *pubkeys, *ciphers, *zips;
+ static char *digests, *pubkeys, *ciphers, *zips, *libs;
const char *p;
switch( level ) {
case 11: p = "gpg (GnuPG)";
@@ -807,6 +808,11 @@
check_compress_algo);
p = zips;
break;
+ case 38:
+ if (!libs)
+ libs = build_lib_list(_("Used libraries:"));
+ p = libs;
+ break;
default: p = NULL;
}
@@ -869,6 +875,46 @@
}
+static char *
+build_lib_list (const char *text)
+{
+ struct { const char *name; const char *version; } array[3];
+ int idx;
+ size_t n;
+ char *list, *p;
+
+ if (maybe_setuid)
+ gcry_control (GCRYCTL_INIT_SECMEM, 0, 0); /* Drop setuid. */
+
+ idx = 0;
+ array[idx].name = "gcrypt";
+ array[idx++].version = gcry_check_version (NULL);
+ array[idx].name = NULL;
+ array[idx++].version = NULL;
+
+ n = strlen (text) + 1;
+ for (idx=0; array[idx].name; idx++)
+ {
+ n += 2 + strlen (array[idx].name);
+ if (array[idx].version)
+ n += 1 + strlen (array[idx].version) + 1;
+ }
+ n++;
+ list = xmalloc (n+1);
+ p = stpcpy (stpcpy (list, text), " ");
+ for (idx=0; array[idx].name; idx++)
+ {
+ if (idx)
+ p = stpcpy (p, ", ");
+ p = stpcpy (p, array[idx].name);
+ if (array[idx].version)
+ p = stpcpy (stpcpy (stpcpy (p, "("), array[idx].version), ")");
+ }
+ strcpy (p, "\n");
+ return list;
+}
+
+
static void
wrong_args( const char *text)
{
Modified: trunk/sm/ChangeLog
===================================================================
--- trunk/sm/ChangeLog 2007-09-14 11:41:14 UTC (rev 4582)
+++ trunk/sm/ChangeLog 2007-09-14 13:38:36 UTC (rev 4583)
@@ -1,3 +1,8 @@
+2007-09-14 Werner Koch <wk at g10code.com>
+
+ * gpgsm.c (build_lib_list): New.
+ (my_strusage): Print lib info.
+
2007-08-24 Werner Koch <wk at g10code.com>
* Makefile.am (common_libs): Swap libkeybox and jnlib.
Modified: trunk/sm/gpgsm.c
===================================================================
--- trunk/sm/gpgsm.c 2007-09-14 11:41:14 UTC (rev 4582)
+++ trunk/sm/gpgsm.c 2007-09-14 13:38:36 UTC (rev 4583)
@@ -481,6 +481,7 @@
static char *build_list (const char *text,
const char *(*mapf)(int), int (*chkf)(int));
+static char *build_lib_list (const char *text);
static void set_cmd (enum cmd_and_opt_values *ret_cmd,
enum cmd_and_opt_values new_cmd );
@@ -553,7 +554,7 @@
static const char *
my_strusage( int level )
{
- static char *digests, *pubkeys, *ciphers;
+ static char *digests, *pubkeys, *ciphers, *libs;
const char *p;
switch (level)
@@ -593,7 +594,12 @@
digests = build_list("Hash: ", gcry_md_algo_name, our_md_test_algo );
p = digests;
break;
-
+ case 38:
+ if (!libs)
+ libs = build_lib_list(_("Used libraries:"));
+ p = libs;
+ break;
+
default: p = NULL; break;
}
return p;
@@ -632,7 +638,50 @@
return list;
}
+static char *
+build_lib_list (const char *text)
+{
+ struct { const char *name; const char *version; } array[5];
+ int idx;
+ size_t n;
+ char *list, *p;
+ if (maybe_setuid)
+ gcry_control (GCRYCTL_INIT_SECMEM, 0, 0); /* Drop setuid. */
+
+ idx = 0;
+ array[idx].name = "gcrypt";
+ array[idx++].version = gcry_check_version (NULL);
+ array[idx].name = "ksba";
+ array[idx++].version = ksba_check_version (NULL);
+ array[idx].name = "assuan";
+ array[idx++].version = GNUPG_LIBASSUAN_VERSION;
+ array[idx].name = NULL;
+ array[idx++].version = NULL;
+
+ n = strlen (text) + 1;
+ for (idx=0; array[idx].name; idx++)
+ {
+ n += 2 + strlen (array[idx].name);
+ if (array[idx].version)
+ n += 1 + strlen (array[idx].version) + 1;
+ }
+ n++;
+ list = xmalloc (n+1);
+ p = stpcpy (stpcpy (list, text), " ");
+ for (idx=0; array[idx].name; idx++)
+ {
+ if (idx)
+ p = stpcpy (p, ", ");
+ p = stpcpy (p, array[idx].name);
+ if (array[idx].version)
+ p = stpcpy (stpcpy (stpcpy (p, "("), array[idx].version), ")");
+ }
+ strcpy (p, "\n");
+ return list;
+}
+
+
/* Set the file pointer into binary mode if required. */
static void
set_binary (FILE *fp)
More information about the Gnupg-commits
mailing list