Commit 5dfadefe authored by Ryan C. Thompson's avatar Ryan C. Thompson

Add support for update hooks

Previously we had install hooks but no update hooks.
parent 4ad42c3b
......@@ -56,8 +56,8 @@ call for doing the named package action in the given method.")
(and (el-get-method name :install) t))
(defun* el-get-register-method (name &key install update remove
install-hook remove-hook compute-checksum
install-hook update-hook remove-hook
compute-checksum guess-website)
"Register the method for backend NAME, with given functions"
(let (method-def)
(loop for required-arg in '(install update remove)
......@@ -67,7 +67,7 @@ call for doing the named package action in the given method.")
(plist-put method-def
(intern (format ":%s" required-arg))
(symbol-value required-arg))))
(loop for optional-arg in '(install-hook remove-hook
(loop for optional-arg in '(install-hook update-hook remove-hook
compute-checksum guess-website)
if (symbol-value optional-arg)
do (setq method-def
......@@ -705,8 +705,13 @@ PACKAGE may be either a string or the corresponding symbol."
(defun el-get-post-update (package)
"Post update PACKAGE. This will get run by a sentinel."
(let* ((sync el-get-default-process-sync)
(source (el-get-package-def package))
(type (el-get-package-type package))
(hooks (el-get-method type :update-hook))
(commands (el-get-build-commands package)))
;; post-update is the right place to run update-hook
(run-hook-with-args hooks package)
(el-get-build package commands nil sync 'el-get-post-update-build)))
(defun el-get-update-requires-reinstall (package)
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