Commit c273d96f authored by Dimitri Fontaine's avatar Dimitri Fontaine

Get rid of el-get-demand1.

parent aec9264c
...@@ -126,20 +126,12 @@ symbol) depends" ...@@ -126,20 +126,12 @@ symbol) depends"
(defun el-get-package-initialized-p (package) (defun el-get-package-initialized-p (package)
(eq (el-get-package-state package) 'init)) (eq (el-get-package-state package) 'init))
(defun el-get-demand1 (package)
"Install, if necessary, and init the el-get package given by
PACKAGE, a symbol"
(let ((p (symbol-name package)))
(if (string= (el-get-package-status p) "installed")
(el-get-init p)
(el-get-do-install p))))
(defun el-get-dependency-installed (package dependency) (defun el-get-dependency-installed (package dependency)
"Install the given PACKAGE (a symbol) iff all its dependencies "Install the given PACKAGE (a symbol) iff all its dependencies
are now installed" are now installed"
(when (every 'el-get-package-initialized-p (when (every 'el-get-package-initialized-p
(el-get-dependencies package)) (el-get-dependencies package))
(el-get-demand1 package))) (el-get-do-install package)))
(defun el-get-dependency-error (package dependency data) (defun el-get-dependency-error (package dependency data)
"Mark PACKAGE as having failed installation due to a failure to "Mark PACKAGE as having failed installation due to a failure to
......
...@@ -299,7 +299,7 @@ PACKAGE may be either a string or the corresponding symbol." ...@@ -299,7 +299,7 @@ PACKAGE may be either a string or the corresponding symbol."
(el-get-install dep)) (el-get-install dep))
(unless non-installed-dependencies (unless non-installed-dependencies
(el-get-demand1 psym))))) (el-get-do-install psym)))))
((debug error) ((debug error)
(el-get-installation-failed package err))))) (el-get-installation-failed package err)))))
...@@ -495,26 +495,28 @@ called by `el-get' (usually at startup) for each installed package." ...@@ -495,26 +495,28 @@ called by `el-get' (usually at startup) for each installed package."
(defun el-get-do-install (package) (defun el-get-do-install (package)
"Install any PACKAGE for which you have a recipe." "Install any PACKAGE for which you have a recipe."
(el-get-error-unless-package-p package) (el-get-error-unless-package-p package)
(let* ((status (el-get-read-package-status package)) (if (string= (el-get-package-status package) "installed")
(source (el-get-package-def package)) (el-get-init p)
(method (el-get-package-method source)) (let* ((status (el-get-read-package-status package))
(install (el-get-method method :install)) (source (el-get-package-def package))
(url (plist-get source :url))) (method (el-get-package-method source))
(install (el-get-method method :install))
(when (string= "installed" status) (url (plist-get source :url)))
(error "Package %s is already installed." package))
(when (string= "installed" status)
(when (string= "required" status) (error "Package %s is already installed." package))
(message "Package %s failed to install, removing it first." package)
(el-get-remove package)) (when (string= "required" status)
(message "Package %s failed to install, removing it first." package)
;; check we can install the package and save to "required" status (el-get-remove package))
(el-get-check-init)
(el-get-save-package-status package "required") ;; check we can install the package and save to "required" status
(el-get-check-init)
;; and install the package now, *then* message about it (el-get-save-package-status package "required")
(funcall install package url 'el-get-post-install)
(message "el-get install %s" package))) ;; and install the package now, *then* message about it
(funcall install package url 'el-get-post-install)
(message "el-get install %s" package))))
(defun el-get-post-update (package) (defun el-get-post-update (package)
"Post update PACKAGE. This will get run by a sentinel." "Post update PACKAGE. This will get run by a sentinel."
......
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