Print used library version with --version.

Typo fixes
This commit is contained in:
Werner Koch 2007-09-14 13:38:36 +00:00
parent c058df3a06
commit 19009f9959
8 changed files with 116 additions and 5 deletions

View File

@ -1,3 +1,7 @@
2007-09-14 Werner Koch <wk@g10code.com>
* configure.ac (GNUPG_LIBASSUAN_VERSION): New.
2007-09-10 Werner Koch <wk@g10code.com>
Released 2.0.7.

View File

@ -80,7 +80,7 @@ struct
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;

View File

@ -8,7 +8,7 @@
2007-08-28 Werner Koch <wk@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

View File

@ -608,6 +608,8 @@ if test "$have_libassuan" = "yes"; then
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

View File

@ -1,3 +1,8 @@
2007-09-14 Werner Koch <wk@g10code.com>
* gpg.c (build_lib_list): New.
(my_strusage): Print lib info.
2007-08-27 Werner Koch <wk@g10code.com>
* trustdb.c (USE_INTERNAL_REGEX): Remove support.

View File

@ -727,6 +727,7 @@ static int maybe_setuid = 1;
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 void emergency_cleanup (void);
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 @@ my_strusage( int level )
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 @@ build_list( const char *text, char letter,
}
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)
{

View File

@ -1,3 +1,8 @@
2007-09-14 Werner Koch <wk@g10code.com>
* gpgsm.c (build_lib_list): New.
(my_strusage): Print lib info.
2007-08-24 Werner Koch <wk@g10code.com>
* Makefile.am (common_libs): Swap libkeybox and jnlib.

View File

@ -481,6 +481,7 @@ static int default_validation_model;
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 @@ our_md_test_algo (int algo)
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 @@ my_strusage( int level )
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,6 +638,49 @@ build_list (const char *text, const char * (*mapf)(int), int (*chkf)(int))
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