Subject: bug#77143: 30.1; package--description-file handles some packages wrong

From: Lin Jian <[email-masked]>
Date: Fri, 21 Mar 2025 10:12:02 +0800

I made a patch to fix this.

I also notice that the version part of the regex can be improved because
it does not take `version-regexp-alist' into consideration.  But that is
out of the scope of this bug.
>From 5ab9c353659b853ca64e33f1af9000cc3c6d9d02 Mon Sep 17 00:00:00 2001
From: Lin Jian <[email-masked]>
Date: Fri, 21 Mar 2025 09:35:07 +0800
Subject: [PATCH] Fix pkg description file name when pkg name has numbers
 (Bug#77143)

* lisp/subr.el (package--description-file): Match end of string.

Copyright-paperwork-exempt: yes
---
 lisp/subr.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/subr.el b/lisp/subr.el
index 10b7da3535b..c49fcd5bf01 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -7247,7 +7247,7 @@ as a list.")
   "Return package description file name for package DIR."
   (concat (let ((subdir (file-name-nondirectory
                          (directory-file-name dir))))
-            (if (string-match "\\([^.].*?\\)-\\([0-9]+\\(?:[.][0-9]+\\|\\(?:pre\\|beta\\|alpha\\)[0-9]+\\)*\\)" subdir)
+            (if (string-match "\\([^.].*?\\)-\\([0-9]+\\(?:[.][0-9]+\\|\\(?:pre\\|beta\\|alpha\\)[0-9]+\\)*\\)\\'" subdir)
                 (match-string 1 subdir) subdir))
           "-pkg.el"))
 
-- 
2.47.1