(package-menu-execute): Use it to delete packages in order.
(package--sort-deps-in-alist): New function.
(package-menu-mark-install): Can mark dependencies.
+ (package--newest-p): New function.
+ (package-delete): Don't delesect when deleting an older version of
+ an upgraded package.
2015-02-05 Stefan Monnier <monnier@iro.umontreal.ca>
(and (memq pkg (mapcar #'car (package-desc-reqs (cadr p))))
(car p))))))
+(defun package--newest-p (pkg)
+ "Return t if PKG is the newest package with its name."
+ (equal (cadr (assq (package-desc-name pkg) package-alist))
+ pkg))
+
(defun package-delete (pkg-desc &optional force nosave)
"Delete package PKG-DESC.
;; don't want it marked as selected, so we remove it from
;; `package-selected-packages' even if it can't be deleted.
(when (and (null nosave)
- (package--user-selected-p name))
+ (package--user-selected-p name)
+ ;; Don't delesect if this is an older version of an
+ ;; upgraded package.
+ (package--newest-p pkg-desc))
(customize-save-variable
'package-selected-packages (remove name package-selected-packages)))
(cond ((not (string-prefix-p (file-name-as-directory