[Gpg4win-commits] r707 - in trunk: . patches patches/gnupg-1.4.8 patches/gnupg2-2.0.8

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Sat Feb 9 01:42:21 CET 2008


Author: marcus
Date: 2008-02-09 01:42:16 +0100 (Sat, 09 Feb 2008)
New Revision: 707

Added:
   trunk/patches/gnupg-1.4.8/
   trunk/patches/gnupg-1.4.8/01-gpgconf-list.patch
   trunk/patches/gnupg2-2.0.8/06-gpgconf-list.patch
Modified:
   trunk/ChangeLog
   trunk/Makefile.am
Log:
2008-02-09  Marcus Brinkmann  <marcus at g10code.de>

	* patches/gnupg-1.4.8/01-gpgconf-list.patch: New file.
	* patches/gnupg2-2.0.8/06-gpgconf-list.patch: New file.
	* Makefile.am (EXTRA_DIST): Add these.


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-02-08 22:05:15 UTC (rev 706)
+++ trunk/ChangeLog	2008-02-09 00:42:16 UTC (rev 707)
@@ -1,3 +1,9 @@
+2008-02-09  Marcus Brinkmann  <marcus at g10code.de>
+
+	* patches/gnupg-1.4.8/01-gpgconf-list.patch: New file.
+	* patches/gnupg2-2.0.8/06-gpgconf-list.patch: New file.
+	* Makefile.am (EXTRA_DIST): Add these.
+
 2008-02-08  Marcus Brinkmann  <marcus at g10code.de>
 
 	* packages/packages.current: Update kleopatra.

Modified: trunk/Makefile.am
===================================================================
--- trunk/Makefile.am	2008-02-08 22:05:15 UTC (rev 706)
+++ trunk/Makefile.am	2008-02-09 00:42:16 UTC (rev 707)
@@ -63,6 +63,8 @@
 	patches/gnupg2-2.0.8/03-create-keyring.patch \
         patches/gnupg2-2.0.8/04-import-export-spawn.patch \
         patches/gnupg2-2.0.8/05-gpgconf.patch \
+        patches/gnupg2-2.0.8/06-gpgconf-list.patch \
+        patches/gnupg-1.4.8/01-gpgconf-list.patch \
 	patches/gpgol-0.9.91/01-gpgme.patch
 
 copy-news:

Added: trunk/patches/gnupg-1.4.8/01-gpgconf-list.patch
===================================================================
--- trunk/patches/gnupg-1.4.8/01-gpgconf-list.patch	2008-02-08 22:05:15 UTC (rev 706)
+++ trunk/patches/gnupg-1.4.8/01-gpgconf-list.patch	2008-02-09 00:42:16 UTC (rev 707)
@@ -0,0 +1,156 @@
+#! /bin/sh
+patch -p0 -f $* < $0
+exit $?
+
+2008-02-09  Marcus Brinkmann  <marcus at g10code.de>
+
+	* gpg.c (main): New variable default_configname.  Use it if
+	save_configname is NULL (can happen if default configfile does
+	not exist).  Move default configname determination to ...
+	(get_default_configname): ... this new function.
+
+
+Index: g10/gpg.c
+===================================================================
+--- g10/gpg.c	(revision 4688)
++++ g10/gpg.c	(working copy)
+@@ -1760,6 +1760,65 @@ encode_s2k_iterations(int iterations)
+   return result;
+ }
+ 
++
++char *
++get_default_configname (void)
++{
++  char *configname = NULL;
++  char *name = xstrdup ("gpg" EXTSEP_S "conf-" SAFE_VERSION);
++  char *ver = &name[strlen ("gpg" EXTSEP_S "conf-")];
++
++  do
++    {
++      if (configname)
++	{
++	  char *tok;
++	  
++	  xfree (configname);
++	  configname = NULL;
++
++	  if ((tok = strrchr (ver, SAFE_VERSION_DASH)))
++	    *tok='\0';
++	  else if ((tok = strrchr (ver, SAFE_VERSION_DOT)))
++	    *tok='\0';
++	  else
++	    break;
++	}
++      
++      configname = make_filename (opt.homedir, name, NULL);
++    }
++  while (access (configname, R_OK));
++
++  xfree(name);
++  
++  if (! configname)
++    configname = make_filename (opt.homedir, "gpg" EXTSEP_S "conf", NULL);
++  if (! access (configname, R_OK))
++    {
++      /* Print a warning when both config files are present.  */
++      char *p = make_filename (opt.homedir, "options", NULL);
++      if (! access (p, R_OK))
++	log_info (_("NOTE: old default options file `%s' ignored\n"), p);
++      xfree (p);
++    }
++  else
++    {
++      /* Use the old default only if it exists.  */
++      char *p = make_filename (opt.homedir, "options", NULL);
++      if (!access (p, R_OK))
++	{
++	  xfree (configname);
++	  configname = p;
++	}
++      else
++	xfree (p);
++    }
++
++  return configname;
++}
++
++
++
+ int
+ main (int argc, char **argv )
+ {
+@@ -1778,6 +1837,7 @@ main (int argc, char **argv )
+     FILE *configfp = NULL;
+     char *configname = NULL;
+     char *save_configname = NULL;
++    char *default_configname = NULL;
+     unsigned configlineno;
+     int parse_debug = 0;
+     int default_config = 1;
+@@ -1959,49 +2019,10 @@ main (int argc, char **argv )
+     set_native_charset (NULL); /* Try to auto set the character set */
+ 
+     /* Try for a version specific config file first */
+-    if( default_config )
+-      {
+-	char *name=xstrdup("gpg" EXTSEP_S "conf-" SAFE_VERSION);
+-	char *ver=&name[strlen("gpg" EXTSEP_S "conf-")];
+-
+-	do
+-	  {
+-	    if(configname)
+-	      {
+-		char *tok;
+-
+-		xfree(configname);
+-		configname=NULL;
++    default_configname = get_default_configname ();
++    if (default_config)
++      configname = xstrdup (default_configname);
+ 
+-		if((tok=strrchr(ver,SAFE_VERSION_DASH)))
+-		  *tok='\0';
+-		else if((tok=strrchr(ver,SAFE_VERSION_DOT)))
+-		  *tok='\0';
+-		else
+-		  break;
+-	      }
+-
+-	    configname = make_filename(opt.homedir,name,NULL);
+-	  }
+-	while(access(configname,R_OK));
+-
+-	xfree(name);
+-
+-	if(!configname)
+-	  configname=make_filename(opt.homedir, "gpg" EXTSEP_S "conf", NULL );
+-        if (!access (configname, R_OK))
+-          { /* Print a warning when both config files are present. */
+-            char *p = make_filename(opt.homedir, "options", NULL );
+-            if (!access (p, R_OK))
+-              log_info (_("NOTE: old default options file `%s' ignored\n"), p);
+-            xfree (p);
+-          }
+-        else
+-          { /* Keep on using the old default one. */
+-            xfree (configname);
+-            configname = make_filename(opt.homedir, "options", NULL );
+-          }
+-      }
+     argc = orig_argc;
+     argv = orig_argv;
+     pargs.argc = &argc;
+@@ -2880,10 +2901,11 @@ main (int argc, char **argv )
+        directly after the option parsing. */
+     if (cmd == aGPGConfList)
+       {
+-        gpgconf_list (save_configname);
++        gpgconf_list (save_configname ? save_configname : default_configname);
+         g10_exit (0);
+       }
+     xfree (save_configname);
++    xfree (default_configname);
+ 
+     if( nogreeting )
+ 	greeting = 0;


Property changes on: trunk/patches/gnupg-1.4.8/01-gpgconf-list.patch
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/patches/gnupg2-2.0.8/06-gpgconf-list.patch
===================================================================
--- trunk/patches/gnupg2-2.0.8/06-gpgconf-list.patch	2008-02-08 22:05:15 UTC (rev 706)
+++ trunk/patches/gnupg2-2.0.8/06-gpgconf-list.patch	2008-02-09 00:42:16 UTC (rev 707)
@@ -0,0 +1,179 @@
+#! /bin/sh
+patch -p0 -f $* < $0
+exit $?
+
+2008-02-09  Marcus Brinkmann  <marcus at g10code.de>
+
+	* scdaemon.c (main): Use CONFIG_FILENAME as filename if it is set
+	in gpgconf-list output.
+
+2008-02-09  Marcus Brinkmann  <marcus at g10code.de>
+
+	* gpg.c (main): New variable default_configname.  Use it if
+	save_configname is NULL (can happen if default configfile does
+	not exist).  Move default configname determination to ...
+	(get_default_configname): ... this new function.
+
+
+Index: scd/scdaemon.c
+===================================================================
+--- scd/scdaemon.c	(revision 4688)
++++ scd/scdaemon.c	(working copy)
+@@ -555,8 +555,10 @@
+       char *filename = NULL;
+       char *filename_esc;
+ 
+-      if (!config_filename)
+-        filename = make_filename (opt.homedir, "scdaemon.conf", NULL );
++      if (config_filename)
++	filename = xstrdup (config_filename);
++      else
++        filename = make_filename (opt.homedir, "scdaemon.conf", NULL);
+       filename_esc = percent_escape (filename, NULL);
+ 
+       printf ("gpgconf-scdaemon.conf:%lu:\"%s\n",
+Index: g10/gpg.c
+===================================================================
+--- g10/gpg.c	(revision 4688)
++++ g10/gpg.c	(working copy)
+@@ -1765,9 +1765,65 @@
+ }
+ 
+ 
++char *
++get_default_configname (void)
++{
++  char *configname = NULL;
++  char *name = xstrdup ("gpg" EXTSEP_S "conf-" SAFE_VERSION);
++  char *ver = &name[strlen ("gpg" EXTSEP_S "conf-")];
+ 
++  do
++    {
++      if (configname)
++	{
++	  char *tok;
++	  
++	  xfree (configname);
++	  configname = NULL;
++
++	  if ((tok = strrchr (ver, SAFE_VERSION_DASH)))
++	    *tok='\0';
++	  else if ((tok = strrchr (ver, SAFE_VERSION_DOT)))
++	    *tok='\0';
++	  else
++	    break;
++	}
++      
++      configname = make_filename (opt.homedir, name, NULL);
++    }
++  while (access (configname, R_OK));
++
++  xfree(name);
++  
++  if (! configname)
++    configname = make_filename (opt.homedir, "gpg" EXTSEP_S "conf", NULL);
++  if (! access (configname, R_OK))
++    {
++      /* Print a warning when both config files are present.  */
++      char *p = make_filename (opt.homedir, "options", NULL);
++      if (! access (p, R_OK))
++	log_info (_("NOTE: old default options file `%s' ignored\n"), p);
++      xfree (p);
++    }
++  else
++    {
++      /* Use the old default only if it exists.  */
++      char *p = make_filename (opt.homedir, "options", NULL);
++      if (!access (p, R_OK))
++	{
++	  xfree (configname);
++	  configname = p;
++	}
++      else
++	xfree (p);
++    }
++
++  return configname;
++}
++
++
+ int
+-main (int argc, char **argv )
++main (int argc, char **argv)
+ {
+     ARGPARSE_ARGS pargs;
+     IOBUF a;
+@@ -1784,6 +1840,7 @@
+     FILE *configfp = NULL;
+     char *configname = NULL;
+     char *save_configname = NULL;
++    char *default_configname = NULL;
+     unsigned configlineno;
+     int parse_debug = 0;
+     int default_config = 1;
+@@ -1960,49 +2017,10 @@
+  
+ 
+     /* Try for a version specific config file first */
+-    if( default_config )
+-      {
+-	char *name=xstrdup("gpg" EXTSEP_S "conf-" SAFE_VERSION);
+-	char *ver=&name[strlen("gpg" EXTSEP_S "conf-")];
++    default_configname = get_default_configname ();
++    if (default_config)
++      configname = xstrdup (default_configname);
+ 
+-	do
+-	  {
+-	    if(configname)
+-	      {
+-		char *tok;
+-
+-		xfree(configname);
+-		configname=NULL;
+-
+-		if((tok=strrchr(ver,SAFE_VERSION_DASH)))
+-		  *tok='\0';
+-		else if((tok=strrchr(ver,SAFE_VERSION_DOT)))
+-		  *tok='\0';
+-		else
+-		  break;
+-	      }
+-
+-	    configname = make_filename(opt.homedir,name,NULL);
+-	  }
+-	while(access(configname,R_OK));
+-
+-	xfree(name);
+-
+-	if(!configname)
+-	  configname=make_filename(opt.homedir, "gpg" EXTSEP_S "conf", NULL );
+-        if (!access (configname, R_OK))
+-          { /* Print a warning when both config files are present. */
+-            char *p = make_filename(opt.homedir, "options", NULL );
+-            if (!access (p, R_OK))
+-              log_info (_("NOTE: old default options file `%s' ignored\n"), p);
+-            xfree (p);
+-          }
+-        else
+-          { /* Keep on using the old default one. */
+-            xfree (configname);
+-            configname = make_filename(opt.homedir, "options", NULL );
+-          }
+-      }
+     argc = orig_argc;
+     argv = orig_argv;
+     pargs.argc = &argc;
+@@ -2867,10 +2885,11 @@
+        directly after the option parsing. */
+     if (cmd == aGPGConfList)
+       {
+-        gpgconf_list (save_configname);
++        gpgconf_list (save_configname ? save_configname : default_configname);
+         g10_exit (0);
+       }
+     xfree (save_configname);
++    xfree (default_configname);
+ 
+     if( nogreeting )
+ 	greeting = 0;


Property changes on: trunk/patches/gnupg2-2.0.8/06-gpgconf-list.patch
___________________________________________________________________
Name: svn:executable
   + *



More information about the Gpg4win-commits mailing list