Commit 3b80a0db authored by Rüdiger Sonderfeld's avatar Rüdiger Sonderfeld

Fix elpa support for Emacs 24.4.

`package-desc-vers' is obsolete (replaced by `package-desc-version')
and `package-alist' has a different layout.

el-get-elpa also calls `el-get-rmdir' in some cases with
post-remove-fun as nil.

* methods/el-get-elpa.el (el-get-elpa-update-available-p): Use
  `package-desc-version' if available.
* el-get-core.el (el-get-rmdir): Only call post-remove-fun if non-nil.
Signed-off-by: 's avatarRüdiger Sonderfeld <ruediger@c-plusplus.de>
parent 628c06cf
......@@ -158,7 +158,8 @@ entry."
(delete-directory pdir 'recursive))
((file-exists-p pdir)
(delete-file pdir)))
(funcall post-remove-fun package)))
(when post-remove-fun
(funcall post-remove-fun package))))
;;
......
......@@ -120,10 +120,14 @@ the recipe, then return nil."
"Returns t if PACKAGE has an update available in ELPA."
(assert (el-get-package-is-installed package) nil
(sprintf "Cannot update non-installed ELPA package %s" package))
(let ((installed-version
(package-desc-vers (cdr (assq package package-alist))))
(available-version
(package-desc-vers (cdr (assq package package-archive-contents)))))
(let* ((pkg-version
(if (fboundp 'package-desc-version) ;; new in Emacs 24.4
#'(lambda (pkg) (package-desc-version (car pkg)))
#'package-desc-vers))
(installed-version
(funcall pkg-version (cdr (assq package package-alist))))
(available-version
(funcall pkg-version (cdr (assq package package-archive-contents)))))
(version-list-< installed-version available-version)))
(defun el-get-elpa-update (package url post-update-fun)
......
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