Commit 9efb25fc authored by Dimitri Fontaine's avatar Dimitri Fontaine

Rewrite `el-get-dependencies' to actually traverse the dependency graph.

parent c273d96f
......@@ -14,6 +14,31 @@
(require 'el-get-core)
;;
;; topological sort, see
;; http://rosettacode.org/wiki/Topological_sort#Common_Lisp
;;
(defun el-get-dependencies (package &optional deps)
"Return the list of packages (as symbols) on which PACKAGE (a
symbol) depends"
(let* ((source (el-get-package-def (symbol-name package)))
(method (el-get-package-method source))
(pdeps (el-get-as-list (plist-get source :depends)))
(alldeps
;; Make sure all elpa packages depend on the package `package'.
;; The package `package' is an elpa package, though, so exclude it
;; to avoid a circular dependency.
(if (and (not (eq package 'package)) (eq method 'elpa))
(cons 'package pdeps)
pdeps)))
(append (list (append (list package) alldeps))
(loop for p in pdeps append (el-get-dependencies p)))))
(defun topological-sort (graph)
"return a list of packages to install in order"
nil)
;;
;; Support for tracking package states
;;
......@@ -110,19 +135,6 @@ passing DATA"
(add-hook (intern (format "el-get-post-%s-hooks" action))
`(lambda (p &optional data) (el-get-event-occurred p ',action data))))
(defun el-get-dependencies (package)
"Return the list of packages (as symbols) on which PACKAGE (a
symbol) depends"
(let* ((source (el-get-package-def (symbol-name package)))
(method (el-get-package-method source))
(deps (el-get-as-list (plist-get source :depends))))
;; Make sure all elpa packages depend on the package `package'.
;; The package `package' is an elpa package, though, so exclude
;; it to avoid a circular dependency.
(if (and (not (eq package 'package)) (eq method 'elpa))
(cons 'package deps)
deps)))
(defun el-get-package-initialized-p (package)
(eq (el-get-package-state package) 'init))
......
(:name semi
:description "SEMI is a library to provide MIME feature for GNU Emacs."
:depends (apel flim)
:depends flim
:type cvs
:module "semi"
:url ":pserver:anonymous@cvs.m17n.org:/cvs/root"
......
(:name wanderlust
:description "Wanderlust bootstrap."
:depends (apel flim semi)
:depends semi
:type cvs
:module "wanderlust"
:url ":pserver:anonymous@cvs.m17n.org:/cvs/root"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment