Fix pkg description file name when pkg name has numbers (Bug#77143)

* lisp/subr.el (package--description-file): Match end of string and add
`snapshot` among the possible version names.

Copyright-paperwork-exempt: yes
This commit is contained in:
Lin Jian 2025-03-21 09:35:07 +08:00 committed by Stefan Monnier
parent 6f311883d2
commit bdee248172

View file

@ -7270,7 +7270,9 @@ 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)
;; This needs to match only the version strings that can be
;; generated by `package-version-join'.
(if (string-match "\\([^.].*?\\)-\\([0-9]+\\(?:[.][0-9]+\\|\\(?:pre\\|beta\\|alpha\\|snapshot\\)[0-9]+\\)*\\)\\'" subdir)
(match-string 1 subdir) subdir))
"-pkg.el"))