branch: elpa/age
commit dcebd468a870c3d36b15b6ee5befbaa2f29cda2c
Author: Bram Schoenmakers <[email protected]>
Commit: Bram Schoenmakers <[email protected]>

    Detect development version of age
    
    This version identifies itself with (devel), replace that with version
    9.9.9.
    
    The Termux package for age uses the development version. Age.el did
    not recognize the version string and therefore didn't load.
---
 age.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/age.el b/age.el
index c70aa8ca3e9..f7277909397 100644
--- a/age.el
+++ b/age.el
@@ -185,11 +185,12 @@ version requirement is met."
 (defun age-config--make-age-configuration (program)
   "Make an age configuration for PROGRAM."
   (let ((version
-         (let ((v (shell-command-to-string (format "%s --version" program))))
+         (pcase (shell-command-to-string (format "%s --version" program))
            ;; assuming https://semver.org/
-           (when (string-match "\\([0-9]+\\.[0-9]+\\.[0-9]+\\)" v)
-             (match-string 1 v)))))
-    (list (cons 'program program)
+           ((rx (let v (seq(+ digit) "." (+ digit) "." (+ digit)))) v)
+           ((rx "(devel)") "9.9.9")
+           (_ nil))))
+    (list (cons 'program "age")
           (cons 'version version))))
 
 ;;;###autoload

Reply via email to