[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master b901d20 1/2: Parse also `package-alist` when getting depen

From: John Wiegley
Subject: [elpa] master b901d20 1/2: Parse also `package-alist` when getting dependencies (#58).
Date: Fri, 08 Jan 2016 20:52:19 +0000

branch: master
commit b901d20a66f6c7b9c6b3d9db0f0dbdb01faf9aea
Author: Thierry Volpiatto <address@hidden>
Commit: John Wiegley <address@hidden>

    Parse also `package-alist` when getting dependencies (#58).
    * async-bytecomp.el (async-bytecomp--get-package-deps):
    Try `package-archive-contents` and also `package-alist`
    in case pkg no more present in `package-archive-contents`.
 packages/async/async-bytecomp.el |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/packages/async/async-bytecomp.el b/packages/async/async-bytecomp.el
index a2885af..81e526b 100644
--- a/packages/async/async-bytecomp.el
+++ b/packages/async/async-bytecomp.el
@@ -110,10 +110,15 @@ All *.elc files are systematically deleted before 
 (defun async-bytecomp--get-package-deps (pkg &optional only)
   ;; Same as `package--get-deps' but parse instead `package-archive-contents'
   ;; because PKG is not already installed and not present in `package-alist'.
-  (let* ((pkg-desc (cadr (assq pkg package-archive-contents)))
+  ;; However fallback to `package-alist' in case PKG no more present
+  ;; in `package-archive-contents' due to modification to `package-archives'.
+  ;; See issue #58.
+  (let* ((pkg-desc (cadr (or (assq pkg package-archive-contents)
+                             (assq pkg package-alist))))
          (direct-deps (cl-loop for p in (package-desc-reqs pkg-desc)
                                for name = (car p)
-                               when (assq name package-archive-contents)
+                               when (or (assq name package-archive-contents)
+                                        (assq name package-alist))
                                collect name))
          (indirect-deps (unless (eq only 'direct)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]