]> git.eshelyaron.com Git - emacs.git/commitdiff
Revert "* package.el (package--get-activatable-pkg): Prefer source packages"
authorEli Zaretskii <eliz@gnu.org>
Thu, 8 Jun 2023 09:23:11 +0000 (12:23 +0300)
committerEli Zaretskii <eliz@gnu.org>
Thu, 8 Jun 2023 09:23:11 +0000 (12:23 +0300)
This reverts commit fb87d5008e21d1bc03547c1edf2280fb4cb8311e.
It caused problems when new versions of packages are installed
without deleting old versions.  (Bug#63757)

lisp/emacs-lisp/package.el

index 43368b59522c1ca5f60bf20e27086abbc7acf2f1..3e6acd9b3880705ac0e7d7c7943a0751b1de8142 100644 (file)
@@ -924,22 +924,14 @@ correspond to previously loaded files."
 
 (defun package--get-activatable-pkg (pkg-name)
   ;; Is "activatable" a word?
-  (let ((pkg-descs (sort (cdr (assq pkg-name package-alist))
-                         (lambda (p1 p2)
-                           (let ((v1 (package-desc-version p1))
-                                 (v2 (package-desc-version p2)))
-                             (or
-                              ;; Prefer VC packages.
-                              (package-vc-p p1)
-                              (package-vc-p p2)
-                              ;; Prefer builtin packages.
-                              (package-disabled-p p1 v1)
-                              (not (package-disabled-p p2 v2))))))))
+  (let ((pkg-descs (cdr (assq pkg-name package-alist))))
     ;; Check if PACKAGE is available in `package-alist'.
     (while
         (when pkg-descs
           (let ((available-version (package-desc-version (car pkg-descs))))
-            (package-disabled-p pkg-name available-version)))
+            (or (package-disabled-p pkg-name available-version)
+                ;; Prefer a builtin package.
+                (package-built-in-p pkg-name available-version))))
       (setq pkg-descs (cdr pkg-descs)))
     (car pkg-descs)))