aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Kaludercic2022-11-03 19:28:47 +0100
committerPhilip Kaludercic2022-11-03 19:28:47 +0100
commit0e75099da83a9019bd35a37ecfad67fc4e0849e2 (patch)
tree5c6d0465f570043495319be1691b94aee6e192e4
parentec01d9a2092319a90fd95e068af689bd24fc255d (diff)
downloademacs-0e75099da83a9019bd35a37ecfad67fc4e0849e2.tar.gz
emacs-0e75099da83a9019bd35a37ecfad67fc4e0849e2.zip
* lisp/emacs-lisp/package-vc.el (package-vc-version): Use main file
-rw-r--r--lisp/emacs-lisp/package-vc.el18
1 files changed, 7 insertions, 11 deletions
diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index dd23247974f..faebd6ad6c9 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -276,17 +276,13 @@ asynchronously."
276(defun package-vc-version (pkg) 276(defun package-vc-version (pkg)
277 "Extract the commit of a development package PKG." 277 "Extract the commit of a development package PKG."
278 (cl-assert (package-vc-p pkg)) 278 (cl-assert (package-vc-p pkg))
279 (cl-loop with dir = (package-desc-dir pkg) ;FIXME: dir is nil 279 (if-let ((main-file (package-vc-main-file pkg)))
280 for file in (sort (directory-files dir t "\\.el\\'") 280 (with-temp-buffer
281 (lambda (s1 s2) 281 (insert-file-contents main-file)
282 (< (length s1) (length s2)))) 282 (package-strip-rcs-id
283 when (with-temp-buffer 283 (or (lm-header "package-version")
284 (insert-file-contents file) 284 (lm-header "version"))))
285 (package-strip-rcs-id 285 "0"))
286 (or (lm-header "package-version")
287 (lm-header "version"))))
288 return it
289 finally return "0"))
290 286
291(defun package-vc-main-file (pkg-desc) 287(defun package-vc-main-file (pkg-desc)
292 "Return the main file for PKG-DESC." 288 "Return the main file for PKG-DESC."