]> git.eshelyaron.com Git - emacs.git/commitdiff
Make pin and ensure compatible
authorMatthew Feinberg <ketbra@users.noreply.github.com>
Thu, 21 Jul 2016 12:38:30 +0000 (08:38 -0400)
committerMatthew Feinberg <ketbra@users.noreply.github.com>
Thu, 21 Jul 2016 12:38:30 +0000 (08:38 -0400)
`:pin` does not work with `:ensure`, because it doesn't add the package to package-pinned-packages until after reading the package archive contents.  This change causes the package archive contents to be reread if the package is pinned and `:ensure` is being used.

Copyright-paperwork-exempt: yes

lisp/use-package/use-package.el

index f81b64a02c76ae71d1cdaa62ecfa169d69ed26e7..92c35a429505355db8345dfc1dee58e861c82988 100644 (file)
@@ -500,6 +500,8 @@ manually updated package."
 (defun use-package-ensure-elpa (package &optional no-refresh)
   (if (package-installed-p package)
       t
+    (if (and (not no-refresh) (assoc package package-pinned-packages))
+        (package-read-all-archive-contents))
     (if (or (assoc package package-archive-contents) no-refresh)
         (package-install package)
       (progn