Function: package--sort-deps-in-alist

package--sort-deps-in-alist is a byte-compiled function defined in package.el.gz.

Signature

(package--sort-deps-in-alist PACKAGE ONLY)

Documentation

Return a list of dependencies for PACKAGE sorted by dependency.

PACKAGE is included as the first element of the returned list. ONLY is an alist associating package names to package objects. Only these packages will be in the return value and their cdrs are destructively set to nil in ONLY.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/package.el.gz
(defun package--sort-deps-in-alist (package only)
  "Return a list of dependencies for PACKAGE sorted by dependency.
PACKAGE is included as the first element of the returned list.
ONLY is an alist associating package names to package objects.
Only these packages will be in the return value and their cdrs are
destructively set to nil in ONLY."
  (let ((out))
    (dolist (dep (package-desc-reqs package))
      (when-let* ((cell (assq (car dep) only))
                  (dep-package (cdr-safe cell)))
        (setcdr cell nil)
        (setq out (append (package--sort-deps-in-alist dep-package only)
                          out))))
    (cons package out)))