[svn] gpgme - r1207 - in trunk: . gpgme

svn author wk cvs at cvs.gnupg.org
Fri Jan 26 13:08:13 CET 2007


Author: wk
Date: 2007-01-26 13:08:12 +0100 (Fri, 26 Jan 2007)
New Revision: 1207

Modified:
   trunk/ChangeLog
   trunk/configure.ac
   trunk/gpgme/ChangeLog
   trunk/gpgme/gpgme-config.in
   trunk/gpgme/rungpg.c
   trunk/gpgme/w32-glib-io.c
   trunk/gpgme/w32-io.c
Log:
/
	* configure.ac: Changed gpg and gpgsm version checks to work with
	arbitrary names of the gpg binary. New option --disable-gpg-test
	and --disable-gpgsm-test.
gpgme/
	* w32-io.c (build_commandline): Fixed stupid quoting bug.
	* w32-glib-io.c (build_commandline): Ditto.

	* rungpg.c (gpg_set_locale): Avoid dangling pointer after free.

	* gpgme-config.in: New options --get-gpg and --get-gpgsm.


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-01-18 18:02:54 UTC (rev 1206)
+++ trunk/ChangeLog	2007-01-26 12:08:12 UTC (rev 1207)
@@ -1,8 +1,13 @@
+2007-01-26  Werner Koch  <wk at g10code.com>
+
+	* configure.ac: Changed gpg and gpgsm version checks to work with
+	arbitrary names of the gpg binary. New option --disable-gpg-test
+	and --disable-gpgsm-test.
+
 2007-01-09  Werner Koch  <wk at g10code.com>
 
-	* configure.ac (NEED_GPG_VERSION,
-	(NEED_GPGSM_VERSION): Must define after it may have been changed
-	by an option.
+	* configure.ac (NEED_GPG_VERSION, NEED_GPGSM_VERSION): Must define
+	after it may have been changed by an option.
 
 2007-01-08  Werner Koch  <wk at g10code.com>
 

Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2007-01-18 18:02:54 UTC (rev 1206)
+++ trunk/configure.ac	2007-01-26 12:08:12 UTC (rev 1207)
@@ -324,21 +324,20 @@
   fi
 fi
 if test "$ok" = "maybe"; then
-  AC_MSG_CHECKING(for GnuPG >= $NEED_GPG_VERSION)
+  AC_MSG_CHECKING(for GPG >= $NEED_GPG_VERSION)
   req_major=`echo $NEED_GPG_VERSION | \
              sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
   req_minor=`echo $NEED_GPG_VERSION | \
 	     sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
   req_micro=`echo $NEED_GPG_VERSION | \
 	     sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
-  gpg_version=`$GPG --version | grep ^gpg`
-  major=`echo $gpg_version | \
-	 sed 's/^gpg (GnuPG) \([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
-  minor=`echo $gpg_version | \
-	 sed 's/^gpg (GnuPG) \([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
-  micro=`echo $gpg_version | \
-	 sed 's/^gpg (GnuPG) \([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
-  GPG_VERSION=`echo $gpg_version | sed 's/^gpg (GnuPG) //'`
+  GPG_VERSION=`$GPG --version | sed -n '1 s/[[^0-9]]*\(.*\)/\1/p'`
+  major=`echo $GPG_VERSION | \
+	 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
+  minor=`echo $GPG_VERSION | \
+	 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
+  micro=`echo $GPG_VERSION | \
+	 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
 
   if test "$major" -gt "$req_major"; then
     ok=yes
@@ -359,10 +358,14 @@
     AC_MSG_RESULT(yes)
   else
     AC_MSG_RESULT(no)
-    AC_MSG_WARN([GnuPG must be at least version $NEED_GPG_VERSION])
+    AC_MSG_WARN([GPG must be at least version $NEED_GPG_VERSION])
   fi
 fi
-AM_CONDITIONAL(RUN_GPG_TESTS, test "$ok" = "yes")
+run_gpg_test="$ok"
+AC_ARG_ENABLE(gpg-test,
+  AC_HELP_STRING([--disable-gpg-test], [disable GPG run test]),
+         run_gpg_test=$enableval)
+AM_CONDITIONAL(RUN_GPG_TESTS, test "$run_gpg_test" = "yes")
 AC_SUBST(GPG_PATH)
 
 NO_OVERRIDE=no
@@ -424,14 +427,13 @@
 	     sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
   req_micro=`echo $NEED_GPGSM_VERSION | \
 	     sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
-  gpgsm_version=`$GPGSM --version | grep ^gpgsm`
-  major=`echo $gpgsm_version | \
-	 sed 's/^gpgsm (GnuPG) \([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
-  minor=`echo $gpgsm_version | \
-	 sed 's/^gpgsm (GnuPG) \([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
-  micro=`echo $gpgsm_version | \
-	 sed 's/^gpgsm (GnuPG) \([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
-  GPGSM_VERSION=`echo $gpgsm_version | sed 's/^gpgsm (GnuPG) //'`
+  GPGSM_VERSION=`$GPGSM --version | sed -n '1 s/[[^0-9]]*\(.*\)/\1/p'`
+  major=`echo $GPGSM_VERSION | \
+	 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
+  minor=`echo $GPGSM_VERSION | \
+	 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
+  micro=`echo $GPGSM_VERSION | \
+	 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
 
   if test "$major" -gt "$req_major"; then
     ok=yes
@@ -455,8 +457,13 @@
     AC_MSG_WARN([GPGSM must be at least version $NEED_GPGSM_VERSION])
   fi
 fi
-AM_CONDITIONAL(RUN_GPGSM_TESTS, test "$ok" = "yes")
+run_gpgsm_test="$ok"
+AC_ARG_ENABLE(gpgsm-test,
+  AC_HELP_STRING([--disable-gpgsm-test], [disable GPGSM run test]),
+         run_gpgsm_test=$enableval)
+AM_CONDITIONAL(RUN_GPGSM_TESTS, test "$run_gpgsm_test" = "yes")
 
+
 # FIXME: Only build if supported.
 AM_CONDITIONAL(BUILD_ASSUAN, test "$GPGSM" != "no")
 if test "$GPGSM" != "no"; then

Modified: trunk/gpgme/ChangeLog
===================================================================
--- trunk/gpgme/ChangeLog	2007-01-18 18:02:54 UTC (rev 1206)
+++ trunk/gpgme/ChangeLog	2007-01-26 12:08:12 UTC (rev 1207)
@@ -1,3 +1,12 @@
+2007-01-26  Werner Koch  <wk at g10code.com>
+
+	* w32-io.c (build_commandline): Fixed stupid quoting bug.
+	* w32-glib-io.c (build_commandline): Ditto.
+
+	* rungpg.c (gpg_set_locale): Avoid dangling pointer after free.
+
+	* gpgme-config.in: New options --get-gpg and --get-gpgsm.
+
 2007-01-18  Marcus Brinkmann  <marcus at g10code.de>
 
 	* data.h (_gpgme_data_get_fd): Add prototype.

Modified: trunk/gpgme/gpgme-config.in
===================================================================
--- trunk/gpgme/gpgme-config.in	2007-01-18 18:02:54 UTC (rev 1206)
+++ trunk/gpgme/gpgme-config.in	2007-01-26 12:08:12 UTC (rev 1207)
@@ -51,6 +51,8 @@
         [--api-version]
 	[--libs]
 	[--cflags]
+        [--get-gpg]
+        [--get-gpgsm]
 EOF
     exit $1
 }
@@ -144,6 +146,12 @@
 		usage 1 1>&2
 	    fi
 	    ;;
+        --get-gpg)
+            output="$output @GPG@"
+            ;;
+        --get-gpgsm)
+            output="$output @GPGSM@"
+            ;;
 	*)
             usage 1 1>&2
 	    ;;

Modified: trunk/gpgme/rungpg.c
===================================================================
--- trunk/gpgme/rungpg.c	2007-01-18 18:02:54 UTC (rev 1206)
+++ trunk/gpgme/rungpg.c	2007-01-26 12:08:12 UTC (rev 1207)
@@ -517,7 +517,10 @@
   if (category == LC_CTYPE)
     {
       if (gpg->lc_ctype)
-	free (gpg->lc_ctype);
+        {
+          free (gpg->lc_ctype);
+          gpg->lc_ctype = NULL;
+        }
       if (value)
 	{
 	  gpg->lc_ctype = strdup (value);
@@ -529,7 +532,10 @@
   else if (category == LC_MESSAGES)
     {
       if (gpg->lc_messages)
-	free (gpg->lc_messages);
+        {
+          free (gpg->lc_messages);
+          gpg->lc_messages = NULL;
+        }
       if (value)
 	{
 	  gpg->lc_messages = strdup (value);

Modified: trunk/gpgme/w32-glib-io.c
===================================================================
--- trunk/gpgme/w32-glib-io.c	2007-01-18 18:02:54 UTC (rev 1206)
+++ trunk/gpgme/w32-glib-io.c	2007-01-26 12:08:12 UTC (rev 1207)
@@ -389,7 +389,7 @@
       *(p++) = '"';
       while (*argvp)
 	{
-	  if (*p == '\\' || *p == '"')
+	  if (*argvp == '\\' || *argvp == '"')
 	    *(p++) = '\\';
 	  *(p++) = *(argvp++);
 	}

Modified: trunk/gpgme/w32-io.c
===================================================================
--- trunk/gpgme/w32-io.c	2007-01-18 18:02:54 UTC (rev 1206)
+++ trunk/gpgme/w32-io.c	2007-01-26 12:08:12 UTC (rev 1207)
@@ -841,7 +841,7 @@
       *(p++) = '"';
       while (*argvp)
 	{
-	  if (*p == '\\' || *p == '"')
+	  if (*argvp == '\\' || *argvp == '"')
 	    *(p++) = '\\';
 	  *(p++) = *(argvp++);
 	}




More information about the Gnupg-commits mailing list