Function: epg-check-configuration

epg-check-configuration is an autoloaded and byte-compiled function defined in epg-config.el.gz.

Signature

(epg-check-configuration CONFIG &optional REQ-VERSIONS)

Documentation

Verify that a sufficient version of GnuPG is installed.

CONFIG should be a epg-configuration object (a plist). REQ-VERSIONS should be a list with elements of the form (MIN
. MAX) where MIN and MAX are version strings indicating a
semi-open range of acceptable versions. REQ-VERSIONS may also be a single minimum version string.

Source Code

;; Defined in /usr/src/emacs/lisp/epg-config.el.gz
;;;###autoload
(defun epg-check-configuration (config &optional req-versions)
  "Verify that a sufficient version of GnuPG is installed.
CONFIG should be a `epg-configuration' object (a plist).
REQ-VERSIONS should be a list with elements of the form (MIN
. MAX) where MIN and MAX are version strings indicating a
semi-open range of acceptable versions.  REQ-VERSIONS may also be
a single minimum version string."
  (let ((version (alist-get 'version config)))
    (unless (stringp version)
      (error "Undetermined version: %S" version))
    (catch 'version-ok
      (pcase-dolist ((or `(,min . ,max)
                         (and min (let max nil)))
                     (if (listp req-versions) req-versions
                       (list req-versions)))
        (when (and (version<= (or min epg-gpg-minimum-version)
                              version)
                   (or (null max)
                       (version< version max)))
          (throw 'version-ok t)))
      (error "Unsupported version: %s" version))))