[Gpg4win-commits] r721 - in trunk: . patches patches/winpt
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Tue Feb 26 15:34:35 CET 2008
Author: marcus
Date: 2008-02-26 15:34:29 +0100 (Tue, 26 Feb 2008)
New Revision: 721
Added:
trunk/patches/winpt/
trunk/patches/winpt/01-gpg-path.patch
Modified:
trunk/ChangeLog
trunk/Makefile.am
Log:
2008-02-26 Marcus Brinkmann <marcus at g10code.de>
* patches/winpt/01-gpg-path.patch: New file.
* Makefile.am (EXTRA_DIST): Add this file.
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-02-19 16:13:41 UTC (rev 720)
+++ trunk/ChangeLog 2008-02-26 14:34:29 UTC (rev 721)
@@ -1,3 +1,8 @@
+2008-02-26 Marcus Brinkmann <marcus at g10code.de>
+
+ * patches/winpt/01-gpg-path.patch: New file.
+ * Makefile.am (EXTRA_DIST): Add this file.
+
2008-02-19 Marcus Brinkmann <marcus at g10code.de>
* packages/packages.current: Update gpgex.
Modified: trunk/Makefile.am
===================================================================
--- trunk/Makefile.am 2008-02-19 16:13:41 UTC (rev 720)
+++ trunk/Makefile.am 2008-02-26 14:34:29 UTC (rev 721)
@@ -65,6 +65,7 @@
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/winpt/01-gpg-path.patch \
patches/gpgol-0.9.91/01-gpgme.patch
copy-news:
Added: trunk/patches/winpt/01-gpg-path.patch
===================================================================
--- trunk/patches/winpt/01-gpg-path.patch 2008-02-19 16:13:41 UTC (rev 720)
+++ trunk/patches/winpt/01-gpg-path.patch 2008-02-26 14:34:29 UTC (rev 721)
@@ -0,0 +1,158 @@
+#! /bin/sh
+patch -p0 -f $* < $0
+exit $?
+
+NEVER set gpgProgram in the registry, and use gpg2.exe by default.
+
+
+diff -rup winpt-1.2.0/Src/WinPT.cpp winpt-1.2.0/Src/WinPT.cpp
+--- winpt-1.2.0/Src/WinPT.cpp 2006-12-02 20:07:49.000000000 +0100
++++ winpt-1.2.0/Src/WinPT.cpp 2008-02-26 14:53:57.000000000 +0100
+@@ -119,13 +119,13 @@ gpg_prefs_ok (void)
+ {
+ char *p;
+
+- p = get_reg_entry_gpg4win ("gpg.exe");
++ p = get_reg_entry_gpg4win ("gpg2.exe");
+ if (!p || file_exist_check (p) != 0) {
+ free_if_alloc (p);
+ p = get_reg_entry_gpg ("gpgProgram");
+ if (!p || file_exist_check (p) != 0) {
+ free_if_alloc (p);
+- log_debug ("gpg_prefs_ok: could not locate gpg.exe");
++ log_debug ("gpg_prefs_ok: could not locate gpg2.exe");
+ return false;
+ }
+ }
+@@ -175,7 +175,7 @@ load_gpg_env (void)
+ char *pkr;
+ int err = 0;
+
+- p = get_reg_entry_gpg4win ("gpg.exe");
++ p = get_reg_entry_gpg4win ("gpg2.exe");
+ if (!p)
+ return (1);
+ if (file_exist_check (p)) {
+@@ -417,7 +417,7 @@ enable_mobile_mode (void)
+ }
+ fclose (fp);
+ DeleteFile (test_fname);
+- if (file_exist_check ("gpg.exe")) {
++ if (file_exist_check ("gpg2.exe")) {
+ MessageBox (NULL, "The GnuPG program needs to be in the same directory\n"
+ "as the WinPT program", "WinPT Error", MB_ERR);
+ return -1;
+diff -rup winpt-1.2.0/Src/wptGPG.cpp winpt-1.2.0/Src/wptGPG.cpp
+--- winpt-1.2.0/Src/wptGPG.cpp 2006-12-02 20:05:22.000000000 +0100
++++ winpt-1.2.0/Src/wptGPG.cpp 2008-02-26 15:03:43.000000000 +0100
+@@ -176,27 +176,6 @@ get_gnupg_keyring (int pub, int strict)
+ }
+
+
+-/* Return the full path (with the gpg exe name). First the registry is scanned
+- for the entry 'gpgProgram'. If it wasn't set, the default path is the
+- appended string 'gpg.exe' is used. */
+-char*
+-get_gnupg_prog (void)
+-{
+- char *path;
+- char *pgm;
+-
+- pgm = get_reg_entry_gpg (GPG_REG_EXE);
+- if (pgm)
+- return pgm;
+- path = get_gnupg_path ();
+- if (!path)
+- return NULL;
+- pgm = make_filename (path, "gpg", "exe");
+- free_if_alloc (path);
+- return pgm;
+-}
+-
+-
+ /* Retrieve the first usable secret key from cache.
+ If no usable was found, @ret_no_useable is 1.
+ Return value: the keyid of the secret key. */
+@@ -310,7 +289,29 @@ get_gnupg_default_key (void)
+ char*
+ check_for_gpg4win (void)
+ {
+- return get_reg_entry_gpg4win ("gpg.exe");
++ return get_reg_entry_gpg4win ("gpg2.exe");
++}
++
++
++/* Return the full path (with the gpg exe name). First the registry is scanned
++ for the entry 'gpgProgram'. If it wasn't set, the default path is the
++ appended string 'gpg.exe' is used. */
++char*
++get_gnupg_prog (void)
++{
++ char *gpgexe;
++
++ gpgexe = get_reg_entry_gpg (GPG_REG_EXE);
++ if (!gpgexe || file_exist_check (gpgexe)) {
++ free_if_alloc (gpgexe);
++ gpgexe = check_for_gpg4win ();
++ if (!gpgexe || file_exist_check (gpgexe)) {
++ free_if_alloc (gpgexe);
++ gpgexe = NULL;
++ }
++ }
++
++ return gpgexe;
+ }
+
+
+@@ -322,14 +323,8 @@ check_gnupg_prog (void)
+ int rc = 0;
+
+ gpgexe = get_gnupg_prog ();
+- if (!gpgexe || file_exist_check (gpgexe)) {
+- free_if_alloc (gpgexe);
+- gpgexe = check_for_gpg4win ();
+- if (!gpgexe || file_exist_check (gpgexe))
+- rc = WPTERR_GPG_EXEFILE;
+- else
+- set_reg_entry_gpg (GPG_REG_EXE, gpgexe);
+- }
++ if (!gpgexe)
++ rc = WPTERR_GPG_EXEFILE;
+ free_if_alloc (gpgexe);
+ return rc;
+ }
+diff -rup winpt-1.2.0/Src/wptGPGPrefsDlg.cpp winpt-1.2.0/Src/wptGPGPrefsDlg.cpp
+--- winpt-1.2.0/Src/wptGPGPrefsDlg.cpp 2006-11-04 14:29:06.000000000 +0100
++++ winpt-1.2.0/Src/wptGPGPrefsDlg.cpp 2008-02-26 15:04:22.000000000 +0100
+@@ -59,7 +59,7 @@ load_gpg4win_values (HWND dlg)
+ path = get_reg_entry_gpg4win (NULL);
+ if (!path)
+ return false;
+- p = make_filename (path, "gpg", "exe");
++ p = make_filename (path, "gpg2", "exe");
+ if (p) {
+ if (file_exist_check (p) == 0) {
+ SetDlgItemText (dlg, IDC_GPGPREFS_EXEDIR, p);
+@@ -326,7 +326,7 @@ gpgprefs_dlg_proc (HWND dlg, UINT msg, W
+ if (GetDlgItemText (dlg, IDC_GPGPREFS_EXEDIR,
+ exedir, DIM (exedir)-1) > 0)
+ break;
+- name = make_filename (folder, "gpg", "exe");
++ name = make_filename (folder, "gpg2", "exe");
+ if (file_exist_check (name) == 0)
+ SetDlgItemText (dlg, IDC_GPGPREFS_EXEDIR, name);
+ free_if_alloc (name);
+diff -rup winpt-1.2.0/Src/wptGPGUtil.cpp winpt-1.2.0/Src/wptGPGUtil.cpp
+--- winpt-1.2.0/Src/wptGPGUtil.cpp 2006-11-12 18:03:41.000000000 +0100
++++ winpt-1.2.0/Src/wptGPGUtil.cpp 2008-02-26 15:22:47.000000000 +0100
+@@ -157,8 +157,7 @@ gpg_decode_c_string (const char *src, ch
+ static char*
+ read_gpg_program (void)
+ {
+- return get_reg_entry (HKEY_CURRENT_USER,
+- "Software\\GNU\\GnuPG", "gpgProgram");
++ return get_gnupg_prog ();
+ }
+
+
+
Property changes on: trunk/patches/winpt/01-gpg-path.patch
___________________________________________________________________
Name: svn:executable
+ *
More information about the Gpg4win-commits
mailing list