[git] Pinentry - branch, master, updated. pinentry-0.9.7-32-g65d8e0e

by Werner Koch cvs at cvs.gnupg.org
Tue Oct 4 10:43:50 CEST 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The standard pinentry collection".

The branch, master has been updated
       via  65d8e0ec19795d9ec60d7f37f1511f65135cfd84 (commit)
      from  777650b9b021342ba887543396c67f9148218caf (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 65d8e0ec19795d9ec60d7f37f1511f65135cfd84
Author: Werner Koch <wk at gnupg.org>
Date:   Tue Oct 4 10:35:52 2016 +0200

    gnome3: Drop unnecessary use of gtk
    
    * configure.ac: pinentry-gnome3 only needs gcr-base, not gcr.
    * gnome3/pinentry-gnome3.c (main): Instead of testing whether GTK can
    be loaded, check for DBUS_SESSION_BUS_ADDRESS.
    (create_prompt): Use fprintf (stderr, ...) instead of g_warning (...),
    to align with the rest of pinentry.c.
    --
    
    pinentry-gnome3 really just uses gcr and libsecret -- there is no
    direct use of gtk at all.  By linking only to the minimal gcr-base-3
    and avoiding gcr-3 itself, we remove many unnecessary library
    dependencies from pinentry-gnome3.
    
    Specifically, "ldd $(which pinentry-gnome3) | wc -l" goes from 69 to
    23 on debian testing.
    
    Signed-off-by: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
    
    Added missing LF.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/configure.ac b/configure.ac
index 41e9d93..1620ebd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -476,15 +476,15 @@ AM_CONDITIONAL(BUILD_PINENTRY_GTK_2, test "$pinentry_gtk_2" = "yes")
 
 if test "$pinentry_gnome_3" != "no"; then
 	AC_MSG_CHECKING([for gcr])
-	"${PKG_CONFIG}" --exists gcr-3,gcr-base-3
+	"${PKG_CONFIG}" --exists gcr-base-3
 	if test $? -ne 0 ; then
 		AC_MSG_RESULT([no])
-		AC_MSG_WARN([pkg-config could not find the module gcr-3,gcr-base-3])
+		AC_MSG_WARN([pkg-config could not find the module gcr-base-3])
 		pinentry_gnome_3=no
 	else
 		AC_MSG_RESULT([yes])
-		GNOME3CFLAGS=`"${PKG_CONFIG}" --cflags gcr-3,gcr-base-3`
-		GNOME3LIBS=`"${PKG_CONFIG}" --libs gcr-3,gcr-base-3`
+		GNOME3CFLAGS=`"${PKG_CONFIG}" --cflags gcr-base-3`
+		GNOME3LIBS=`"${PKG_CONFIG}" --libs gcr-base-3`
 		AC_SUBST(GNOME3CFLAGS)
 		AC_SUBST(GNOME3LIBS)
 		AC_DEFINE(GCR_API_SUBJECT_TO_CHANGE, 1, [Nod nod])
diff --git a/gnome3/pinentry-gnome3.c b/gnome3/pinentry-gnome3.c
index f8968c9..d6d7d16 100644
--- a/gnome3/pinentry-gnome3.c
+++ b/gnome3/pinentry-gnome3.c
@@ -22,10 +22,10 @@
 # include "config.h"
 #endif
 
-#include <gtk/gtk.h>
 #include <gcr/gcr-base.h>
 
 #include <string.h>
+#include <stdlib.h>
 
 #include <assuan.h>
 
@@ -80,8 +80,8 @@ create_prompt (pinentry_t pe, int confirm)
   prompt = GCR_PROMPT (gcr_system_prompt_open (-1, NULL, &error));
   if (! prompt)
     {
-      g_warning ("couldn't create prompt for gnupg passphrase: %s",
-		 error->message);
+      fprintf (stderr, "couldn't create prompt for gnupg passphrase: %s\n",
+               error->message);
       pe->specific_err_loc = "gcr_prompt";
       pe->specific_err_info = strdup (error->message);
       pe->specific_err = gpg_error (GPG_ERR_CONFIGURATION);
@@ -188,7 +188,7 @@ gnome3_cmd_handler (pinentry_t pe)
 
       /* "The returned password is valid until the next time a method
 	 is called to display another prompt."  */
-      password = gcr_prompt_password_run (prompt, NULL, &error);
+      password = gcr_prompt_password (prompt, NULL, &error);
       if (error)
 	/* Error.  */
 	{
@@ -264,15 +264,12 @@ main (int argc, char *argv[])
   pinentry_init (PGMNAME);
 
 #ifdef FALLBACK_CURSES
-  if (pinentry_have_display (argc, argv))
+  if (!getenv ("DBUS_SESSION_BUS_ADDRESS"))
     {
-      if (! gtk_init_check (&argc, &argv))
-	pinentry_cmd_handler = curses_cmd_handler;
+      fprintf (stderr, "No $DBUS_SESSION_BUS_ADDRESS found,"
+               " falling back to curses\n");
+      pinentry_cmd_handler = curses_cmd_handler;
     }
-  else
-    pinentry_cmd_handler = curses_cmd_handler;
-#else
-  gtk_init (&argc, &argv);
 #endif
 
   pinentry_parse_opts (argc, argv);

-----------------------------------------------------------------------

Summary of changes:
 configure.ac             |  8 ++++----
 gnome3/pinentry-gnome3.c | 19 ++++++++-----------
 2 files changed, 12 insertions(+), 15 deletions(-)


hooks/post-receive
-- 
The standard pinentry collection
http://git.gnupg.org




More information about the Gnupg-commits mailing list