]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow finding gpg2 binaries when gpg2 has an "unknown" version string
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 26 Aug 2019 06:02:31 +0000 (08:02 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 26 Aug 2019 06:02:31 +0000 (08:02 +0200)
* lisp/epg-config.el (epg-find-configuration): Allow finding a
usable configuration even if the version string looks like "gpg
(GnuPG) 2.2.15-unknown" (bug#35629).

lisp/epg-config.el

index 54328290c8f7e8931d048db6674e650cc55cbc6a..4a9cc7744cb57a779375bd2280429a5d71fc962c 100644 (file)
@@ -148,7 +148,11 @@ Otherwise, it tries the programs listed in the entry until the
 version requirement is met."
   (unless program-alist
     (setq program-alist epg-config--program-alist))
-  (let ((entry (assq protocol program-alist)))
+  (let ((entry (assq protocol program-alist))
+        ;; In many gnupg distributions (especially on Windows), the
+        ;; version string is "gpg (GnuPG) 2.2.15-unknown" or the like.
+        (version-regexp-alist (cons '("^[-._+ ]?unknown$" . -4)
+                                    version-regexp-alist)))
     (unless entry
       (error "Unknown protocol %S" protocol))
     (cl-destructuring-bind (symbol . alist)